Revoke-VMConnectAccess

Revokes access for one or more users to connect to a one or more virtual machines.

Syntax

Revoke-VMConnectAccess
      [-VMName] <String[]>
      [-UserName] <String[]>
      [-ComputerName <String[]>]
      [-Passthru]
Revoke-VMConnectAccess
      [-VMId] <Guid[]>
      [-UserName] <String[]>
      [-ComputerName <String[]>]
      [-Passthru]

Description

The Revoke-VMConnectAccess cmdlet revokes access for one or more users to connect to one or more virtual machines. This cmdlet is intended for use in providing other applications with the appropriate permissions required to initiate a session with Virtual Machine Connection. Examples of such applications are Virtual Machine Manager.

Examples

Example 1

PS C:\>Revoke-VMConnectAccess -VMName VM1 -UserName Contoso\John

This command revokes the access of user Contoso\John to connect to virtual machine VM1.

Required Parameters

-UserName

Specifies the user or users to whom access to connect to a virtual machine or machines is to be revoked, in one of the following forms.

Local User Account: john ComputerName\john

Domain User Account: CONTOSO\john Contoso.com\john

User Principal Name (UPN): john@contoso.com

Security Identifier: S-1-5-21-3165297888-301567370-576410423-1103

Type:String[]
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-VMId

Specifies the unique identifier of a virtual machine or machines to which connect access is to be revoked.

Type:Guid[]
Position:1
Default value:None
Accept pipeline input:True (ByValue, ByPropertyName)
Accept wildcard characters:False
-VMName

Specifies the name or names of the virtual machine or machines to which access is being revoked.

Type:String[]
Position:1
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:True

Optional Parameters

-ComputerName

Specifies one or more virtual machine hosts on which access to connect to a virtual machine or machines is to be revoked. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer - use "localhost" or a dot (".") to specify the local computer explicitly.

Type:String[]
Position:Named
Default value:.
Accept pipeline input:False
Accept wildcard characters:False
-Passthru

Specifies that a VMConnectAce is to be passed through to the pipeline for each revocation of access.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

None by default; Microsoft.Virtualization.Powershell.VMConnectAce if -PassThru is specified.