Jez
Jez

Reputation: 620

Powershell: Get-ADComputer from another domain returns OperatingSystem information blank/missing

Trying to list all computers with their OS information that belong to another trusted domain, but OperatingSystem and OperatingSystemVersion returns blank values:

Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion -SearchBase "" -Server OtherDomain.com.au:3268 | Format-Table Name, OperatingSystem, OperatingSystemVersion

Only the Name property is populated.

If I run this, it returns alot of info, but the OS info is all blank:

Get-ADComputer -Filter * -Properties * -SearchBase "" -Server OtherDomain.com.au:3268

If I run this command on the "OtherDomain" it works just fine:

Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion | Format-Table Name, OperatingSystem, OperatingSystemVersion

I get all 3 information I want. Is there some security issue here that I am encountering when I run it from a different domain? I can browse through Active Directory Users and Computers (dsa.msc) and see the OS information of computers in the other domain without a problem too.

I'm using Powershell 3.0

Upvotes: 4

Views: 19870

Answers (1)

Jez
Jez

Reputation: 620

Get-ADComputer -Filter * -Properties Name, OperatingSystem, OperatingSystemVersion -SearchBase "DC=OtherDomain,DC=com,DC=au" -Server "OtherDomain.com.au" | Format-Table Name, OperatingSystem, OperatingSystemVersion

Had to include a value in the Searchbase parameter (cdidn't work with a null value) and remove the port number from the Server parameter value.

Upvotes: 1

Related Questions