<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://powershell.com/cs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results for 'app:weblogs' matching tags 'wmi' and 'Scripting Wife'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=app:weblogs&amp;tag=wmi,Scripting+Wife&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tags 'wmi' and 'Scripting Wife'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Use PowerShell to Troubleshoot and Repair WMI Errors</title><link>http://powershell.com/cs/blogs/hey-scriptingguy/archive/2012/03/29/use-powershell-to-troubleshoot-and-repair-wmi-errors.aspx</link><pubDate>Thu, 29 Mar 2012 05:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:15669</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;: Learn how to use Windows PowerShell to troubleshoot and repair WMI errors.&lt;/p&gt;
&lt;p&gt;Microsoft Scripting Guy, Ed Wilson, is here. Tomorrow is the &lt;a href="http://techstravaganza.wordpress.com/" target="_blank"&gt;New York City TechStravaganza&lt;/a&gt;. The Scripting Wife and I will be there, and we are looking forward to hanging out with Microsoft PowerShell MVPs such as Tome, Brandon, and Aleksandar. Anyway, it was late when we got to the hotel, and I was looking forward to reading a story collection by Raymond Chandler and calling it a day. I had just started on the third story in the collection, when above the constant hum of Times Square, I heard the Scripting Wife.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Why do I always get these errors,&amp;rdquo; she exclaimed with obvious annoyance.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Probably because you are doing something wrong,&amp;rdquo; I said not really helping the situation.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;No. In the event log. Here take a look,&amp;rdquo; she said turning her laptop to me.&lt;/p&gt;
&lt;p&gt;The error to which she referred is shown here.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/0638.HSG_2D00_3_2D00_29_2D00_12_2D00_01.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/0638.HSG_2D00_3_2D00_29_2D00_12_2D00_01.png" alt="Image of error message" title="Image of error message" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;How do you know you are always getting this error,&amp;rdquo; I asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Because I always see it every time I open the Application log on my computer,&amp;rdquo; she replied.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, let&amp;rsquo;s see how many times you really are getting this error,&amp;rdquo; I suggested, &amp;ldquo;Open the Windows PowerShell console, and let&amp;rsquo;s use the &lt;b&gt;Get-WinEvent&lt;/b&gt; cmdlet to retrieve every Event 10 from Windows Management Instrumentation.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;OK. But you are going to have to help me a bit,&amp;rdquo; she said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;But of course. We will use a filter hash table so that we only retrieve the events from Windows Management Instrumentation that are Event 10 in the Application log. The first thing is to type the &lt;b&gt;Get-WinEvent&lt;/b&gt; cmdlet, and call the &lt;i&gt;FilterHashTable &lt;/i&gt;parameter. But do not press ENTER because we will build the command.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The Scripting Wife thought for a bit, and then typed the following (she used tab expansion to complete the &lt;i&gt;FilterHashTable &lt;/i&gt;parameter name).&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WinEvent -FilterHashtable&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now we need to create the hash table for the filter. Remember that a hash table begins with the &amp;lsquo;at&amp;rsquo; sign (&lt;b&gt;@&lt;/b&gt;). Then it is the key equals the value. Each pair gets a semicolon separator,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;OK,&amp;rdquo; she said as she typed the &amp;ldquo;at&amp;rdquo; sign, and opened a pair of curly braces, &amp;ldquo;Now what?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;The first pair is &lt;b&gt;LogName&lt;/b&gt;&lt;i&gt; &lt;/i&gt;equals &lt;b&gt;Application&lt;/b&gt;&lt;i&gt;.&lt;/i&gt; Put the word &amp;lsquo;application&amp;rsquo; in quotation marks,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;The following is what the Scripting wife typed.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;@{logname=&amp;#39;application&amp;#39;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now the next pair is &lt;b&gt;ID&lt;/b&gt;&lt;i&gt; &lt;/i&gt;equals &lt;b&gt;10&lt;/b&gt;. There is no need for quotation marks around the number ten. Remember, that each key value pair receives the semicolon separator.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The Scripting Wife was all business. The she typed the following.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;;id=10;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;The good thing is that the &lt;i&gt;ProviderName &lt;/i&gt;will accept a wild card. So all you need to do is use the asterisk with the letters wmi. Make sure you also put them in quotation marks and close the curly bracket,&amp;rdquo; I said. &lt;br /&gt; Here is what she typed.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;providername=&amp;#39;*wmi*&amp;#39;}&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Great. You are almost done. Pipe the whole thing to the &lt;b&gt;Measure-Object&lt;/b&gt; cmdlet. You can use the alias &lt;b&gt;measure&lt;/b&gt; for that cmdlet,&amp;rdquo; I instructed.&lt;/p&gt;
&lt;p&gt;The following is the Scripting Wife&amp;rsquo;s completed command.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WinEvent -FilterHashtable @{logname=&amp;#39;application&amp;#39;;id=10;providername=&amp;#39;*wmi*&amp;#39;}&amp;nbsp; | measure&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Cool, it works,&amp;rdquo; the Scripting Wife exclaimed, &amp;ldquo;Here take a look.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;As she turned her laptop monitor so I could see the following output in her Windows PowerShell console.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/3324.HSG_2D00_3_2D00_29_2D00_12_2D00_02.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/3324.HSG_2D00_3_2D00_29_2D00_12_2D00_02.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;How would I know how to do this if you were not around?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You could use the &lt;b&gt;Get-EventLog&lt;/b&gt; cmdlet to do this, but you would need to pipe the results to the &lt;b&gt;Where-Object&lt;/b&gt; cmdlet to help with the filtering. This command is more efficient. Besides, I wrote a great Hey, Scripting Guy! blog last year about using the &lt;i&gt;FilterHashTable &lt;/i&gt;parameter. It is titled &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/03/08/how-to-improve-the-performance-of-a-powershell-event-log-query.aspx" target="_blank"&gt;How to Improve the Performance of a PowerShell Event Log Query&lt;/a&gt;,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;So what does all this mean anyway?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;What does what mean?&amp;rdquo; I asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;What is Event 10 from Windows Management Instrumentation, and why is it littering my Application log with meaningless events?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Actually it is not meaningless. It means that some permanent event does not have permission to run. That is what the error code 0x80041003 means. Why it does not have permission is another issue. Let me check with Bing to find out,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;Within less than a minute, I had retrieved &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-US;2545227" target="_blank"&gt;a support article describing the situation&lt;/a&gt;. Interestingly enough, this issue also has a Microsoft Fix It solution attached to it. &amp;ldquo;Cool.&amp;rdquo; I thought. Then I thought this would be a great opportunity to talk to the Scripting Wife about permanent event consumers.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Do you remember when Trevor wrote &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2010/12/08/use-a-powershell-module-to-work-with-wmi-permanent-events.aspx" target="_blank"&gt;Use a PowerShell Module to Work with WMI Permanent Events&lt;/a&gt;?&amp;rdquo; I asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Sure. I thought it was great,&amp;rdquo; she replied.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, before that blog, I talked about working with permanent events and I discussed the technology that was behind them in &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2010/12/07/use-powershell-to-monitor-and-respond-to-events-on-your-server.aspx" target="_blank"&gt;Use PowerShell to Monitor and Respond to Events on Your Server&lt;/a&gt;,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Uh. Sure, if you say so. I don&amp;rsquo;t remember that far back,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;I started to say something like she remembered Trevor&amp;rsquo;s module, but then I decided to keep my mouth shut for a change. Then I changed my mind.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, this is your lucky day. Because we are going to do a refresher course,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Oh, come on. It is late, and tomorrow is the TechStravaganza,&amp;rdquo; she whined.&lt;/p&gt;
&lt;p&gt;The first thing I did was create a simple script that I called Get-BVTFilterandConsumer.ps1. This script is shown here. (Note: The second line uses the back tick character for line continuation. &lt;b&gt;GWMI&lt;/b&gt; is an alias for the &lt;b&gt;Get-WmiObject&lt;/b&gt; cmdlet. Remember, this is a quick script, and it is late at night.)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;b&gt;Get-BVTFilterandConsumer.ps1&lt;/b&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;gwmi __EventFilter -Namespace root\subscription -Filter &amp;quot;name = &amp;#39;bvtfilter&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;gwmi __FilterToConsumerBinding -Namespace root\subscription `&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;-filter &amp;quot;filter = &amp;#39;__EventFilter.Name=&amp;quot;&amp;quot;bvtFilter&amp;quot;&amp;quot;&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now I want you to run the script. It will retrieve instances of the __EventFilter Windows Management Instrumentation class that are named &lt;b&gt;bvtFilter&lt;/b&gt;. It will also retrieve instances of the __FilterToConsumerBinding Windows Management Instrumentation class&amp;mdash;but only instances that are associated with the filter named &lt;b&gt;bvtFilter&lt;/b&gt;. It sounds complicated, but really it is not,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;If you say so. But sometimes I wonder if your idea of complicated and my idea of complicated are the same thing,&amp;rdquo; she said as she ran the script. The output from the script is shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5381.HSG_2D00_3_2D00_29_2D00_12_2D00_03.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5381.HSG_2D00_3_2D00_29_2D00_12_2D00_03.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now what we need to do is to delete both the &lt;b&gt;bvtFilter&lt;/b&gt; and the filter to consumer binding. This part is really easy because all we need to do is to pipe the objects from the previous script to &lt;b&gt;Remove-WmiObject&lt;/b&gt;,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;That is the first thing you have said that makes sense,&amp;rdquo; she said, &amp;ldquo;Shouldn&amp;rsquo;t we back up the computer first?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;We do not need to back up the entire computer, but it does not hurt to back up system state. To do this, use the &lt;b&gt;CheckPoint-Computer&lt;/b&gt; cmdlet,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;The Scripting Wife copied the code from the Get-BVTFilterandConsumer.ps1 script, and at the end of each line she added a pipe character, and sent the objects to the &lt;b&gt;Remove-WMIObject&lt;/b&gt; cmdlet. Then she backed up and went to the top of the script and added the &lt;b&gt;Checkpoint-Computer&lt;/b&gt; command. The resulting script, which she named BackupComputerAndRemoveBVTFilter.ps1, is shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;b&gt;BackupComputerAndRemoveBVTFilter.ps1&lt;/b&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Checkpoint-Computer -Description &amp;quot;prior to fixing event 10 from wmi&amp;quot; `&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;-RestorePointType MODIFY_SETTINGS&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;gwmi __EventFilter -Namespace root\subscription -Filter &amp;quot;name = &amp;#39;bvtfilter&amp;#39;&amp;quot; |&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Remove-WmiObject&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;gwmi __FilterToConsumerBinding -Namespace root\subscription `&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;-filter &amp;quot;filter = &amp;#39;__EventFilter.Name=&amp;quot;&amp;quot;bvtFilter&amp;quot;&amp;quot;&amp;#39;&amp;quot; |&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Remove-WmiObject&lt;/p&gt;
&lt;p&gt;&amp;nbsp;When the Scripting Wife pressed the green triangle to run the script, the dialog box shown here appeared.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/7725.HSG_2D00_3_2D00_29_2D00_12_2D00_04.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/7725.HSG_2D00_3_2D00_29_2D00_12_2D00_04.png" alt="Image of dialog box" title="Image of dialog box" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Other than the dialog box, there was no output from the script.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;So how do I know that it worked?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;For one thing, you can run my Get-BVTFilterandConsumer.ps1 script. But with no instances, it will not display any output either. Another thing you can do is to open WbemTest, change your namespace to root\subscription and open the __FilterToConsumerBinding Windows Management Instrumentation class,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;The Scripting Wife typed wbemtest into the Windows PowerShell console, and when the Windows Management Instrumentation Tester opened, she set the namespace to root\subscription and opened the __FilterToConsumerBinding Windows Management Instrumentation class. She then pressed the &lt;b&gt;Instances&lt;/b&gt; button and the following dialog box appeared.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5732.HSG_2D00_3_2D00_29_2D00_12_2D00_05.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5732.HSG_2D00_3_2D00_29_2D00_12_2D00_05.png" alt="Image of dialog box" title="Image of dialog box" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You might also want to look for instances of the __EventFilter Windows Management Instrumentation class,&amp;rdquo; I suggested.&lt;/p&gt;
&lt;p&gt;The Scripting Wife closed the previous dialog box, and opened the __EventFilter class. Next she looked for instances. The results are shown here.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5008.HSG_2D00_3_2D00_29_2D00_12_2D00_06.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5008.HSG_2D00_3_2D00_29_2D00_12_2D00_06.png" alt="Image of dialog box" title="Image of dialog box" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;OK. That&amp;rsquo;s enough. You are making my head hurt, and I need to catch up with people on Facebook,&amp;rdquo; the Scripting Wife said.&lt;/p&gt;
&lt;p&gt;And with that, I was effectively dismissed. 2012 Scripting Games Prep Week will continue tomorrow when we will have a guest blog post from Boe Prox.&lt;/p&gt;
&lt;p&gt;I invite you to follow me on &lt;a href="http://bit.ly/scriptingguystwitter" target="_blank"&gt;Twitter&lt;/a&gt; and &lt;a href="http://bit.ly/scriptingguysfacebook" target="_blank"&gt;Facebook&lt;/a&gt;. If you have any questions, send email to me at &lt;a href="mailto:scripter@microsoft.com" target="_blank"&gt;scripter@microsoft.com&lt;/a&gt;, or post your questions on the &lt;a href="http://bit.ly/scriptingforum" target="_blank"&gt;Official Scripting Guys Forum&lt;/a&gt;. See you tomorrow. Until then, peace.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Ed Wilson, Microsoft Scripting Guy&lt;/b&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3489015" width="1" height="1" alt="" /&gt;</description></item><item><title>The Scripting Wife Uses PowerShell to Find Service Accounts</title><link>http://powershell.com/cs/blogs/hey-scriptingguy/archive/2012/02/15/the-scripting-wife-uses-powershell-to-find-service-accounts.aspx</link><pubDate>Wed, 15 Feb 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14664</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;: The Scripting Wife interrupts Brahms to learn how to use Windows PowerShell to find service accounts and service start modes.&lt;/p&gt;
&lt;p&gt;Microsoft Scripting Guy, Ed Wilson, is here. One of life&amp;rsquo;s real pleasures is sitting around a fireplace, listening to a &lt;a href="http://en.wikipedia.org/wiki/Double_Concerto_(Brahms)" target="_blank"&gt;Brahms concerto&lt;/a&gt;, and sipping a cup of &lt;a href="http://en.wikipedia.org/wiki/Chamomile" target="_blank"&gt;chamomile tea&lt;/a&gt;. I like to add a bit of local honey, and drop in a cinnamon stick. So here I am&amp;hellip;mellow and as relaxed as a cat lying in a bay window on a warm summer afternoon. The &lt;a href="http://charlotte-sql.org/" target="_blank"&gt;Charlotte SQL User Group&lt;/a&gt; meeting tonight was awesome. We had not seen Chris Skorlinski (the speaker) since the &lt;a href="http://www.sqlsaturday.com/46/eventhome.aspx" target="_blank"&gt;Raleigh SQL Saturday&lt;/a&gt;, so we were excited to go. The Scripting Wife and I had a great time, and it was a nice chance to see some friends we had not seen for a while.&lt;/p&gt;
&lt;p&gt;Anyway, work finished, now it is time for a warm fire, a little Brahms, and a cup of warm (but not boiling) tea. About to nod off, I was suddenly startled back into reality as the overhead light suddenly switched on.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;How can you see in here in the dark,&amp;rdquo; the Scripting Wife exclaimed.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;There was nothing to see&amp;mdash;I was listening to Brahms,&amp;rdquo; I began.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You need to turn that racket down. The neighbor&amp;rsquo;s dog is beginning to howl. I think he prefers Trace Adkins to that classical stuff anyway,&amp;rdquo; she continued, &amp;ldquo;As long as you are awake, I have a problem with a Windows PowerShell command.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I see. I think it is you who likes Trace Adkins.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Yep, but don&amp;rsquo;t sidetrack me with talk about Trace Adkins, I need to be prepared for the 2012 Scripting Games so I do not embarrass you or me. Now back to what I came to ask you. I am trying to figure out what account a service uses to start, and I don&amp;rsquo;t see it. &amp;ldquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;And&amp;hellip;&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;And nothing. I type &lt;b&gt;Get-Service&lt;/b&gt;, and I do not see anything about service user accounts.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Show me your command,&amp;rdquo; I wearily asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;It is right here. Nothing hard&amp;hellip;see?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;She plopped down beside me on the sofa and showed me her laptop. She had typed the single command shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-Service&lt;/p&gt;
&lt;p&gt;The command and the output from the command are shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6266.hsg_2D00_2_2D00_15_2D00_12_2D00_01.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6266.hsg_2D00_2_2D00_15_2D00_12_2D00_01.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You know that there is more information don&amp;rsquo;t you?&amp;rdquo; I asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, duh,&amp;rdquo; she said. &amp;ldquo;OK, I will clear the screen and send the output to the &lt;b&gt;Format-List&lt;/b&gt; cmdlet.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Here is what the Scripting Wife did to clear the screen and to obtain all the information available from the &lt;b&gt;Get-Service&lt;/b&gt; cmdlet.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;She cleared the screen by using the &lt;b&gt;Clear-Host&lt;/b&gt; command. But instead of typing &lt;b&gt;Clear-Host&lt;/b&gt;, she used the &lt;b&gt;cls&lt;/b&gt;&lt;i&gt; &lt;/i&gt;shortcut command instead.&lt;/li&gt;
&lt;li&gt;Next, she pressed the Up arrow one time to retrieve the previous &lt;b&gt;Get-Service&lt;/b&gt; command.&lt;/li&gt;
&lt;li&gt;She then typed a space &amp;lt;space&amp;gt; by tapping the Space bar one time, and then she typed a pipe character (the pipe character | is located above the Enter key on my keyboard).&lt;/li&gt;
&lt;li&gt;She then typed a space and &lt;b&gt;Format-List&lt;/b&gt; * after the pipe character.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The complete command is shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-Service | Format-List *&lt;/p&gt;
&lt;p&gt;The command and the associated output from the command are shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/2146.hsg_2D00_2_2D00_15_2D00_12_2D00_02.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/2146.hsg_2D00_2_2D00_15_2D00_12_2D00_02.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;OK. I am looking at this output, and I still do not see anything about the service account that a service uses to start up,&amp;rdquo; she complained.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, I did not say it was there, did I? I just asked you if you had looked at all of the information that the &lt;b&gt;Get-Service&lt;/b&gt; cmdlet provides,&amp;rdquo; I stated. &amp;ldquo;To find the service account start-up information, you need to use WMI. Remember yesterday when we talked about &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/14/the-scripting-wife-uses-powershell-to-get-hardware-information.aspx" target="_blank"&gt;Using PowerShell to Get Hardware Information&lt;/a&gt;? You can use the same technique today as you used yesterday.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;The Scripting Wife thought for a few seconds, and then she typed the following command.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WmiObject &amp;ndash;list *service*&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Wow, that is a lot of information,&amp;rdquo; she exclaimed. She turned the laptop monitor so I could look at the display. Indeed, as is shown here, it is a lot of information.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/1524.hsg_2D00_2_2D00_15_2D00_12_2D00_03.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/1524.hsg_2D00_2_2D00_15_2D00_12_2D00_03.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Use the same technique that you used yesterday to find the WMI class you need to work with services,&amp;rdquo; I prompted.&lt;/p&gt;
&lt;p&gt;Within a few minutes, the Scripting Wife was pointing at &lt;b&gt;Win32_Service&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now use the &lt;b&gt;Get-WmiObject&lt;/b&gt; cmdlet to query that WMI class,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;It did not take her long to modify her command line to query the &lt;b&gt;Win32_Service WMI&lt;/b&gt; class. Here is the command she composed.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WmiObject Win32_Service&lt;/p&gt;
&lt;p&gt;The command and the associated results are shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6011.hsg_2D00_2_2D00_15_2D00_12_2D00_04.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6011.hsg_2D00_2_2D00_15_2D00_12_2D00_04.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;OK, so where are the service accounts?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Remember, you need to use the same technique that you used with the &lt;b&gt;Get-Service&lt;/b&gt; cmdlet to retrieve all the information,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;She thought for a bit, then pressed the Up arrow to retrieve the previous command. Then she added a pipeline character and the &lt;b&gt;Format-List&lt;/b&gt; cmdlet. The revised command is shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WmiObject win32_service | format-list *&lt;/p&gt;
&lt;p&gt;The command and its associated output are shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6683.hsg_2D00_2_2D00_15_2D00_12_2D00_05.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6683.hsg_2D00_2_2D00_15_2D00_12_2D00_05.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;So where is the service account name?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Look closely at the output. See where it says &lt;i&gt;StartName&lt;/i&gt;? That is the service account. See where it says &lt;i&gt;StartMode&lt;/i&gt;? That is the way the service starts,&amp;rdquo; I said, &amp;ldquo;Why don&amp;rsquo;t you create a table with just the &lt;i&gt;Name&lt;/i&gt;, &lt;i&gt;StartName&lt;/i&gt;, and &lt;i&gt;StartMode&lt;/i&gt;.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;This time the Scripting Wife did not hesitate. She first cleared the screen, then used the Up arrow to retrieve the previous command. She then edited it by changing it to a &lt;b&gt;Format-Table&lt;/b&gt; command. The command that she arrived at is shown here with its associated output.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/4666.hsg_2D00_2_2D00_15_2D00_12_2D00_06.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/4666.hsg_2D00_2_2D00_15_2D00_12_2D00_06.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;That&amp;rsquo;s cool,&amp;rdquo; she said.&lt;/p&gt;
&lt;p&gt;And with that, she was gone. Just in time for the &lt;i&gt;Andante &lt;/i&gt;movement in D-major. Brahms may not have had Windows PowerShell in mind when he wrote, but somehow it seems to fit.&lt;/p&gt;
&lt;p&gt;I invite you to follow me on &lt;a href="http://bit.ly/scriptingguystwitter" target="_blank"&gt;Twitter&lt;/a&gt; and &lt;a href="http://bit.ly/scriptingguysfacebook" target="_blank"&gt;Facebook&lt;/a&gt;. If you have any questions, send email to me at &lt;a href="mailto:scripter@microsoft.com" target="_blank"&gt;scripter@microsoft.com&lt;/a&gt;, or post your questions on the &lt;a href="http://bit.ly/scriptingforum" target="_blank"&gt;Official Scripting Guys Forum&lt;/a&gt;. See you tomorrow. Until then, peace.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Ed Wilson, Microsoft Scripting Guy&lt;/b&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3480247" width="1" height="1" alt="" /&gt;</description></item><item><title>The Scripting Wife Uses PowerShell to Get Hardware Information</title><link>http://powershell.com/cs/blogs/hey-scriptingguy/archive/2012/02/14/the-scripting-wife-uses-powershell-to-get-hardware-information.aspx</link><pubDate>Tue, 14 Feb 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14637</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;: The Scripting Wife needs to get ready for the 2012 Scripting Games, and she uses Windows PowerShell to get hardware info from her laptop.&lt;/p&gt;
&lt;p&gt;Microsoft Scripting Guy, Ed Wilson, is here. The Scripting Wife and I were in &lt;a href="http://en.wikipedia.org/wiki/Myrtle_Beach_(SC)" target="_blank"&gt;Myrtle Beach&lt;/a&gt;, where I was working on the Scripting Games over the weekend. The trip to the &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/03/20/scripting-wife-uses-regular-expressions-to-match-a-string.aspx" target="_blank"&gt;Carolina Beaches&lt;/a&gt; is rapidly becoming an annual migration of the rare but not endangered &lt;i&gt;Script Monkey.&lt;/i&gt; Anyway, I was on the lanai reading my email this morning, when I heard her&amp;mdash;or more accurately&amp;mdash;I felt her enter the room.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;So where are you taking me for &lt;a href="http://www.bing.com/news/search?q=what+is+valentine&amp;#39;s+day&amp;amp;qpvt=what+is+valentine%27s+day&amp;amp;FORM=EWRE" target="_blank"&gt;Valentine&amp;rsquo;s Day&lt;/a&gt;?&amp;rdquo; she queried.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I am taking you to the &lt;a href="http://www.carolinait.org/" target="_blank"&gt;Charlotte IT Pro User Group&lt;/a&gt; meeting,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You&amp;rsquo;re kidding. Right?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Nope, that is why I took you to Ruth&amp;rsquo;s Chris Steak House on Friday night. You knew that.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You took me to Ruth&amp;rsquo;s Chris because you had a gift card,&amp;rdquo; she countered.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You knew it was your Valentine&amp;rsquo;s Day dinner. We had a lovely time. Now what&amp;rsquo;s the problem?&amp;rdquo; I asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;No problem. I was just trying to see if you were awake. Good morning, my little Script Monkey.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;By the way, what are you doing up so early? It is not yet noon,&amp;rdquo; I queried.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Ha ha. So funny,&amp;rdquo; she intoned. &amp;ldquo;Just so you will know, I have been up for hours. I am working on the &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/05/2012-scripting-games-study-guide-a-resource-for-learning-powershell.aspx" target="_blank"&gt;2012 Scripting Games Study Guide&lt;/a&gt;.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Uh huh. I see. Well, that is great. Good luck. Let me know how it is working for you,&amp;rdquo; I replied pleasantly enough.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, my little Script Monkey, I do have a question.&amp;rdquo; She was dripping with sincerity.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Yes,&amp;rdquo; I replied with more than a modicum of hesitancy. (I was never going to get through the 2,000 emails in my inbox at this rate.)&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I am a little rusty with Windows PowerShell. In fact, I have pretty much not touched it since last year,&amp;rdquo; she confessed.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Huh? But all that time you spend at your computer. I thought you were at least writing a script.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Facebook. Twitter. &lt;a href="http://powerscripting.wordpress.com/" target="_blank"&gt;PowerScripting PodCast&lt;/a&gt;. &lt;a href="http://scriptingwife.wordpress.com/" target="_blank"&gt;My blog&lt;/a&gt;. I get busy. Besides, if I really need a script, I figure you will write it.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;You might just figure wrong too,&amp;rdquo; I said smiling. &amp;ldquo;So what is your problem?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, I forget how to find stuff out about hardware. I figure that will be the first event, because your Study Guide lists it first.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I smiled, but did not commit myself. Paused for a second. Then replied, &amp;ldquo;OK, sit down.&amp;rdquo; She took a seat on the lanai swing.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now, to find out stuff about the hardware in Windows PowerShell&amp;nbsp;2.0, it is normally going to require using WMI,&amp;rdquo; I continued.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I would use the &lt;b&gt;Get-WMIObject&lt;/b&gt; cmdlet to find that out?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Absolutely. Now, write a command that will get information from the BIOS,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, how do I know that? That is why I am here, silly,&amp;rdquo; she chastised.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;OK. One of the nice things about the &lt;b&gt;Get-WmiObject&lt;/b&gt; cmdlet is that it can tell you what class you need. To do this, use the &lt;i&gt;List &lt;/i&gt;parameter, and then use wild cards around the word BIOS.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I slid the laptop over to her. She thought for a minute, and hesitantly typed the following:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-w&amp;lt;tab&amp;gt;&amp;lt;tab&amp;gt;&amp;lt;space&amp;gt;-l&amp;lt;tab&amp;gt;&amp;lt;space&amp;gt;*bios*&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(In the commands that follow, &amp;lt;tab&amp;gt; represents one press of the Tab key. One press of the Space bar&amp;nbsp; is &amp;lt;space&amp;gt;. If you see two tab characters, such as &amp;lt;tab&amp;gt;&amp;lt;tab&amp;gt;, it means press the Tab key twice. For most computers, this will probably work, but depending on what modules and other items are loaded in your environment, you may need to press the Tab key more than the indicated number of times. Always compare your completed command with the commands that are indicated as complete.&lt;/p&gt;
&lt;p&gt;When the Scripting Wife finished typing, she turned the laptop back to me and smiled. &amp;ldquo;Is this the right command?&amp;rdquo; she asked.&lt;/p&gt;
&lt;p&gt;I looked at it. The command she had composed is shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WmiObject -List *bios*&lt;/p&gt;
&lt;p&gt;&amp;ldquo;That is exactly right. Now, which WMI class do you think actually reports only information about the BIOS on your computer?&amp;rdquo; I asked.&lt;/p&gt;
&lt;p&gt;She looked at the output, which is shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/8372.hsg_2D00_2_2D00_14_2D00_12_2D00_01.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/8372.hsg_2D00_2_2D00_14_2D00_12_2D00_01.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I think the Win32_BIOS is the right WMI class&amp;hellip;because it sounds right, and the properties sound like BIOS things,&amp;rdquo; she postulated.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;And&amp;hellip;&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;And it begins with a Win32 which sounds like Windows. You told me to always use WMI classes that start with Win32,&amp;rdquo; she said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Very good. Now, go ahead and query that class,&amp;rdquo; I said.&lt;/p&gt;
&lt;p&gt;She started to ask how, then bent over the laptop and began to type. She did the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;She hit the Up arrow once and retrieved the previous command.&lt;/li&gt;
&lt;li&gt;She hit the backspace 12 times and erased everything but the &lt;b&gt;Get-WmiObject&lt;/b&gt; command.&lt;/li&gt;
&lt;li&gt;She highlighted the &lt;b&gt;Win32_Bios&lt;/b&gt; class name with her mouse from the list in her output window, and then pressed ENTER.&lt;/li&gt;
&lt;li&gt;She right-clicked just after the &lt;b&gt;Get-WMIObject&lt;/b&gt; command.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The command she created is shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WmiObject Win32_BIOS&lt;/p&gt;
&lt;p&gt;Following are the command and its associated output.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6765.hsg_2D00_2_2D00_14_2D00_12_2D00_02.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/6765.hsg_2D00_2_2D00_14_2D00_12_2D00_02.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;It seems that my screen is getting cluttered up,&amp;rdquo; she complained.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Type the command &lt;b&gt;cls&lt;/b&gt;&amp;hellip;that is a shortcut for the &lt;b&gt;Clear-Host&lt;/b&gt; function,&amp;rdquo; I instructed.&lt;/p&gt;
&lt;p&gt;The scripting wife typed the following:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Cls&amp;lt;enter&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now, just for fun, use the &lt;b&gt;Get-History &lt;/b&gt;cmdlet to see what commands you have typed,&amp;rdquo; I instructed.&lt;/p&gt;
&lt;p&gt;She typed &lt;b&gt;h&lt;/b&gt;&lt;i&gt; &lt;/i&gt;(a shortcut for the &lt;b&gt;Get-History &lt;/b&gt;cmdlet name). Here is her command.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;h&amp;lt;enter&amp;gt;&lt;/p&gt;
&lt;p&gt;The output is shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/0676.hsg_2D00_2_2D00_14_2D00_12_2D00_03.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/0676.hsg_2D00_2_2D00_14_2D00_12_2D00_03.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Press the Up arrow four times, erase the word bios*, and replace it with *processor*,&amp;rdquo; I suggested.&lt;/p&gt;
&lt;p&gt;The Scripting Wife typed the following commands.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;lt;up arrow&amp;gt;&amp;lt;up arrow&amp;gt;&amp;lt;up arrow&amp;gt;&amp;lt;up arrow&amp;gt;&amp;lt;backspace&amp;gt;&amp;lt;backspace&amp;gt;&amp;lt;backspace&amp;gt;&amp;lt;backspace&amp;gt;&amp;lt;backspace&amp;gt;*processor*&amp;lt;enter&amp;gt;&lt;/p&gt;
&lt;p&gt;The command she created is shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Get-WmiObject -List *processor*&lt;/p&gt;
&lt;p&gt;The command and its associated output are shown in the image that follows.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/2161.hsg_2D00_2_2D00_14_2D00_12_2D00_04.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/2161.hsg_2D00_2_2D00_14_2D00_12_2D00_04.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Now, can you pick out the WMI class that will tell you about the processor on your computer?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;The &lt;b&gt;Win32_Processor&lt;/b&gt; class will do that because it begins with Win32, and it has properties like &lt;b&gt;AddressWidth&lt;/b&gt;&lt;i&gt;, &lt;/i&gt;&lt;b&gt;Architecture&lt;/b&gt;&lt;i&gt;, &lt;/i&gt;and &lt;b&gt;Availability&lt;/b&gt;&lt;i&gt;,&lt;/i&gt;&amp;rdquo; she said.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Absolutely right. Now go ahead and clear your screen, and then query the class.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;She did not even hesitate. Not for a second. She immediately did the following.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Highlighted &lt;b&gt;Win32_Processor&lt;/b&gt; with her left mouse button, and pressed ENTER.&lt;/li&gt;
&lt;li&gt;Typed Cls&amp;lt;enter&amp;gt;.&lt;/li&gt;
&lt;li&gt;Used the Up arrow twice to retrieve the previous &lt;b&gt;Get-WmiObject&lt;/b&gt; &lt;b&gt;&amp;ndash;list *Processor*&lt;/b&gt; command.&lt;/li&gt;
&lt;li&gt;Used the backspace to erase everything but the &lt;b&gt;Get-WMiObject&lt;/b&gt; command, and right-clicked the screen to paste &lt;b&gt;Win32_Process&lt;/b&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The command she that created is shown here.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;get-wmiobject Win32_Processor&lt;/p&gt;
&lt;p&gt;The output from the command is shown here.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5710.hsg_2D00_2_2D00_14_2D00_12_2D00_05.png"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/5710.hsg_2D00_2_2D00_14_2D00_12_2D00_05.png" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The Scripting Wife handed the laptop back to me. She smiled and jumped off the swing.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, I guess I will see ya,&amp;rdquo; she said cheerily.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Huh,&amp;rdquo; I asked.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Yep. If we have to go to the Charlotte IT Pro User Group for Valentine&amp;rsquo;s Day, then it is going to take me all day to get ready,&amp;rdquo; she explained.&lt;/p&gt;
&lt;p&gt;&amp;ldquo;I see. And why is that?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;Well, I have to get my hair done. Then I have to go to the spa and get a manicure and a pedicure. I think I will invite my friends out for lunch, and then we will go shopping so I can get a new outfit to wear to the meeting. Really. Don&amp;rsquo;t you know anything?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;With that, she bounded out the front door of the lanai, and was gone. Really, sometimes I wonder if I do know anything about the Scripting Wife.&lt;/p&gt;
&lt;p&gt;I invite you to follow me on &lt;a href="http://bit.ly/scriptingguystwitter" target="_blank"&gt;Twitter&lt;/a&gt; and &lt;a href="http://bit.ly/scriptingguysfacebook" target="_blank"&gt;Facebook&lt;/a&gt;. If you have any questions, send email to me at &lt;a href="mailto:scripter@microsoft.com" target="_blank"&gt;scripter@microsoft.com&lt;/a&gt;, or post your questions on the &lt;a href="http://bit.ly/scriptingforum" target="_blank"&gt;Official Scripting Guys Forum&lt;/a&gt;. See you tomorrow. Until then, peace.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Ed Wilson, Microsoft Scripting Guy&lt;/b&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3480231" width="1" height="1" alt="" /&gt;</description></item></channel></rss>