Published: 20.Mar 2020
Categories:

Get Immutable ID of AD object

Convert ObjectGUID (on-premise object) to ImmutableID (in cloud object).

Script

Clear-Host
 
$UserSamAccount = Read-Host "Provide SamAccountName of a user"
 
$User = Get-ADuser $UserSamAccount -Properties ObjectGUID
 
$ImmutableID = [system.convert]::ToBase64String(([GUID]($User.ObjectGUID)).tobytearray())
 
Write-Host "ImmutableID for user $UserSamAccount is:" -ForegroundColor Cyan
$ImmutableID
5 3 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
PowerAddict.net - Lubomir Goban  ---  Find me on - 
LinkedIn
0
Would love your thoughts, please comment.x
()
x