How to calculate immutableID using Powersell

I have been writting script for onboarding and I have faced some issue, involving ImmutableID. the ImmutableID is the unique identifier create by your directory synchronization. it s a conversion of the ObjectGUID Attribute of your object.

So please find how to calculate the immutableID  based:

First I you have to retreive the Object GUID using :

$User = Get-ADuser $UserSamAccount -Properties * -server $DC

$ImmutableID = [system.convert]::ToBase64String(([GUID]($User.ObjectGUID)).tobytearray())



Author: John

I m a consultant who love Microsoft Exchange and try to learn as much as possible. so if you have any question related to Exchange please do not hesitate to ask. if I don't know I will know.

2 thoughts on “How to calculate immutableID using Powersell”

    1. Hello, only one attribute should be use for immutableid so please let me know which one you are using. The option will be to collect the samaccountname convert to 64 convert also you employeid to 64 and compare it to immutableid of this object in azure AD or check in ad connect


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s