Convert-EntraObjectIDAndSID
SYNOPSIS
Converts between Microsoft Entra ID SID and Object ID formats.SYNTAX
DESCRIPTION
Automatically detects whether the input is a SID (S-1-12-1-…) or an Object ID (GUID) and converts it to the other format.- SID (S-1-12-1-…) → returns the corresponding Object ID (GUID)
- Object ID (GUID) → returns the corresponding SID (S-1-12-1-…)
EXAMPLES
EXAMPLE 1
EXAMPLE 2
EXAMPLE 3
PARAMETERS
-Value
The SID or Object ID to convert. Accepts pipeline input.- SID format: S-1-12-1-
{4 decimal numbers separated by dashes} - Object ID format: GUID (e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
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.INPUTS
System.String
Not documented.OUTPUTS
NOTES
Entra ID uses a specific SID format: S-1-12-1-{4 UInt32 components derived from the GUID bytes}.
This conversion is bijective: SID <-> ObjectID.