New-SCRunAsAccount

Creates a VMM Run As account.

Syntax

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

Description

The New-SCRunAsAccount cmdlet creates a Run As account in Virtual Machine Manager (VMM).

Examples

Example 1: Create a Run As account

PS C:\> $Creds = Get-Credential
PS C:\> $RunAsAccount = New-SCRunAsAccount -Name "RunAsAccount01" -Credential $Creds

The first command uses the Get-Credential cmdlet to prompt you to supply a user name and password and stores the credentials in the $Credential variable.

The second command creates a Run As account named RunAsAccount01 using the credentials provided in $Creds.

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:True
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:True
Position:0
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
-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.