Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How to get ADUsers ObjectGUID as hexadecimal format using powershell

$
0
0

Unable to get OjectGUID in hexadecimal with using get-aduser.

I'm able to covert with using LDAP query, but i have multiple account. So it would be great if anyone help to get or convert ObjectGUID with hexa format using powershell


$guid = ([ADSI]'LDAP://CN=name,dc=dc,DC=com').Properties['objectguid'].item(0)
$guidInHEX = [string]::Empty
$guid | % { $guidInHEX += '{0:X}' -f $_ }
$guidInHEX




Viewing all articles
Browse latest Browse all 21975

Trending Articles