Active Directory
Commands
Get-ADObject – Gets one or more Active Directory objects
Find the objectSID of a user
Get-ADObject -Identity "CN=John Doe,OU=Users,OU=Site,DC=company,DC=com" -Properties objectSID
DistinguishedName : CN=John Doe,OU=Users,OU=Site,DC=company,DC=com
Name : John Doe
ObjectClass : user
ObjectGUID : 9f412fe7-4b01-4f80-a13b-ccf9af09d9ef
objectSID : S-1-5-21-1212883317-1493175028-447764388-3133
https://learn.microsoft.com/en-us/powershell/module/activedirectory/get-adobject