When I use this command on all Win2012 R2 servers and 90% of Win2008 R2 I get information back from remote servers. But on a couple of Win2008 R2 I don’t get an error I just get the PS> prompt with no info. What needs to be turned on these Win2008 R2 to get the information. Enable-Remoting -Force is turned on. I did a WinRM Quickconfig but nothing. I’ve compared the Win2008 R2 servers that work with the ones that don’t work and can’t seem to find the difference.
EXCELLENT. Now we’re making progress. The components all work, just not together. I’m assuming that one of the following two are true, but I want you to confirm:
When you run Invoke-Command, you’re logged onto your computer as the same user that you just used to log onto the servers’ consoles, and your computer and the servers are all in the same domain or in trusting domains
OR
When you run Invoke-Command, you specify -Credential and provide the same username that you just used to log onto the servers’ consoles.
I know you don’t do this for the ones that are working, but these ones aren’t working, so we take some extra steps to try and pinpoint the problem. One potential problem is credential delegation not working for some reason; were you to try #2 and explicitly provide a credential, it’d eliminate that as a possibility. We’ve already determined that Remoting is fine, and that the WebAdministration module works. So we have to start branching out and testing other things.
Additionally, try using Enter-PSSession to connect to a non-working server, load WebAdministration and try your IIS: drive. Do you get results, or still just a blank prompt, or maybe an error message? You can do this with or without -Credential.
How about that? See, Enter-PSSession and Invoke-Command do the exact same thing, in the same way. Enter-PSSession wasn’t supposed to work. The only thing I can think of is some kind of timing in WebAdministration loading, so I’m having you try Start-Sleep.
If that returns false, you may be running into a weird UAC issue. Might try running your console as administrator and giving the code above another try. Should return true if you have elevated rights (which is needed to import the WebAdministration Module).
I solved half the problem. It must be a firewall issue. I RDP into another server and ran the invoke-command to all the servers that showed just a prompt and it worked fine. I got the results. My PC from home via VPN must be blocking results from these servers.
I got a TRUE results… as mentioned on another reply …
I solved half the problem. It must be a firewall issue. I RDP into another server and ran the invoke-command to all the servers that showed just a prompt and it worked fine. I got the results. My PC from home via VPN must be blocking results from these servers.