I found this page which contains an old oneliner to get a user GUID in PowerShell – but sadly it doesn’t work anymore.
After some tricking around, I found the following to work:
1 | (new-object Guid(,(([directoryservices.directorysearcher] "(samaccountname=theuser)").findall())[0].properties["objectguid"][0])).ToString() |
Recent Comments