Disable-SCRunAsAccount

Disables a Run As account so that it cannot be used.

Syntax

Disable-SCRunAsAccount
       [-VMMServer <ServerConnection>]
       [-RunAsAccount] <RunAsAccount>
       [-RunAsynchronously]
       [-PROTipID <Guid>]
       [-JobVariable <String>]
       [-OnBehalfOfUser <String>]
       [-OnBehalfOfUserRole <UserRole>]
       [<CommonParameters>]
Disable-SCRunAsAccount
       [-VMMServer <ServerConnection>]
       -JobGroup <Guid>
       [-RunAsynchronously]
       [-PROTipID <Guid>]
       [-JobVariable <String>]
       [-OnBehalfOfUser <String>]
       [-OnBehalfOfUserRole <UserRole>]
       [<CommonParameters>]

Description

The Disable-SCRunAsAccount cmdlet disables a Run As account so that it cannot be used by Virtual Machine Manger (VMM). To re-enable the Run As account, use the Enable-SCRunAsAccount cmdlet.

Examples

Example 1: Disable a Run As account

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> Disable-SCRunAsAccount -RunAsAccount $RunAsAccount

The first command gets the Run As account object named RunAsAccount01 and stores the object in the $RunAsAccount variable.

The second command disables the Run As account stored in $RunAsAccount.

Required Parameters

-JobGroup

Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsAccount

Specifies a Run As account that contains credentials with permission to perform this action.

Type:RunAsAccount
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OnBehalfOfUser

Specifies a user name. This cmdlet operates on behalf of the user that this parameter specifies.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-OnBehalfOfUserRole

Specifies a user role. To obtain a user role, use the Get-SCUserRole cmdlet. This cmdlet operates on behalf of the user role that this parameter specifies.

Type:UserRole
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

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

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

RunAsAccount

This cmdlet returns a RunAsAccount object.