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

Reply To: WSMan Config issue?.

$
0
0

Why are you testing remoting in this scenario?

These 3 lines are the core of your script

$os = Get-WMIObject -Class win32_operatingsystem -comp $Computer -ea stop
$cs = Get-WmiObject -Class win32_computersystem -comp $Computer -ea stop
$bios =Get-WmiObject -Class Win32_BIOS -Computername $Computer -ea Stop

You are using Get-WmiObject which uses DCOM to access the remote computer. DCOM is an older technology that has nothing to do with WSMAN and remoting. The alternative is to wrap the WMI calls in Invoke-Command or better still create a CIM session to the remote machine and use the CIM cmdlets

For the ones that fail try a WMI call from the command line – if DCOM access is disabled you’ll get an error


Viewing all articles
Browse latest Browse all 13067

Trending Articles