2016-09-08 25 views
0

我正在使用以下腳本獲取AD中的所有活動用戶。在一個DC上超出Active Directory操作超時限制,但不在另一個DC上

Import-Module ActiveDirectory 
Get-ADGroupMember -Identity "Domain Users" | 
    Where {$_.Enabled -eq $true} | select * | 
    Export-Csv AD.csv -NoTypeInformation -Force 

我得到超時:

Error: Get-ADGroupMember : The operation returned because the timeout limit was exceeded

只有3000 AD用戶,我能夠從一臺服務器而是從另外一個我得到這個錯誤得到報告。

+0

也許你會發現你的答案在這裏:[社會的TechNet(HTTPS: //social.technet.microsoft.com/Forums/windowsserver/en-US/b5b439fe-1aa9-4823-a3ac-d0be643a5073/query-using-ad-module-timed-out) –

回答

0

這可能對你有幫助。我開始使用Get-ADGroupMember時候能得到大的安全組超時錯誤,所以我不得不恢復使用LDAP查詢:

$Group = [ADSI]"LDAP://$($G.DistinguishedName)" 
$Members = $Group.PSBase.Invoke('Members') | ForEach-Object { 
    $_.GetType().InvokeMember('samaccountname','GetProperty',$null,$_,$null) 
} 
相關問題