Compartilhar via


Get-SCSMRunAsAccount

Get-SCSMRunAsAccount

Gets RunAs accounts.

Syntax

Parameter Set: FromDomainUserName
Get-SCSMRunAsAccount [[-Domain] <String> ] [[-UserName] <String> ] [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromDisplayName
Get-SCSMRunAsAccount [-DisplayName] <String[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromId
Get-SCSMRunAsAccount [-Id] <Guid[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Parameter Set: FromName
Get-SCSMRunAsAccount [-Name] <String[]> [-ComputerName <String[]> ] [-Credential <PSCredential> ] [-SCSession <Connection[]> ] [ <CommonParameters>]

Detailed Description

The Get-SCSMRunAsAccount cmdlet retrieves RunAs accounts. RunAs accounts contain the user credentials under which workflows run. They make it possible for Service Manager to act on behalf of a specific user. If the Name parameter, the DisplayName parameter, or the Domain parameter and the UserName parameter are omitted, all RunAs accounts are returned. The Name or DisplayName parameters support wildcard matching.

Parameters

-ComputerName<String[]>

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 (.).

Aliases

none

Required?

false

Position?

named

Default Value

localhost

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Credential<PSCredential>

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.

Aliases

none

Required?

false

Position?

named

Default Value

User account of the current context

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-DisplayName<String[]>

Specifies the display name of the RunAs account profile name to retrieve.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Domain<String>

Specifies the domain of the RunAs account to be retrieved.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Id<Guid[]>

Specifies the ID of the SecureReference property of the RunAsAccount object. This may be a GUID or a string that will be converted to a GUID.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Name<String[]>

Specifies the name of the RunAs account to retrieve.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-SCSession<Connection[]>

Specifies a connection to a management server. The default is the current management group connection.

Enter a ManagementGroupConnection object that is returned by the Get-SCManagementGroupConnection cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-UserName<String>

Specifies the user name to use for the RunAs account.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.Guid

    You can pipe a GUID of a RunAsAccount to the Id parameter of the Get-SCSMRunAsAccount cmdlet.

  • System.String

    You can pipe a name of a RunAsAccount to the Name parameter of the Get-SCSMRunAsAccount cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.EnterpriseManagement.Core.SdkUtilities.Security.UserAccount

    The object that encapsulates the RunAs account name and the credentials that are associated with that RunAs account.

Examples

Example 1: Get the RunAs account information from Service Manager

This command retrieves the RunAs account information from Service Manager.

PS C:\>Get-SCSMRunAsAccount

New-SCSMRunAsAccount

Remove-SCSMRunAsAccount

Update-SCSMRunAsAccount