나는이 스크립트를 작성하여 AD의 PC와 서버를 두 개의 differnet 스프레드 시트로 추출했습니다. 하지만 스크립트를 실행할 때마다 다음 오류가 발생합니다. 누군가 내가 잘못 가고있는 것을 지적함으로써 나를 도울 수 있습니까? 스크립트 아래Powershell - 조건부 연산자
Get-ADComputer : The server has returned the following error: invalid enumeration context.
At line:3 char:1
+ Get-ADComputer -filter { OperatingSystem -ne '*server*' -OR Operating ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADComputer], ADException
+ FullyQualifiedErrorId : The server has returned the following error: invalid enumeration context.,Microsoft.ActiveDirectory.Management.Commands.GetADComputer
Get-ADComputer : The server has returned the following error: invalid enumeration context.
At line:6 char:1
+ Get-ADComputer -filter { OperatingSystem -eq '*server*' -OR Operating ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADComputer], ADException
+ FullyQualifiedErrorId : The server has returned the following error: invalid enumeration context.,Microsoft.ActiveDirectory.Management.Commands.GetADComputer
됩니다 :
이
내가 점점 오전 오류입니다 - 내 조직에 적응 할 때import-module ac*
Get-ADComputer -filter { OperatingSystem -ne '*server*' -OR OperatingSystemVersion -Like '*5.1*' -OR OperatingSystemVersion -Like '*6.1*' -and Enabled -eq "true"} -SearchBase 'OU=IMComputers,OU=IM,dc=image,dc=inter' -Properties '*' | Select Name,OperatingSystem,Status, OperatingSystemVersion, `
LastLogonDate,CanonicalName | Export-Csv -NoType "C:\Temp\PC's in AD" -Encoding UTF8
Get-ADComputer -filter { OperatingSystem -eq '*server*' -OR OperatingSystemVersion -Like '*5.0*' -OR OperatingSystemVersion -Like '*5.2*' -OR OperatingSystemVersion -Like '*6.0*' -OR OperatingSystemVersion -Like '*6.1*' -OR OperatingSystemVersion -Like '*6.2*' -OR OperatingSystemVersion -Like '*6.3*' -and Enabled -eq "true"} -SearchBase 'OU=IMComputers,OU=IM,dc=image,dc=inter' -Properties '*' | Select Name,OperatingSystem,Status, OperatingSystemVersion, `
LastLogonDate,CanonicalName | Export-Csv -NoType "C:\Temp\Servers in AD" -Encoding UTF8