Set-SCRunAsAccount

Modifies the properties of a Run As account.

Syntax

Set-SCRunAsAccount [-RunAsAccount] <RunAsAccount> [-Credential <PSCredential>] [-Description <String>]
 [-JobGroup <Guid>] [-JobVariable <String>] [-Name <String>] [-NoValidation] [-OnBehalfOfUser <String>]
 [-OnBehalfOfUserRole <UserRole>] [-Owner <String>] [-PROTipID <Guid>] [-RunAsynchronously]
 [-UserRole <UserRole>] [-VMMServer <ServerConnection>] [<CommonParameters>]

Description

The Set-SCRunAsAccount cmdlet modifies the properties of a Virtual Machine Manager (VMM) Run As account.

Examples

Example 1: Change the name of an existing Run As account

PS C:\> $RunAsAccount = Get-SCRunAsAccount -Name "RunAsAccount01" 
PS C:\> Set-SCRunAsAccount -RunAsAccount $RunAsAccount -Name "New Run As Account Name" -Description "This is an administrator account for accessing Hyper-V hosts."

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

The second command changes the name of the Run As account stored in $RunAsAccount to "New Run As Account Name" and adds a description for the account.

Parameters

-Credential

Specifies a credential object or, for some cmdlets, a Run As account object that contains the user name and password of an account that has permission to perform this action. Or, in the case of Restart-SCJob, has permission to complete a restarted task.

For more information about the PSCredential object, type Get-Help Get-Credential.

For more information about Run As accounts, type Get-Help New-SCRunAsAccount.

Type:PSCredential
Required:False
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-Description

Specifies a description for the Run As account.

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

Specifies the name of a VMM object.

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

Indicates that the Run As account will not validate the provided domain credentials.

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

Specifies the owner of a VMM object in the form of a valid domain user account.

- Example format: -Owner "Contoso\PattiFuller"

  • Example format: -Owner "PattiFuller@Contoso"

Type:String
Required:False
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
Required:False
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
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-RunAsynchronously

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

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

Specifies a user role object.

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

Specifies a VMM server object.

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

Outputs

RunAsAccount

This cmdlet returns a **RunAsAccount** object.