< Back

Resolve-CIdentity

Sun Jan 12, 2020 10:59 pm

NAME Resolve-CIdentity



SYNOPSIS

Gets domain, name, type, and SID information about a user or group.





SYNTAX

Resolve-CIdentity [-Name] <String> [<CommonParameters>]



Resolve-CIdentity -SID <Object> [<CommonParameters>]





DESCRIPTION

The `Resolve-CIdentity` function takes an identity name or security identifier (SID) and gets its canonical

representation. It returns a `Carbon.Identity` object, which contains the following information about the identity:



* Domain - the domain the user was found in

* FullName - the users full name, e.g. Domain\\Name

* Name - the user's username or the group's name

* Type - the Sid type.

* Sid - the account's security identifier as a `System.Security.Principal.SecurityIdentifier` object.



The common name for an account is not always the canonical name used by the operating system. For example, the

local Administrators group is actually called BUILTIN\\Administrators. This function uses the `LookupAccountName`

and `LookupAccountSid` Windows functions to resolve an account name or security identifier into its domain, name,

full name, SID, and SID type.



You may pass a `System.Security.Principal.SecurityIdentifer`, a SID in SDDL form (as a string), or a SID in binary

form (a byte array) as the value to the `SID` parameter. You'll get an error and nothing returned if the SDDL or

byte array SID are invalid.



If the name or security identifier doesn't represent an actual user or group, an error is written and nothing is

returned.





PARAMETERS

-Name <String>

The name of the identity to return.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SID <Object>

The SID of the identity to return. Accepts a SID in SDDL form as a `string`, a

`System.Security.Principal.SecurityIdentifier` object, or a SID in binary form as an array of bytes.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Carbon.Identity.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Resolve-CIdentity -Name 'Administrators'



Returns an object representing the `Administrators` group.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Resolve-CIdentity -SID 'S-1-5-21-2678556459-1010642102-471947008-1017'



Demonstrates how to use a SID in SDDL form to convert a SID into an identity.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Resolve-CIdentity -SID (New-Object 'Security.Principal.SecurityIdentifier'

'S-1-5-21-2678556459-1010642102-471947008-1017')



Demonstrates that you can pass a `SecurityIdentifier` object as the value of the SID parameter.









-------------------------- EXAMPLE 4 --------------------------



PS C:\\>Resolve-CIdentity -SID $sidBytes



Demonstrates that you can use a byte array that represents a SID as the value of the `SID` parameter.











RELATED LINKS

Test-CIdentity

Resolve-CIdentityName

http://msdn.microsoft.com/en-us/library ... ifier.aspx

http://msdn.microsoft.com/en-us/library ... 79601.aspx

ConvertTo-CSecurityIdentifier

Resolve-CIdentityName

Test-CIdentity