Get-WMIObject RPC Server is Unavailable

I am running the below command from my Windows 2008R2 Server

$ComputerName=Get-ADComputer -Filter *|SELECT -ExpandProperty name
Get-WmiObject win32_OperatingSystem -ComputerName $ComputerName -ErrorAction SilentlyContinue -ErrorVariable $MyErrors| select PSComputerName,Caption,SerialNumber

The results only fetch me details from Windows Server Machines and Windows XP Machines. I do not get any output from my Windows 7 Machines although the WinRM Service is running on them. But strangely from over 100+ Windows 7 Machines in the network I get 2 Windows 7 Machines listed. All of the Windows 7 Machines except two fetch the RPC Server is unavailable error

What could be the starting point in trying to resolve this problem?

Attached is an extract of services running on 3 Windows 7 Professional PC’s
Machine 1 and Machine 2 get listed when using above command; but Machine 3 does not get listed

The RPC Server unavailable message is nothing to do with the WinRM service. Get-WmiObject uses DCOM to communicate with remote machines NOT WSMan (WinRM)

The message means that either the DCOM service isn’t running on the Windows 7 machines or that a firewall is configured that is preventing WMI/DCOM access. Check that DCOM is available and that any local firewalls aren’t causing the problem

DCOM was running on the machines. But it was the Firewall creating the issue. I have created an exception for the specified Port and now everything is ok.
Thanks for putting me in the right direction

The firewall issues with DCOM is one reason that I’m moving to the CIM cmdlets wherever possible