Skip to main content

Convert-AdcPrincipal

SYNOPSIS​

Converts a principal to either SID or NTAccount format.

SYNTAX​

__AllParameterSets​

Convert-AdcPrincipal [-Name] <string> [[-OutputType] <string>] [[-Server] <ComputerParameter>]
[[-Credential] <pscredential>] [<CommonParameters>]

DESCRIPTION​

Converts a principal to either SID or NTAccount format. It caches all resolutions, uses Convert-BuiltInToSID to resolve default builtin account names, uses Get-Domain to resolve foreign domain SIDs and names.

Basically, it is a best effort attempt to resolve principals in a useful manner.

EXAMPLES​

EXAMPLE 1​

Convert-AdcPrincipal @parameters -Name contoso\administrator

Tries to convert the user contoso\administrator into a SID

PARAMETERS​

-Credential​

The credentials to use for this operation.

Type: System.Management.Automation.PSCredential
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name​

The name of the entity to convert.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: true
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-OutputType​

Whether to return an NTAccount or SID. Defaults to SID

Type: System.String
DefaultValue: SID
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Server​

The server / domain to work with.

Type: PSFramework.Parameter.ComputerParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters​

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.