我使用PowerShell从AD中提取部门列表:
$departments = Get-ADUser -Filter * -Property Department |
Where-Object { $_.Department } |
Select -Expand Department -Unique
使用该列表,我验证了我的用户输入:
do {
$Dept = Read-Host "Enter the desired department"
} until ($departments -contains $Dept)
$strFilter = "(&(objectCategory=User)(Department=*$Dept*))"
$colResults = Get-ADUser -LDAPFilter $strFilter |
Select-Object -Expand DistinguishedName
但是我收到以下错误消息:
Get-ADUser : This operation returned because the timeout period expired
At line:5 char:15 + $colResults = Get-ADUser -LDAPFilter $strFilter |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADUser], ADException
+ FullyQualifiedErrorId : This operation returned because the timeout period
expired,Microsoft.ActiveDirectory.Management.Commands.GetADUser
我必须更改哪些参数才能克服此超时错误?
答案 0 :(得分:2)
不要使用(Department=*$Dept*)
- 您已经知道$Dept
存在完全匹配 - (Department=$Dept)
已足够
*$Dept*
会提示DSA检查范围内的每个对象,而不仅仅是$Dept
的完全匹配,还有Department
}属性值以$Dept
<uses-permission android:name="android.permission.INTERNET" />