GWMI_Remote Servers

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
scharique
Posts: 131
Last visit: Wed Dec 03, 2014 11:02 am

GWMI_Remote Servers

Post by scharique »

Hello experts,Jeff's book gives me new ideas everyday and I learn, yet I am novice and I stumble. I am trying to run this simple WMI query against my DCs, it works in my QA envrionment where PoSH is V2 CTP and does not work in production, where PoSH is v1, it fails with RPC server is unavailable error. I understand that true remote capabilites have yet to be introduced in V2 with WinRM and Runspaces (looks very cool), but I reckon there should be a work around to this in current scenario.gc dcs.txt | % { "querying $_" ; Get-WmiObject "win32_processor" -co $_ | Select-Object Name,Version } And secondally, if I may, how does one go about running multiple WMI queries on multiple computers, I would like to add more GWMI queries to gather OS, Disk, and BIOS information within the same query and ideally be able to export it all out to an html.Couple of good reads I have done today regarding the export, do not go into details with HTML options, following are the links.http://www.microsoft.com/technet/script ... i-part3/As always thanks for guiding.
User avatar
scharique
Posts: 131
Last visit: Wed Dec 03, 2014 11:02 am

GWMI_Remote Servers

Post by scharique »

Hello experts,Jeff's book gives me new ideas everyday and I learn, yet I am novice and I stumble. I am trying to run this simple WMI query against my DCs, it works in my QA envrionment where PoSH is V2 CTP and does not work in production, where PoSH is v1, it fails with RPC server is unavailable error. I understand that true remote capabilites have yet to be introduced in V2 with WinRM and Runspaces (looks very cool), but I reckon there should be a work around to this in current scenario.gc dcs.txt | % { "querying $_" ; Get-WmiObject "win32_processor" -co $_ | Select-Object Name,Version } And secondally, if I may, how does one go about running multiple WMI queries on multiple computers, I would like to add more GWMI queries to gather OS, Disk, and BIOS information within the same query and ideally be able to export it all out to an html.Couple of good reads I have done today regarding the export, do not go into details with HTML options, following are the links.http://www.microsoft.com/technet/script ... i-part3/As always thanks for guiding.
User avatar
joel.delatorre
Posts: 83
Last visit: Tue Jan 17, 2017 9:26 am

GWMI_Remote Servers

Post by joel.delatorre »

Concerning the RPC error try running WbemTest to test WMI connectivity. If that fails you are sure to rule out PoSh as the problem and continue to narrow down the issue. Regarding your query. I don't think its possible to query the different classes within one statement. You would have to run a query for each class.For a more efficient query however you should filter out what you are looking for within the query statement. get-wmiobject -query "select name,version from win32_processor" -computer $_The filtering is being done on the client end versus you pulling all the data back to you and then filtering it out with the select statement, which could take time if your dealing with a lot of machines.
joel.delatorre2009-04-21 14:57:57
This topic is 14 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked