Thursday, April 10, 2014

SID history using PowerShell command

SIDHistoryThis is not the SID of ice age it regards to the security identifier of an object located in Active Directory. The user account SID can be extracted using the PowerShell cmdlet and modified them easily.

GUID

To find the properties of user with SID history detail

Get-ADUser "Mail.COM/Region/Asia/Rajis" –properties sidhistory

To search user on specific OU or domain

Get-ADUser -fILTER {nAME -eq "Rajis"} -SearchBase "OU=Asia,OU=Region,DC=MAIL,DC=COM" –properties sidhistory

 To remove SID history value as 

Get-ADUser -fILTER {nAME -eq "Rajis"} -SearchBase "OU=Asia,OU=Region,DC=MAIL,DC=COM" –properties sidhistory | foreach {Set-ADUser $_ -remove @{sidhistory=$_.sidhistory.value}}

No comments:

Post a Comment

The blog is written to the share the knowledge mainly on Microsoft Exchange Server and other Microsoft product that experienced on day-to-day life.