Powershell - RPC server is unavailable 0x800706BA

I am building a tool for running various powershell commands on computers in our organization. I keep getting this error, and WAS getting an error about WMI; I am now able to enter-pssession on a test PC, but I can't run Get-WMIObject on it without the RPC error. I have opened ports 135, 137, 445, 5985, 5986, and 24158 through our AV firewall, and selected "Allow RPC connections" as well. I have run the enable-psremoting -force command on it, it says that it is already configured.

Any advice as to what I may be missing? I have searched the net for days now.

Thanks,
Matt
Matthew EilersI.T. SpecialistAsked:
Who is Participating?
 
Matthew EilersI.T. SpecialistAuthor Commented:
I actually may have figured it out. I have only been using powershell for a brief time, and am new to firewall stuff as well. I had built a policy within ESET remote administrator to open ports and allow RPC through. I had also checked the "Enable Personal Firewall." I turned that off and I can now query as I was expecting. Don't know if it was a fluke, or if it will stop working again because something else is going on... but for now I can hit the computers I expect to with my tool.
0
 
MacleanSystem EngineerCommented:
I suppose you need to deploy WinRM 3.0 on all systems and enable Remote Management prior to being able to run the query everywhere.
Do note, I believe that if you deploy WinRM 3.0 on Exchange 2010 servers that there is an issue. So avoid that one if applicable.
This guess is based on assuming a lot however.
For more accurate info you would need to list more detail as to which OS this applies to etc :)

More info on WinRM 3.0 here
0
 
footechCommented:
Paste a screenshot of the complete error message you're getting, as well as the command you're running.

Are you trying to query a remote computer with the Get-WmiObject cmdlet?  Or just once entered into the remote session via Enter-PsSession are you querying locally?
Have you tried the Get-CimInstance cmdlet instead?  What info are you querying (there may be a better way to query)?
0
How do you know if your security is working?

Protecting your business doesn’t have to mean sifting through endless alerts and notifications. With WatchGuard Total Security Suite, you can feel confident that your business is secure, meaning you can get back to the things that have been sitting on your to-do list.

 
Matthew EilersI.T. SpecialistAuthor Commented:
I am using Get-WMIobject -Class Win32_OperatingSystem -computername *computername* | Select-Object -Property BuildNumber,BuildType,Caption,CSDVersion,CSName,ServicePack*,SystemType

This is from one Windows 7 machine to another. I can Enter-Pssession and run commands locally, but I am unable to query using the powershell scripts.
RPCError.PNG
0
 
footechCommented:
Get-WmiObject uses different ports to gather remote information than PS Remoting.  For scalability (and simplification of firewall rules), I would actually recommend using PS Remoting (and then using Get-WmiObject/Get-CimInstance within the remote session).  Get-CimInstance by default will use WsMan (same as PS Remoting) to communicate with remote machines, but can also be configured to use DCOM/WMI.
0
 
Seth SimmonsSr. Systems AdministratorCommented:
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Accept: Matthew Eilers (https:#a42401878)

If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

seth2740
Experts-Exchange Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.