How to use enter-pssession and executing get-wmiobject -class win32_product?

Hi Everyone,

Basically here is what im trying to do. I would like to establish a new-pssession

$session = New-PsSession -computername $hostname

$application = Enter-PsSession -Session $session  - > then here i just want to execute the get-wmiobject -class win32_product

Exit-Pssession $session

Hope this makes sense. Really appreciate the help

Neo

September 7th, 2015 11:53pm

You do not need a possession to run a WMI call.

Get-WmiObject Win32_Product -Computer <computername>

That is all you need.

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 12:02am

Hi jrv,

Its unfortunate that i cant use this method. I know that this can be done. But we are prevented from using this. Do you know of a way to do it so that i can use enter-pssession?

September 8th, 2015 12:22am

If you cannot use WMI then PsSession won't work either.

PsSession uses remoting.  WMI uses remoting.  Both need to work in a domain.  You cannot prevent WMI from working in a domain without causing issues.  I suspect you have your remoting backwards.

PsRemoting is normally blocked or not enabled in a domain and WMI is enabled.  Only full administrators can use either without special setups.

Ask your  network administrators to explain what is enabled and how it is configured.

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 12:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics