Remotely Managing vmware view pool users with power shell

Source: Internet
Author: User

 

1. Install the system patch of power shell V2.0 on the client. The patch number is KB968930, which includes winrm and powershell 2.0.

 

2. Set the view connection server to a trusted host of winrm:

 

Ps c: \ set-item wsman: \ localhost \ Client \ TrustedHosts-value 'IP'

 

3. Create a connection and assign it to the variable:

 

Ps c: \> $ remote = new-pssession-computername 'IP'-credential administrator

 

4. view the module of the view connection server:

 

Ps c: \> Invoke-Command $ remote {get-pssnapin}

 

5. Add the Vmware view module to the power shell:

 

Ps c: \> Invoke-Command $ remote {add-pssnapin vmware. view. broker}

 

6. Add the user to the authorization list of the pool:

 

Ps c: \> Invoke-Command $ remote {get-user-name 'username' | add-poolEntitlement-pool_id 'poolid'

 

7. Delete the user from the pool authorization list:

 

Ps c: \> Invoke-Command $ remote {get-user-name 'username' | remove-poolEntitlement-pool_id 'poolid'

8. Delete the connection MPs queue from the remote server.

 

Ps c: \> remove-pssession $ remote

 

-------------------------------------------------------------------------------

 

 

To save the password to a file, use the following method:

 

1. Save the entered password to the file:

 

Ps c: \> read-host-assecurestring | convertfrom-securestring | out-file C: \ pass.txt

 

2. Retrieve password:

 

Ps c :\> $ password = get-content C: \ pass.txt | converconverter-securestring

 

3. Create a credential object:

 

Ps c: \> $ credentials = new-object-typename System. Management. Automation. PSCredential-argumentlist "myusername", $ password

 

 

 

This article is from the "Memorandum" blog

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.