Share via


Ho to get user guid

Question

Tuesday, April 4, 2017 9:45 AM

Hi

how can i retrieve user guid via powershell?

if i run

PS C:\ Get-MsolUser

i get only userprincipalname and displayname

can't find how to get guid

thanks

All replies (3)

Tuesday, April 4, 2017 11:13 AM

Hi,

$variable = powershell { (get-aduser -identity administrator).ObjectGUID }

Use this line of code to retrive.

Please mark as answered if your OK with.


Wednesday, April 5, 2017 7:37 AM

Are you trying to get the user's unique identifier from Azure Active Directory?

Try the following command line:

Get-MsolUser -SearchString "xxx" | Select ObjectID

This command retrieves the Object ID of a list of users with xxx in the display name or email address.

Regards,

Ethan Hua

Please remember to mark the replies as answers if they helped.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Tuesday, April 11, 2017 9:20 AM

Hi,

How is it going?

Please free to let us know if you need further assistance on this.

Regards,

Ethan Hua

Please remember to mark the replies as answers if they helped.
If you have feedback for TechNet Subscriber Support, contact [email protected].