New-SCSMRunAsAccount
Creates a new Run As account.
Syntax
New-SCSMRunAsAccount
[-PassThru]
[-ManagementPack] <ManagementPack>
-Password <SecureString>
-UserName <String>
-Domain <String>
-DisplayName <String>
[-Description <String>]
[-SCSession <Connection[]>]
[-ComputerName <String[]>]
[-Credential <PSCredential>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The New-SCSMRunAsAccount cmdlet creates a RunAs account.
Examples
Example 1: Create a RunAs account
PS C:\>$Arguments = @{
>> ManagementPack = Get-SCManagementPack -DisplayName Default*
>> Password = Read-Host -AsSecureString "Password"
>> UserName = "Administrator"
>> Domain = "CONTOSO"
>> DisplayName = "Patti Fuller"
>> Description = "Patti Fuller"
>> }
PS C:\>New-SCSMRunAsAccount @Arguments
PS C:\>Get-SCRunAsAccount -DisplayName "Patti Fuller"
This command in this example creates a RunAs account.
Parameters
-ComputerName
Specifies a computer with which to establish a connection. The computer must be running the System Center Data Access service. The default value is the computer for the current management group connection.
Valid formats include a NetBIOS name, an IP address, or a fully qualified domain name (FQDN). To specify the local computer, type the computer name, "localhost", or a dot (.).
Type: | System.String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Credential
Specifies a user account under which the management group connection will run. The account must have access to the server that is specified in the ComputerName parameter, if the server is specified.
The default value is the current user. You can enter a PSCredential object that is returned by the Get-Credential cmdlet.
Type: | System.Management.Automation.PSCredential |
Position: | Named |
Default value: | Current user context |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Description
Specifies the description of the RunAs account.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DisplayName
Specifies the display name of the RunAs account.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Domain
Specifies the domain of the user for the RunAs account.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ManagementPack
Specifies the management pack in which the RunAs account will be stored. You can provide a ManagementPack object that is returned by the Get-SCSMManagementPack cmdlet.
Type: | Microsoft.EnterpriseManagement.Configuration.ManagementPack |
Position: | 1 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PassThru
Specifies the output object that represents the RunAs account. This output object can be passed to other cmdlets.
Type: | System.Management.Automation.SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Password
Specifies the password to be used with the RunAs account. Use Read-Host -assecurestring to provide the password.
Type: | System.Security.SecureString |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SCSession
Specifies a connection to a management server. The default value is the current management group connection.
You can enter a management group connection object that is returned by the Get-SCSMManagementGroupConnection cmdlet.
Type: | Microsoft.SystemCenter.Core.Connection.Connection[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserName
Specifies the user name to associate with the RunAs account.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
You cannot pipe input to this cmdlet.
Outputs
This cmdlet does not generate any output.