{"id":52803,"date":"2009-08-04T03:01:00","date_gmt":"2009-08-04T03:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2009\/08\/04\/hey-scripting-guy-how-do-i-use-wmi-with-windows-powershell-to-return-information-about-properties\/"},"modified":"2009-08-04T03:01:00","modified_gmt":"2009-08-04T03:01:00","slug":"hey-scripting-guy-how-do-i-use-wmi-with-windows-powershell-to-return-information-about-properties","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-how-do-i-use-wmi-with-windows-powershell-to-return-information-about-properties\/","title":{"rendered":"Hey, Scripting Guy! How Do I Use WMI with Windows PowerShell to Return Information About Properties?"},"content":{"rendered":"<p class=\"MsoNormal\">&nbsp;<\/p>\n<p class=\"MsoNormal\"><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Question\" border=\"0\" alt=\"Hey, Scripting Guy! Question\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" width=\"34\" height=\"34\"><\/p>\n<p class=\"MsoNormal\">Hey Scripting Guy! I have been playing with WMI on Windows PowerShell, and I think the <b>Get-WmiObject<\/b> cmdlet is pretty cool. It makes it easy to query for information from computers on my network. But what if I want to actually do something? How do I do that? <\/p>\n<\/p>\n<p class=\"MsoNormal\">&#8212; SH<\/p>\n<p class=\"MsoNormal\"><span><img decoding=\"async\" class=\"nearGraphic\" title=\"Hey, Scripting Guy! Answer\" border=\"0\" alt=\"Hey, Scripting Guy! Answer\" align=\"left\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" width=\"34\" height=\"34\"><\/span>Hello SH, <\/p>\n<p class=\"MsoNormal\">Microsoft Scripting Guy Ed Wilson here. I completely understand your desire to do something. I am still a bit jet-lagged after my flight from Seattle (where I was speaking at the Microsoft TechReady conference) back to my home in Charlotte, North Carolina, in the United States. This trip took more than 12 hours to complete, and I did not get home until it was nearly 10:00 P.M. I then made a critical mistake: I went into my office at home and began working. Whoops. I did not retire for the evening until around 2:00 A.M. On Sunday, I stayed up working until nearly 3:30 A.M., and as a result I have not adjusted from my jet lag. Having spent five years traveling around the world teaching VBScript and Windows PowerShell workshops to customers, I know how to deal with jet lag, but knowing what to do and actually doing it are often two different things. Besides, I wanted to finish the experiments on the Windows 7 firewall I had begun on the plane (I wrote some pretty cool scripts). So I really feel the need to get out and do something. Let me think about your question while I sit here and sip a nice cup of hot English Breakfast tea. <\/p>\n<p class=\"MsoNormal\">Well, SH, I feel much better. I have finished my first cup of English Breakfast tea (with a stick of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cinnamon\"><font face=\"Segoe\">Ceylon<\/font><\/a> and a piece of <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cymbopogon\"><font face=\"Segoe\">lemon grass<\/font><\/a> in it). I have turned on <a href=\"http:\/\/en.wikipedia.org\/wiki\/John_Cafferty\"><font face=\"Segoe\">John Cafferty<\/font><\/a> on my Zune, and I am starting to feel human. When I go swimming this afternoon, I will be back to my normal cheerful self. Speaking of doing something, you did not mention what that something should be. I will therefore exercise some liberty in answering your question. <\/p>\n<p class=\"MsoNormal\">Normally when we think about &#8220;doing something,&#8221; we are referring to calling a method. When we think about obtaining information about something, we are referring to reading a property. When we use the <b>Get-WmiObject<\/b> cmdlet, by default we are returning information about something. We are returning the properties of objects. Each of the WMI classes represents something on our computer. For example, there is the WMI class that is named <b>Win32_PointingDevice<\/b> that is used to represent a mouse on the computer. Properties of a mouse are things like number of buttons, a right-handed or a left-handed mouse, double-click speed, and things like that. The easy way to determine the properties of a mouse is to use the <b>Get-WmiObject<\/b> cmdlet and pipe the output to the <b>Format-List<\/b> cmdlet. When you do this, make sure you choose all the properties. This is seen here. <\/p>\n<p class=\"CodeBlock\"><span><font face=\"Lucida Sans Typewriter\">PS C:&gt; Get-WmiObject -Class win32_pointingdevice | Format-List -Property *<\/p>\n<p><br>__GENUS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 2<br>__CLASS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Win32_PointingDevice<br>__SUPERCLASS<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: CIM_PointingDevice<br>__DYNASTY<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: CIM_ManagedSystemElement<br>__RELPATH<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Win32_PointingDevice.DeviceID=&#8221;ACPI\\PNP0F13\\4&amp;1<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>506BB2E&amp;0&#8243;<br>__PROPERTY_COUNT<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 33<br>__DERIVATION<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: {CIM_PointingDevice, CIM_UserDevice, CIM_LogicalD<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>evice, CIM_LogicalElement&#8230;}<br>__SERVER<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: OFFICE<br>__NAMESPACE<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: rootcimv2<br>__PATH<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: \\OFFICErootcimv2:Win32_PointingDevice.DeviceID<br><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>=&#8221;ACPI\\PNP0F13\\4&amp;1506BB2E&amp;0&#8243;<br>Availability<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>Caption<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: PS\/2 Compatible Mouse<br>ConfigManagerErrorCode<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 0<br>ConfigManagerUserConfig<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<br>CreationClassName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Win32_PointingDevice<br>Description<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: PS\/2 Compatible Mouse<br>DeviceID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: ACPIPNP0F134&amp;1506BB2E&amp;0<br>DeviceInterface<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 4<br>DoubleSpeedThreshold<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 6<br>ErrorCleared<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>ErrorDescription<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>Handedness<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 2<br>HardwareType<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: PS\/2 Compatible Mouse<br>InfFileName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: msmouse.inf<br>InfSection<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: PS2_Inst<br>InstallDate<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>IsLocked<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>LastErrorCode<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>Manufacturer<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Microsoft<br>Name<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: PS\/2 Compatible Mouse<br>NumberOfButtons<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 3<br>PNPDeviceID<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: ACPIPNP0F134&amp;1506BB2E&amp;0<br>PointingType<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 2<br>PowerManagementCapabilities :<br>PowerManagementSupported<span>&nbsp;&nbsp;&nbsp; <\/span>: False<br>QuadSpeedThreshold<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: 10<br>Resolution<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>SampleRate<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>Status<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: OK<br>StatusInfo<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>Synch<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>:<br>SystemCreationClassName<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Win32_ComputerSystem<br>SystemName<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: OFFICE<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\">As you look through the output, you will notice that some of the properties do not return any information. This is typical behavior for WMI. Often the properties that do not return any information have been inherited from other classes. The great thing about using the <b>Get-WmiObject<\/b> cmdlet is that it quickly and easily makes it possible to see if a property from a WMI class returns any information. You can use the <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=d87daf50-e487-4b0b-995c-f36a2855016e&amp;displaylang=en\"><font face=\"Segoe\">Windows PowerShell Scriptomatic<\/font><\/a> to quickly build WMI scripts using Windows PowerShell. Similar in concept and functionality to the original <a href=\"http:\/\/technet.microsoft.com\/en-us\/scriptcenter\/dd939957.aspx\"><font face=\"Segoe\">Scriptomatic<\/font><\/a>, the Windows PowerShell Scriptomatic lists WMI classes and allows you to select the class and to create a Windows PowerShell script that will retrieve the properties from that class. This is seen here:<\/p>\n<p class=\"Fig-Graphic\"><img decoding=\"async\" title=\"Image of the Windows PowerShell Scriptomatic\" alt=\"Image of the Windows PowerShell Scriptomatic\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/august\/hey0804\/hsg-08-04-09-01.jpg\" width=\"550\" height=\"383\"><\/p>\n<p class=\"MsoNormal\"><br>You can take the results of the <b>Get-WmiObject<\/b> cmdlet and pipe it to the <b>Get-Member<\/b> cmdlet. When you do this, you will see both methods and properties returned by command. You will also notice that all the properties state they are <b>{get ; set}<\/b>,<span>&nbsp; <\/span>which might make you think that you can both read and write to the properties. This is seen here:<\/p>\n<p class=\"Fig-Graphic\"><img decoding=\"async\" title=\"Image of the properties all being {get ; set}\" alt=\"Image of the properties all being {get ; set}\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/august\/hey0804\/hsg-08-04-09-02.jpg\" width=\"550\" height=\"460\"><\/p>\n<p class=\"MsoNormal\">\n<p>&nbsp;<\/p>\n<\/p>\n<p class=\"MsoNormal\">Because all the properties are specified as <b>{get ; set}<\/b>, it should clue you in that you cannot actually change things such as the <b>NumberOfButtons<\/b> on your mouse by making a change to the property value. So, you might ask, is the <b>Get-Member <\/b>cmdlet &#8220;lying&rdquo; to us? To see if <b>Get-Member<\/b> is lying to us, we perform a small test. First we will query the <b>Win32_PointingDevice<\/b> class and store the results in a variable called <b>$mouse<\/b>. Next we will assign a new value to the property, and then we will query the property. This is seen here: <\/p>\n<p class=\"MsoNormal\"><span>PS C:&gt;<span>&nbsp; <\/span>$mouse.NumberOfButtons<br>12<br>PS C:&gt;<span>&nbsp; <\/span>$mouse = Get-WmiObject -Class win32_pointingdevice<br>PS C:&gt;<span>&nbsp; <\/span>$mouse.NumberOfButtons = 12<br>PS C:&gt;<span>&nbsp; <\/span>$mouse.NumberOfButtons<br>12<\/span><\/p>\n<p class=\"MsoNormal\"><span><br><\/span>The first time I did this, I expected it to throw an error, but it actually works. Of course when I look at my mouse, it did not grow additional buttons or morph into some kind of bizarre transformer creature and spring from my office window to go fight the forces of evil. (<i>Scripting Editor<\/i>: That would have been wicked cool. Please work on making this happen for a future article.) As a matter of fact, it did not even move. So clearly the property is read only. We can verify this by using the WMI Tester (WbemTest.exe). To do this, we type <b>WbemTest<\/b> inside our Windows PowerShell console. The WMI Tester appears. On Windows Vista and later, the default namespace of <b>RootCimv2<\/b> will already be set for you. On earlier versions of <b>WbemTest<\/b> (pronounced &#8220;web um test&#8221;), you will need to type <b>rootcimv2<\/b> in the namespace dialog box and press <b>Connect<\/b>. Use the <b>Open Class<\/b> button (third button down in the first column) to open the <b>Win32_PointingDevice<\/b> WMI class. The Object Editor for <b>Win32_PointingDevice<\/b> appears. In the Properties area (big box in the middle of the Object Editor), scroll down until you see the <b>NumberOfButtons<\/b> property. This is seen in here: <\/p>\n<p><img decoding=\"async\" title=\"Image of the NumberOfButtons property in the Object Editor\" alt=\"Image of the NumberOfButtons property in the Object Editor\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/august\/hey0804\/hsg-08-04-09-03.jpg\" width=\"483\" height=\"444\"><\/p>\n<p class=\"MsoNormal\">After you have found the <b>NumberOfButtons<\/b> property, double-click it to open the Property Editor. In the <b>Qualifiers<\/b> area, you can see that the property has the <b>read<\/b> qualifier, but not the <b>write<\/b> qualifier. This means that the property is read-only. This is seen here: <\/p>\n<p class=\"Fig-Graphic\"><img decoding=\"async\" title=\"Image of Property Editor of NumberOfButtons property\" alt=\"Image of Property Editor of NumberOfButtons property\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/august\/hey0804\/hsg-08-04-09-04.jpg\" width=\"482\" height=\"374\"><a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2009\/august\/hey0804\/hsg-08-04-09-04.jpg\"><\/a><br><\/p>\n<p class=\"MsoNormal\">Additional examples of using the WMI Tester can be seen in <a href=\"http:\/\/blogs.technet.com\/heyscriptingguy\/search.aspx?q=wbemtest&amp;p=1\"><font face=\"Segoe\">earlier Hey, Scripting Guy! blog postings<\/font><\/a>. Whenever I need to see exactly what WMI is doing, I fire up WbemTest. I will not say it is my favorite tool, but it is one of the more powerful tools I have for working with WMI. <\/p>\n<blockquote>\n<p class=\"Readeraidonly\">Oh, by the way, you should be very careful when using WbemTest. There is a very good reason the dialogs seen earlier are called Object Editor and Property Editor. Think of WbemTest as being the Registry Editor for WMI. This tool is read\/write and allows you to actually edit the WMI classes and change their behavior, which could break all kinds of things. Be very careful!<\/p>\n<\/blockquote>\n<p class=\"MsoNormal\">SH, I have not forgotten about your original question. You want to do stuff. So why did I spend all this time talking about properties? Because a number of the properties of a number of WMI classes are actually read\/write, they provide you with the ability to make changes and to do stuff. As an example, you can change the amount of time that the list of operating systems is displayed by modifying the value of the <b>SystemStartUpDelay<\/b> property from the <b>Win32_ComputerSystem<\/b> WMI class. To write the <b>change<\/b> property value back to WMI, you use the <b>put<\/b> method. This is seen here: <\/p>\n<p class=\"CodeBlock\"><font face=\"Lucida Sans Typewriter\"><span>PS C:&gt; $computer = Get-WmiObject -Class win32_computersystem<br>PS C:&gt; $computer.SystemStartupDelay<br>30<br>PS C:&gt; $computer.SystemStartupDelay = 15<br>PS C:&gt; $computer.put()<\/p>\n<p><br>Path<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span>: \\localhostrootcimv2:Win32_ComputerSystem.Name=&#8221;OFFICE&#8221;<br>RelativePath<span>&nbsp; <\/span>: Win32_ComputerSystem.Name=&#8221;OFFICE&#8221;<br>Server<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: localhost<br>NamespacePath : rootcimv2<br>ClassName<span>&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: Win32_ComputerSystem<br>IsClass<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>: False<br>IsInstance<span>&nbsp;&nbsp;&nbsp; <\/span>: True<br>IsSingleton<span>&nbsp;&nbsp; <\/span>: False<br><\/span><span><\/p>\n<p><\/span><\/font><\/p>\n<p class=\"MsoNormal\">Well, SH, we hope you enjoyed this excursion into WMI. Because Windows PowerShell makes it so easy to work with WMI, this actually frees you up to spend more time looking at how you can use this technology. If you are interested in learning more about WMI, check out the Microsoft Press book or some of the other learning resources we have on the <a href=\"http:\/\/technet.microsoft.com\/en-us\/scriptcenter\/dd793612.aspx\"><font face=\"Segoe\">Learn page<\/font><\/a> of the Script Center. If you want to be the first to know what is going on on the Script Center, follow us on <a href=\"https:\/\/twitter.com\/scriptingguys\/\">Twitter<\/a> or on <a href=\"http:\/\/www.facebook.com\/group.php?gid=5901799452\">Facebook<\/a>. If you need assistance with a script, you can post questions to the <a href=\"http:\/\/social.technet.microsoft.com\/Forums\/en\/ITCG\/threads\/\"><font face=\"Segoe\">Official Scripting Guys Forum<\/font><\/a>, or send e-mail to <a href=\"http:\/\/blogs.technet.commailto:scripter@microsoft.com\">scripter@microsoft.com<\/a>. WMI Week will continue tomorrow as we look at calling methods to do things. See you tomorrow. Peace!<\/p>\n<p><b><span>Ed Wilson and Craig Liebendorfer, Scripting Guys<\/span><\/b><span><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\">\n<p>&nbsp;<\/p>\n<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Hey Scripting Guy! I have been playing with WMI on Windows PowerShell, and I think the Get-WmiObject cmdlet is pretty cool. It makes it easy to query for information from computers on my network. But what if I want to actually do something? How do I do that? &#8212; SH Hello SH, Microsoft Scripting [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[3,4,45,6],"class_list":["post-52803","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-scripting-guy","tag-scripting-techniques","tag-windows-powershell","tag-wmi"],"acf":[],"blog_post_summary":"<p>&nbsp; Hey Scripting Guy! I have been playing with WMI on Windows PowerShell, and I think the Get-WmiObject cmdlet is pretty cool. It makes it easy to query for information from computers on my network. But what if I want to actually do something? How do I do that? &#8212; SH Hello SH, Microsoft Scripting [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52803","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=52803"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/52803\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=52803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=52803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=52803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}