![]() ![]() WMI queries using Get-WmiObject always work with al versions of PowerShell. The WMI namespace monitor classes were added to the OS set at Vista and cannot be used in earlier systems. ![]() They are part of the OS and subsystems, drivers and software that is installed on the system. WMI and its classes are not part of PowerShell. The class was added at Vista and always worked Upgrading to V3 will not add the class even if it could be done. There are other options in the wmic command like MonitorManufacturer that could be used, but I think that needs that the proper monitor driver is installed in order to return the correct information. The issue is with XP and WS2003 where the class doesn't exist. The monitor class works in PS2 and does not require V3 or later. To upgrade, he will need to install Management Pack 3.0 and jrv is right, Get-WmiObject Win32_DesktopMonitor | select * works using PS2 on a 2008R2.īut if you have a a Generic PNP Monitor configured in WMI, this is the result you will have. The VB piece for grabbing the monitor data. ![]() I don't mind using VB I just need to put it in my script and call We only use the Generic PNP Monitor driver. Win32DesktopMonitor - c code samples WMI query - sample windows WQL with C, Availability property of Win32DesktopMonitor Get a specified instance of Win32DesktopMonitor by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c sample code. This script only grabs info from Device Manager, so it will only work if they are using the monitor driver for a specific monitor, which we don't. DISCLAIMER: This post is provided "AS IS" with no warranties of any kind, either expressed or implied, and confers no rights. MCSE Server | Desktop | Messaging | Collaboration | Productivity | Mobility | Cloud Platform and Infrastructureĭont forget to mark as Answered if you found this post helpful. I had this script for years, I found in searching the web at that time. Lastly, is it possible to enable tab autocomplete for 3rd party compiled software that's installed and set as an environmental variable? For example, I would like to be able to tab computer switches for Nmap similar to how you'd see it in a bash shell.StrComputer = "." Set objWMIService = GetObject( "winmgmts:" _
0 Comments
Leave a Reply. |