Converts a string or byte array security identifier into a System.Security.Principal.SecurityIdentifier
object.
ConvertTo-SecurityIdentifier [-SID] <Object> [<CommonParameters>]
ConvertTo-SecurityIdentifier
converts a SID in SDDL form (as a string), in binary form (as a byte array) into a System.Security.Principal.SecurityIdentifier
object. It also accepts System.Security.Principal.SecurityIdentifier
objects, and returns them back to you.
If the string or byte array don't represent a SID, an error is written and nothing is returned.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
SID | Object | The SID to convert to a |
true | false |
Resolve-Identity -SID 'S-1-5-21-2678556459-1010642102-471947008-1017'
Demonstrates how to convert a a SID in SDDL into a System.Security.Principal.SecurityIdentifier
object.
Resolve-Identity -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. The SID you passed in will be returned to you unchanged.
Resolve-Identity -SID $sidBytes
Demonstrates that you can use a byte array that represents a SID as the value of the SID
parameter.