Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Problems reading in from array

$
0
0

Your ForEach-Object is a bit of an odd way to do what you’re after…


Get-ADComputer -filter * | Select -Expand Name

Is a bit more common.

The errors are coming from inside your Get-WindowsKey function. Without seeing it, it’s a bit difficult to guess what might be wrong. But, the error “RPC server is unavailable” suggests that it isn’t connecting to the computer listed in $target.

I suspect you might be able to query the same info more easily by using the Win32_OperatingSystem class, too. That’d eliminate needing to mess with the registry, if the info you need is in there.


Viewing all articles
Browse latest Browse all 13067

Trending Articles