I'm simply trying to get all the Computers out of the AD and want to show me the IP, DNS Name, Mac-Address and description.
I got the WMI part working for my local computer but as soon as I try it with the AD Computer list its throwing around errors which i'm not able to solve myself.
I know that WMI reading is granted in our internal Network as we also use WMI Monitoring.
Powershell Code:
$computerlist = Get-ADComputer -Filter * | select Name
foreach($c in $computerlist)
{
try
{
gwmi -class "Win32_NetworkAdapterConfiguration" -ComputerName $c |
select DNSHostName, MACAddress, IPAddress, Description |
where IPAddress -NotLike "" |
where Description -NotLike "VMware*"
}
catch
{
Write-Warning "$c is unreachable!"
}
}