<?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 tag 'Tim Bolton'</title><link>http://powershell.com/cs/search/SearchResults.aspx?q=app:weblogs&amp;tag=Tim+Bolton&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tag 'Tim Bolton'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 (Build: 30929.2835)</generator><item><title>Weekend Scripter: Finding In-Use Phone Extensions</title><link>http://powershell.com/cs/blogs/hey-scriptingguy/archive/2012/12/29/weekend-scripter-finding-in-use-phone-extensions.aspx</link><pubDate>Sat, 29 Dec 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:20783</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt; Guest blogger Tim Bolton talks about using Windows PowerShell to determine what phone extensions are currently in use.&lt;/p&gt;
&lt;p&gt;Microsoft Scripting Guy, Ed Wilson, is here. It is amazing the number of manual tasks that can be safely eliminated by using a little bit of Windows PowerShell. In fact, it is also amazing, in general, how little time it actually takes to create something useful in Windows PowerShell. The funny thing is that even people who &amp;ldquo;know PowerShell&amp;rdquo; still fall into the trap of doing something manually&amp;mdash;at least I know that I do!&lt;/p&gt;
&lt;p&gt;Yes, I admit it &amp;hellip; there are still times when I do things manually. Why? Well, I will admit that at times I am lazy. I have been using a mouse a lot longer than I have been using Windows PowerShell. Still, I will say that with Windows&amp;nbsp;8 and Windows PowerShell&amp;nbsp;3.0, those manual excursions are becoming less and less frequent. This is because we have so much more built-in cmdlet (and function) coverage that often it really is easier to use Windows PowerShell than to use the mouse. All of our new products incorporate Windows PowerShell to facilitate management. This is great news for people who just want &amp;ldquo;to get the job done.&amp;rdquo; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Learn Windows PowerShell&amp;mdash;it will save you time and effort.&lt;/p&gt;
&lt;p&gt;Today, we have another guest blog post written by Tim Bolton. Tim is learning Windows PowerShell. His article is immediately useful, but it&amp;rsquo;s also an encouragement to others who want to learn this useful technology.&lt;/p&gt;
&lt;p&gt;For more about Tim, see his extremely popular &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2012/01/28/why-should-i-learn-powershell-real-world-example-saves-the-day.aspx" target="_blank"&gt;Why Should I Learn Powershell? Real World Example Saves the Day!&lt;/a&gt; guest Hey, Scripting Guy! Blog post.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s Tim ...&lt;/p&gt;
&lt;h2&gt;Finding In-Use Phone Extensions&lt;/h2&gt;
&lt;p&gt;After doing this manually by checking an Excel spreadsheet and dialing each number manually, I was once again reminded of the following rule of POSH: If you have to do something more than twice, script it.&lt;/p&gt;
&lt;p&gt;In my current position, one of the common daily tasks is to assign telephone numbers to new users and also reassign numbers depending on where they are working within the company. Once again, with the help and inspiration of my coworkers Brian Peacock and Arturo (Art) Carrera, this script came to life.&lt;/p&gt;
&lt;p&gt;Initially the script looked something like this. This was not pretty to look at and my coffee would get cold waiting for it to finish.&amp;nbsp; #FAIL&amp;nbsp; &amp;ndash;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Function Get-Extension {&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param(&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Extension = (Read-Host &amp;quot;What is the Extension you want to check? &amp;quot;)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CSUser=Get-csuser | where {$_.LineURI -like &amp;ldquo;*$Extension&amp;quot;}&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $GetUser=Get-user | where {$_.Phone -like &amp;ldquo;*$Extension&amp;rdquo;&amp;quot;}&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $GetUM=Get-UMMailbox -resultsize unlimited | where {$_.PhoneNumber -like &amp;quot;*$Extension&amp;quot;}&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj = New-Object -TypeName PSObject&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;CS Display Name&amp;quot; -Value ($CSUser.DisplayName)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;Line URI&amp;quot; -Value ($CSUser.LineURI)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;AD Phone&amp;quot; -Value($GetUser.Phone)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;Exchange SIP&amp;quot; -Value ($GetUM.SIPResourceIdentifier)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;Exchange Extension&amp;quot; -Value ($GetUM.Extensions)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Output $obj&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;
&lt;p&gt;After I found the few &lt;strong&gt;-Filters&lt;/strong&gt; I could actually use, we got it down to about 2 to 3 minutes. Not too bad but GEEZ! This &amp;ldquo;is&amp;rdquo; Windows PowerShell, right? So, this is the second generation, but once again, it felt like well &amp;hellip; #FAIL&amp;nbsp; &amp;ndash;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Function Get-Extension {&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param(&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Extension = (Read-Host &amp;quot;What is the Extension you want to check? &amp;quot;)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $CSUser=Get-csuser -Filter &amp;quot;LineURI -like &amp;#39;*$Extension&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $GetUser=Get-user -Filter &amp;quot;Phone -like &amp;#39;*$Extension&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $GetUM=Get-UMMailbox -resultsize unlimited | where {$_.PhoneNumber -like &amp;quot;*$Extension&amp;quot;}&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj = New-Object -TypeName PSObject&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;CS Display Name&amp;quot; -Value ($CSUser.DisplayName)&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;Line URI&amp;quot; -Value ($CSUser.LineURI)&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;AD Phone&amp;quot; -Value($GetUser.Phone)&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;Exchange SIP&amp;quot; -Value ($GetUM.SIPResourceIdentifier)&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $obj | Add-Member -MemberType NoteProperty -Name &amp;quot;Exchange Extension&amp;quot; -Value ($GetUM.Extensions)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Write-Output $obj&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;
&lt;p&gt;Then, my coworker Brian mentioned saving it as a string and making it a bit faster instead of waiting for the screen to prompt me for the extension.&lt;/p&gt;
&lt;p&gt;This also made it possible (to my surprise) to use &amp;nbsp;&lt;strong&gt;&amp;ndash;Filter&lt;/strong&gt; with &lt;strong&gt;Get-UMMailbox&lt;/strong&gt;, which made it much faster&amp;mdash;down to 15 seconds!&amp;nbsp; #WINNER!&amp;nbsp; -&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Function Get-Extension {&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; param(&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [parameter(Mandatory = $true)]&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [String] $Extension)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$CSUser=Get-csuser -Filter &amp;quot;LineURI -like &amp;#39;*$Extension&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$GetUser=Get-User -Filter &amp;quot;Phone -like &amp;#39;*$Extension&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$GetOther=Get-User -Filter &amp;quot;OtherFax -Like &amp;#39;*$Extension*&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$GetUM=Get-UMMailbox -Filter &amp;quot;EmailAddresses -Like &amp;#39;*$Extension*&amp;#39;&amp;quot; # Exchange&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$NotFound = &amp;quot;Extension Not Found&amp;quot;&lt;/p&gt;
&lt;p&gt;As before, I will answer some of the most common questions I have received about this script to save you some time.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Yes, Yes, Yes, Josh, I know I&amp;#39;m killing puppies with the &lt;strong&gt;Write-Host&lt;/strong&gt;, BUT again, it&amp;rsquo;s just for visual verification only.&lt;/li&gt;
&lt;li&gt;Was there much of a difference in speed gained by using &lt;strong&gt;&amp;ndash;Filter&lt;/strong&gt;? YES! We went from waiting anywhere from 4- 6 minutes to 2 -3 minutes to just over 15 seconds. Behold the power of the Shell!&lt;/li&gt;
&lt;li&gt;Why use &lt;strong&gt;New-Object&lt;/strong&gt;?&amp;nbsp; Honestly, Claus, Jeffery H, and Jeff W. I just happened to be on chapter 19 of &lt;a href="http://www.manning.com/jones/" target="_blank"&gt;Learn Windows PowerShell in a Month of Lunches&lt;/a&gt; (second edition) and, well, it looked like a good idea.&lt;/li&gt;
&lt;li&gt;Why are you worried about the OtherFax Number?&amp;nbsp; The reason for that, Brian, is that I have found the techs in the past were using Phone Numbers for Fax Numbers and vice versa. This can cause you to go insane trying to figure out why a particular number will not work correctly searching by Phone Number or Extension alone.&lt;/li&gt;
&lt;li&gt;Jeffery, I used the [String] setting, per Brian&amp;rsquo;s suggestion, to exclude the prompt for an extension making it a bit faster, and I soon realized (to my surprise) that I would now be able to use &lt;strong&gt;&amp;ndash;Filter&lt;/strong&gt; with &lt;strong&gt;Get-UMMailbox&lt;/strong&gt;, which otherwise was nearly impossible. Why the limitation on the Filters available, I have no idea. That would be a good question to bring up with the Exchange team.&lt;/li&gt;
&lt;li&gt;This is yet another reason to actually &amp;ldquo;Learn&amp;rdquo; Windows PowerShell. Do not just copy other people&amp;rsquo;s work. You are doing yourself a disservice. It did not even occur to me to make it a string, but now I am actually starting to &amp;ldquo;get it.&amp;rdquo; The more I &amp;ldquo;Learn&amp;rdquo; about Windows PowerShell, the more I want to use it, and I am better off for it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;Link to the repository: &lt;a href="http://gallery.technet.microsoft.com/scriptcenter/Get-Extension-a4213c52" target="_blank"&gt;http://gallery.technet.microsoft.com/scriptcenter/Get-Extension-a4213c52&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;~Tim&lt;/p&gt;
&lt;p&gt;Thank you, Tim! Great job, and thanks for sharing your script with us today. Join me tomorrow for more cool Windows PowerShell stuff.&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;strong&gt;Ed Wilson, Microsoft Scripting Guy&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3542806" width="1" height="1" alt="" /&gt;</description></item><item><title>Why Should I Learn PowerShell? Real World Example Saves the Day!</title><link>http://powershell.com/cs/blogs/hey-scriptingguy/archive/2012/01/28/why-should-i-learn-powershell-real-world-example-saves-the-day.aspx</link><pubDate>Sat, 28 Jan 2012 06:00:00 GMT</pubDate><guid isPermaLink="false">f421715f-7aba-45f0-8a8d-44de5318a3a7:14226</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;&lt;b&gt;Summary&lt;/b&gt;: Guest blogger, Tim Bolton, shares a real world story that brings home the need to learn Windows PowerShell.&lt;/p&gt;
&lt;p&gt;Microsoft Scripting Guy, Ed Wilson, is here, and it&amp;rsquo;s time for the Weekend Scripter. Today we have a guest blogger, Tim Bolton.&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/0160.wes_2D00_1_2D00_28_2D00_12_2D00_1.jpg"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/150x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/0160.wes_2D00_1_2D00_28_2D00_12_2D00_1.jpg" alt="Photo of Tim Bolton" title="Photo of Tim Bolton" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Tim Bolton has been involved in the IT Pro community for over 18 years. Tim received the Microsoft Certifications MCITP Enterprise Administrator on Windows Server 2008 and MCTS Microsoft Exchange Server 2010, Configuration. Tim is currently working as a Microsoft consultant and systems engineer at Software Solutions. Tim and his family have recently relocated to the Dallas/Fort Worth area.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Blog: &lt;a href="http://timbolton.net/" target="_blank"&gt;Tim Bolton &amp;ndash; MCITP &amp;ndash; MCTS&lt;/a&gt;, Sharing information about IT and things I have broken, fixed, and seen&amp;nbsp;&lt;br /&gt; Twitter: &lt;a href="http://twitter.com/#!/jsclmedave" target="_blank"&gt;@jsclmedave&lt;/a&gt;&lt;br /&gt; LinkedIn: &lt;a href="http://www.linkedin.com/in/timbolton" target="_blank"&gt;Tim Bolton&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Take it away Tim&amp;hellip;&lt;/p&gt;
&lt;p&gt;Working within a large corporate environment can produce some strange IT issues. Often these issues demand immediate attention and answers, usually with a manager hovering over you.&lt;/p&gt;
&lt;p&gt;Recently while I was working in one of those large corporate environments, which had a large network that had just inherited over a thousand servers, a security issue was raised. Each of the production servers are required to have RSA installed and running to ensure secure log ons.&lt;/p&gt;
&lt;p&gt;Because this was one of those scenarios where the servers were recently inherited, it proved to be extremely difficult to provide an accurate answer for, &amp;ldquo;Can you confirm that the RSA service is running on all of the servers within our scope?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;SCCM was not an option at this time and management wanted an answer &amp;ldquo;now,&amp;rdquo; so there was not time to open a service ticket for assistance. Logging on to over a thousand servers to verify if the RSA service was running was obviously not an option, and other third-party applications were not at our disposal.&lt;/p&gt;
&lt;p&gt;Windows Powershell to the rescue!&lt;/p&gt;
&lt;p&gt;With guidance from Windows Powershell MVP, Claus Nielsen, who happened to be online and available, I was able to provide the answer that was needed in a timely manner. I already had a text file (MyServers.txt) with all of the servers in our scope listed, so that part was already accomplished.&lt;/p&gt;
&lt;p&gt;The service that the RSA application ran as is OASVC_Local. I simply needed to check for that service on each server in the text file.&lt;/p&gt;
&lt;p&gt;Using the appropriate credentials, I pulled the servers from the text file by using &lt;b&gt;Get-Content&lt;/b&gt;, and I placed them into a variable that I called $Servers. Here is the command I used.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$Servers = Get-Content &amp;quot;C:\Temp\MyServers.txt&amp;quot;&lt;/p&gt;
&lt;p&gt;Now, using the &lt;b&gt;Foreach&lt;/b&gt; command, I started checking for the service on the remote servers. The &lt;b&gt;Foreach&lt;/b&gt; command will loop through each server in the $Servers variable. Each loop will use the variable $Server which will contain one item from the variable $Servers list of servers. By using the variable $Server (the computer name in this case) and &lt;b&gt;Get-WMIobject&lt;/b&gt; to connect to remote servers, the script will query for the service OASVC_Local, and populate the variable $Service with a &amp;quot;Service&amp;quot; object that will contain the properties for each object. Here is the command I arrived at using.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Foreach ($Server in $Servers)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;{$Service = Get-WMIobject win32_service -computername $Server -Filter &amp;quot;Name = &amp;#39;OASVC_Local&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p&gt;I also want to determine if the service is running or not. I query if the service is running by using the &lt;b&gt;If&lt;/b&gt; statement. If the &lt;i&gt;state&lt;/i&gt; equals &amp;ldquo;running,&amp;rdquo; then write &amp;quot;RSA is Running for $Server&amp;quot; to a file called&amp;nbsp;RSA.txt, and also write it to the console screen. I wanted to have the results appear on the console screen for quick viewing, in addition to a text file that I could use as a simple search for the key word &amp;ldquo;NOT&amp;rdquo; to identify servers that needed attention. (Note: NOT running -BackgroundColor red.) Here is that portion of the script.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;If ($Service.state -eq &amp;quot;running&amp;quot;)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Output &amp;quot;RSA is Running for $Server&amp;quot; | out-file -append C:\Temp\RSA.txt&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Host &amp;quot;RSA is Running for $Server&amp;rdquo;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;} else&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Output &amp;quot;RSA is NOT Running for $Server&amp;quot; | out-file -append C:\Temp\RSA.txt&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Host &amp;quot;RSA is NOT Running for $Server&amp;quot; -BackgroundColor red&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;
&lt;p&gt;The following image shows the commands that I typed and the output that I received in the 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/4848.wes_2D00_1_2D00_28_2D00_12_2D00_2.jpg"&gt;&lt;img src="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-76-18/4848.wes_2D00_1_2D00_28_2D00_12_2D00_2.jpg" alt="Image of command output" title="Image of command output" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the script in its entirety. Simple, quick&amp;mdash;and it provided me with the information that I needed in seconds. I actually found fewer than 10 servers out of a thousand, that needed to be checked as to why the RSA service was not running. This was a manageable task, which was corrected before the lunch hour.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;$Servers = Get-Content &amp;quot;C:\Temp\MyServers.txt&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Foreach ($Server in $Servers)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;{$Service = Get-WMIobject win32_service -computername $Server -Filter &amp;quot;Name = &amp;#39;OASVC_Local&amp;#39;&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;If ($Service.state -eq &amp;quot;running&amp;quot;)&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Output &amp;quot;RSA is Running for $Server&amp;quot; | out-file -append C:\Temp\RSA.txt&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Host &amp;quot;RSA is Running for $Server&amp;quot;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;} else&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp;{&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Output &amp;quot;RSA is NOT Running for $Server&amp;quot; | out-file -append C:\Temp\RSA.txt&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;Write-Host &amp;quot;RSA is NOT Running for $Server&amp;quot; -BackgroundColor red&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;}&lt;/p&gt;
&lt;p&gt;Without guidance and explanation from Windows PowerShell MVP, Claus Nielsen, this would have taken &amp;ldquo;me&amp;rdquo; most of the day to configure&amp;mdash;time that I did not have. This is yet another &amp;ldquo;real world&amp;rdquo; reason that seems to iterate throughout the IT community about learning Windows PowerShell. How many of us can reach out to a Windows PowerShell MVP that &amp;ldquo;may&amp;rdquo; be available to assist you with management&amp;rsquo;s emergencies? I was lucky today, but what will my managers ask tomorrow?&lt;/p&gt;
&lt;p&gt;If you are an IT administrator, I would highly suggest that you become familiar with Windows PowerShell. It may save the day and make you out to be the &amp;ldquo;go to&amp;rdquo; person when an issue arises. This may also come into play when reviews are due. Harness the power of Windows PowerShell to show your company why you and your skills stand out above the others.&lt;/p&gt;
&lt;p&gt;~Tim&lt;/p&gt;
&lt;p&gt;Thank you, Tim. This is a great real world example of using Windows PowerShell to save the day! It is also a tribute to the amazing Windows PowerShell community.&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=3475851" width="1" height="1" alt="" /&gt;</description></item></channel></rss>