How to Enable Self-Service Users: Command-Line Examples

The examples in this topic show you how to use the Windows PowerShell - Virtual Machine Manager command shell to perform the following tasks:

  • Configure a Self-Service Portal. You can add a Web server (on which you have already installed the Virtual Machine Manager Self-Service Portal software) as an authorized Web server that can contact your Virtual Machine Manager server and that can act as a portal for those users or groups who are authorized to create and manage their own virtual machines.
  • Create a Self-Service Policy. You can create a self-service policy that governs what a self-service user or members of a self-service group are allowed to do when creating or managing their own virtual machines. Self-service policies are configured for a host group, which is a Virtual Machine Manager–defined group that contains a set of physical computers that are managed by Virtual Machine Manager and that host virtual machines.

In addition to the examples provided here, other examples for how to enable the self-service feature are available in the command-line help.

How to Add a Self-Service Web Server

You can add a Web server as a Self-Service Portal by typing the following command at the Virtual Machine Manager command prompt:

PS C:\> Add-SelfServiceWebServer -VMMServer VMMServer1.Contoso.com -ComputerName "SSWebServer1.Contoso.com" 

Explanation of each command line:

  • This command adds the Web server named SSWebServer1 (located in the Contoso.com domain) to the list of authorized Web servers allowed to contact the Virtual Machine Manager server called VMMServer1.

For more information about how to use the command shell to add a server as a Virtual Machine Manager self-service portal, type Get-Help Add-SelfServiceWebServer at the Virtual Machine Manager command prompt.

How to Create a New Self-Service Policy

You can create a self-service policy for a host group with specific permissions by typing the following series of commands at the Virtual Machine Manager command prompt:

PS C:\> Get-VMMServer -ComputerName "VMMServer1.Contoso.com" 
PS C:\> $VMHostGroup1 = Get-VMHostGroup -Name "Lab01" 
PS C:\> New-SelfServicePolicy -Name "SSP for Developers in Lab01" -UserOrGroup Contoso\VMMDevelopers -VMHostGroup $VMHostGroup1 -VMPermission Create,ResumeAndPause,Vmrc,Start,Stop,Remove,Shutdown,Checkpoint,Store,AllowLocalAdmin

Explanation of each command line:

  • The first command connects to VMMServer1 in the Contoso.com domain and retrieves the server object from the Virtual Machine Manager database. The following commands use this server by default.
  • The second command retrieves from the Virtual Machine Manager database the object that represents the host group named Lab01 and stores the host group object in variable $VMHostGroup1.
  • The third command uses the New-SelfServicePolicy cmdlet to perform the following tasks:
    • Create a self-service policy object in Virtual Machine Manager named "SSP for Developers in Lab01" for the Active Directory security group called VMMDevelopers (whose account is in the Contoso.com domain).
    • Apply the new self-service policy to the virtual machine host group called Lab01 (represented by variable $VMHostGroup1).
    • Grant the following permissions to users of this policy (members of VMMDevelopers) for virtual machines governed by this policy:
      Create
      Pause and resume
      Vmrc (grants users of this policy permission to access their virtual machines remotely by using Virtual Machine Remote Control [VMRC])
      Start
      Stop
      Remove
      Shut down
      Checkpoint (grants users of this policy permission to create checkpoints for their virtual machines)
      Store (grants users of this policy permission to store their virtual machines in the Virtual Machine Manager library)
      AllowLocalAdmin (grants users of this policy permission to act as local Administrator on virtual machines created under this policy)

For more information about how to use the command shell to create a self-service policy, type Get-Help New-SelfServicePolicy at the Virtual Machine Manager command prompt.

See Also

Concepts

How to Add Hosts and Library Servers: Command-Line Examples
How to Create Library Resources: Command-Line Examples
How to Deploy or Store a Virtual Machine and Find a Suitable Host: Command-Line Examples