Выше приведено:
PS C: \ EndurAutomation \ powershell \ bin> C: \ EndurAutomation \ powershell \ bin \ ets_update_constring.ps1 Исключение, вызывающее «FindAll» с аргументом «0»: «:Произошла ошибка операций. "В C: \ EndurAutomation \ powershell \ bin \ ets_update_constring.ps1: 20 char: 30 + $ result = $ ldapSearch.FindAll <<<< () + CategoryInfo: NotSpecified: (:) [], MethodInvocationException+ FullyQualifiedErrorId: DotNetMethodException </p>
$ldapDN = "dc=<masked>,dc=<masked>"
$ldapURI = "ldap://<masked>/$ldapDN"
$env = "sqlplus -S <masked> ``@env.sql > env.list"
Invoke-Expression $env
$envData = (Get-Content "env.list")
$envFilter = "(|"
foreach ($env in $envData) {
$envFilter += "(cn=$env)"
}
$envFilter += ")"
$ldapEntry = New-Object System.DirectoryServices.DirectoryEntry($ldapUR, $null, $null, [System.DirectoryServices.AuthenticationTypes]::Anonymous)
$ldapSearch = New-Object System.DirectoryServices.DirectorySearcher($ldapEntry)
$ldapSearch.PageSize = 1000
$ldapSearch.Filter = $envFilter
$result = $ldapSearch.FindAll($envFilter)