Remove-SCRunAsAccount

Removes a VMM Run As account.

Syntax

Remove-SCRunAsAccount
      [-VMMServer <ServerConnection>]
      [-RunAsAccount] <RunAsAccount>
      [-RunAsynchronously]
      [-PROTipID <Guid>]
      [-JobVariable <String>]
      [-WhatIf]
      [-Confirm]
      [-OnBehalfOfUser <String>]
      [-OnBehalfOfUserRole <UserRole>]
      [<CommonParameters>]

Description

The Remove-SCRunAsAccount cmdlet removes a Run As account from Virtual Machine Manager (VMM).

Examples

Example 1: Remove a Run As account

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount01"
PS C:\> Remove-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 removes the Run As account stored in $RunAsAccount.

Example 2: Remove a Run As account using the pipeline operator

PS C:\> Get-SCRunAsAccount -Name "RunAsAccount02" | Remove-SCRunAsAccount

This command gets the Run As account object named RunAsAccount02 and uses the pipeline operator to pass the object to the Remove-SCRunAsAccount cmdlet, which removes the account.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

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

Type:String
Position:Named
Default value:None
Required:False
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
Required:False
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
Required:False
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
Required:False
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
Required:True
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False