通过GUIDsearchAD

如何通过GUID在Active Directory中search对象? 换句话说,find属于指定GUID的对象是一个好方法?

在DC上或安装RSAT并启用AD Tools:

打开“Windows PowerShell Active Director模块”(在其他pipe理工具中find它)

get-aduser -id {guid} 

或者对于任何对象:

 get-adobject -id {guid} 

可能想通过format-list来使其可读:

 get-adobject -id {guid} | fl 

使用Powershell和QuestAD cmdlet ,下面的代码基于我的guid返回我的用户帐户。

 $Guid = "d65e4578-475a-422e-ac99-123456789012" Get-QADUser -IncludeAllProperties|Where {$_.guid -eq $Guid} 

不是最有效的方式,因为它在加载search时从AD加载所有对象,但它对我有用。

 $guid = "d65e4578-475a-422e-ac99-123456789012" foreach ($dom in (Get-adforest).Domains) { Get-ADObject -filter {ObjectGUID -eq $guid } -Properties * -Server $dom | fl }