<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/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>Tim Mintner : Powershell</title><link>http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx</link><description>Tags: Powershell</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Getting Operations Manager 2007 Overrides with Powershell</title><link>http://blogs.technet.com/tmintner/archive/2006/12/06/getting-operations-manager-2007-overrides-with-powershell.aspx</link><pubDate>Thu, 07 Dec 2006 04:55:28 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:545895</guid><dc:creator>tmintner</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/tmintner/comments/545895.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=545895</wfw:commentRss><description>&lt;p&gt;I am currently on an Operations Manager 2007 project and it's been a lot of fun so far.&amp;nbsp; One of the new concepts of Operations Manager 2007 is that any change made to the provided management packs are done through the use of Overrides.&amp;nbsp; Overrides were very difficult to manage and create in MOM 2005 but they are really simple to implement and change in Operations Manager 2007.&amp;nbsp; By default all Overrides are placed in a separate Management Pack called Default Management Pack.&amp;nbsp; This allows all of your custom settings to be mainted when upgrading your Management Packs.&lt;/p&gt; &lt;p&gt;Opeations Manager 2007 also has a great number of commands available to manage the product through Windows Powershell.&amp;nbsp; One of the commands that I found this week is called get-override.&amp;nbsp; After playing with this command a bit I found that I could run this simple command to give me a list of all of the overrides I have configured:&lt;/p&gt; &lt;p&gt;get-managementpack | get-override | format-list name,parameter,value&lt;/p&gt; &lt;p&gt;This will output a list of all of the overrides from all of the management packs that are installed giving me the name of the Override, the parameter that was changed, and the value of that changed parameter.&lt;/p&gt; &lt;p&gt;Have you started testing Operations Manager 2007 yet?&amp;nbsp; If not sign up today for the beta at &lt;a href="http://connect.microsoft.com"&gt;http://connect.microsoft.com&lt;/a&gt;!&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=545895" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/MOM/default.aspx">MOM</category><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Powershell to see what Updates have been installed</title><link>http://blogs.technet.com/tmintner/archive/2006/07/07/440729.aspx</link><pubDate>Sat, 08 Jul 2006 04:48:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:440729</guid><dc:creator>tmintner</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/tmintner/comments/440729.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=440729</wfw:commentRss><description>&lt;P&gt;I was playing around in Powershell today and ran into this nice set of commands that will show you what Updates have been installed as known by the Windows Update Agent:&lt;/P&gt;
&lt;P&gt;First create a variable and bind it to the "Microsoft.Update.Searcher" Com Object:&lt;/P&gt;
&lt;P&gt;$wu = new-object -com "Microsoft.Update.Searcher"&lt;/P&gt;
&lt;P&gt;A quick list of the&amp;nbsp;members returns:&lt;/P&gt;
&lt;P&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MemberType Definition&lt;BR&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------- ----------&lt;BR&gt;BeginSearch&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISearchJob BeginSearch (string, IUnknown, Variant)&lt;BR&gt;EndSearch&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISearchResult EndSearch (ISearchJob)&lt;BR&gt;EscapeString&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string EscapeString (string)&lt;BR&gt;GetTotalHistoryCount&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int GetTotalHistoryCount ()&lt;BR&gt;QueryHistory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IUpdateHistoryEntryCollection QueryHistory (int, ...&lt;BR&gt;Search&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Method&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISearchResult Search (string)&lt;BR&gt;CanAutomaticallyUpgradeService&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; bool CanAutomaticallyUpgradeService () {get} {set}&lt;BR&gt;ClientApplicationID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; string ClientApplicationID () {get} {set}&lt;BR&gt;IgnoreDownloadPriority&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; bool IgnoreDownloadPriority () {get} {set}&lt;BR&gt;IncludePotentiallySupersededUpdates Property&amp;nbsp;&amp;nbsp; bool IncludePotentiallySupersededUpdates () {get}...&lt;BR&gt;Online&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; bool Online () {get} {set}&lt;BR&gt;ServerSelection&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; ServerSelection ServerSelection () {get} {set}&lt;BR&gt;ServiceID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Property&amp;nbsp;&amp;nbsp; string ServiceID () {get} {set}&lt;/P&gt;
&lt;P&gt;So it looks like I can do a QueryHistory to see what has been installed.&amp;nbsp; Before doing so I need to know how many updates have been installed.&lt;/P&gt;
&lt;P&gt;$totalupdates = $wu.GetTotalHistoryCount()&lt;/P&gt;
&lt;P&gt;Now I can run this command to see my update history:&lt;/P&gt;
&lt;P&gt;$wu.QueryHistory(0,$totalupdates)&lt;/P&gt;
&lt;P&gt;This will list all of the updates along with the following properties:&lt;/P&gt;
&lt;P&gt;Name&lt;BR&gt;----&lt;BR&gt;Categories&lt;BR&gt;ClientApplicationID&lt;BR&gt;Date&lt;BR&gt;Description&lt;BR&gt;HResult&lt;BR&gt;Operation&lt;BR&gt;ResultCode&lt;BR&gt;ServerSelection&lt;BR&gt;ServiceID&lt;BR&gt;SupportUrl&lt;BR&gt;Title&lt;BR&gt;UninstallationNotes&lt;BR&gt;UninstallationSteps&lt;BR&gt;UnmappedResultCode&lt;BR&gt;UpdateIdentity&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=440729" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Powershell and Active Directory</title><link>http://blogs.technet.com/tmintner/archive/2006/07/05/440309.aspx</link><pubDate>Thu, 06 Jul 2006 01:55:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:440309</guid><dc:creator>tmintner</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/tmintner/comments/440309.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=440309</wfw:commentRss><description>&lt;P&gt;Mow posted another great blog entry on how to access User properties in Active Directory with Powershell.&amp;nbsp; This guy's blog&amp;nbsp;is just awesome.&amp;nbsp; You should definitely start to grab his feeds:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://mow001.blogspot.com/2006/07/powershell-and-active-directory-part-3.html"&gt;http://mow001.blogspot.com/2006/07/powershell-and-active-directory-part-3.html&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=440309" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Use Powershell to add virtual machines to Virtual Server</title><link>http://blogs.technet.com/tmintner/archive/2006/07/05/440187.aspx</link><pubDate>Wed, 05 Jul 2006 09:20:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:440187</guid><dc:creator>tmintner</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/tmintner/comments/440187.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=440187</wfw:commentRss><description>&lt;P&gt;Back to a topic that I know I won't get dinged on.&amp;nbsp; :)&lt;/P&gt;
&lt;P&gt;I was playing arround with the list of available COM ProgID's by using the command in Jeffrey Snover's blog: &lt;A href="http://blogs.msdn.com/powershell/archive/2006/06/29/650913.aspx"&gt;http://blogs.msdn.com/powershell/archive/2006/06/29/650913.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I ran this command to see the available Program ID's:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;dir &amp;nbsp;REGISTRY::HKEY_CLASSES_ROOT\CLSID -include PROGID -recurse | foreach {$_.GetValue("")} | out-file progids.txt&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;After looking through the file I noticed a very interesting ID called VirtualServer.Application.&amp;nbsp; That sounded promising so I quickly ran the command:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;$vs = new-object -com "VirtualServer.Application"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;I then ran the command $vs to see what I could see...Well the command turned up a bunch of blank properties.&amp;nbsp; So I thought I might have to do some more digging so I did a quick Live Search on VirtualServer.Application and came up with two great blog entries for managing Virtual Server with Powershell:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/virtual_pc_guy/archive/2006/06/13/630165.aspx"&gt;http://blogs.msdn.com/virtual_pc_guy/archive/2006/06/13/630165.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/virtual_pc_guy/archive/2006/06/15/631857.aspx"&gt;http://blogs.msdn.com/virtual_pc_guy/archive/2006/06/15/631857.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;After creating my COM wrapper and setting my security as described in the Virtual PC Guy's blog entries, I tried my $vs command again and low and behold I had some actual properties.&lt;/P&gt;
&lt;P&gt;At this point I wanted to see what I could do with that object so I typed the following command:&lt;/P&gt;
&lt;P&gt;$vs | get-member&lt;/P&gt;
&lt;P&gt;I quickly noticed a method called RegisterVirtualMachines.&amp;nbsp; That sounded promising.&amp;nbsp; I often download gigabytes of virtual machines to play with new technology and it is a royal pain to use the Virtual Server Administration Website to register all of those virtual machines.&amp;nbsp; So I did another Live Search to see what the parameters were for the RegisterVirtualMachines method and found this reference: &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msvs/msvs/ivmvirtualserver_createvirtualmachine.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msvs/msvs/ivmvirtualserver_createvirtualmachine.asp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;As you can see there are only two required parameters, the name of the VMC file and the path to the VMC file like this RegisterVirtualMachines("Testmachine.vmc","c:\vms\")&lt;/P&gt;
&lt;P&gt;Now I was getting somewhere!&amp;nbsp; I went ahead and went for the&amp;nbsp;gold and tried this command:&lt;/P&gt;
&lt;P&gt;dir . -include *.vmc -Recurse | foreach-object {$vs.RegisterVirtualMachine($_.name,$_.directoryname)}&lt;/P&gt;
&lt;P&gt;Boom!&amp;nbsp; All of my virtual machine's were now registered inside of Virtual Server!&amp;nbsp; &lt;/P&gt;
&lt;P&gt;As you can see with a little bit of research you can take advantage of any COM progID and in a short amount of time start to use it to solve problems.&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=440187" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Virtual+Server+and+Virtual+PC/default.aspx">Virtual Server and Virtual PC</category><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Use Powershell to find SMS errors</title><link>http://blogs.technet.com/tmintner/archive/2006/07/03/440028.aspx</link><pubDate>Tue, 04 Jul 2006 01:20:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:440028</guid><dc:creator>tmintner</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/tmintner/comments/440028.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=440028</wfw:commentRss><description>&lt;P&gt;I was working onsite with a client last week and we were testing SMS V4 (SCCM 2007) OS Deployment features.&amp;nbsp; While we were working we were having numerous client connectivity errors and often had to pull up good ol' notepad or SMS Trace to find the errors.&lt;/P&gt;
&lt;P&gt;That got me thinking that there has to be a faster way to quickly identify errors in the SMS event log so I started playing around with Powershell.&amp;nbsp; Powershell has a concept called a filter that you can create to manipulate objects as they pass through the pipeline.&amp;nbsp; Wouldn't it be great if I could read the SMS log file and pull out any error messages?&lt;/P&gt;
&lt;P&gt;Well this small bit of code does just that:&lt;/P&gt;
&lt;P&gt;filter finderrors { if ($_.contains("error")) {$_}}&lt;/P&gt;
&lt;P&gt;This creates a filter called finderors.&amp;nbsp; You can then pass this filter any log or text file and it will analyze the file line by line.&amp;nbsp; If a line contains an error it will return that to the screen.&amp;nbsp; Here is an example command:&lt;/P&gt;
&lt;P&gt;get-content ccmexec.log | finderrors&lt;/P&gt;
&lt;P&gt;If you want to output the errors to a file just run the command like this:&lt;/P&gt;
&lt;P&gt;get-content ccmexec.log | finderrors | out-file errors.txt&lt;/P&gt;
&lt;P&gt;You could also go ahead and open it up in notepad at the same time:&lt;/P&gt;
&lt;P&gt;get-content ccmexec.log | finderrors | out-file errors.txt | notepad errors.txt&lt;/P&gt;
&lt;P&gt;What's cool about this filter is you can now pipe in multiple log files like this:&lt;/P&gt;
&lt;P&gt;dir *.log | foreach-object {get-content $_ | finderrors} | out-file errors.txt | notepad errors.txt&lt;/P&gt;
&lt;P&gt;I know that this produces some pretty raw output but with a little string massaging you could have the filter return only the specific eror messages&amp;nbsp;and time of the error.&lt;/P&gt;
&lt;P&gt;Enjoy and have a great 4th!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=440028" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Powershell Execution Policy on Vista</title><link>http://blogs.technet.com/tmintner/archive/2006/06/27/439084.aspx</link><pubDate>Wed, 28 Jun 2006 00:29:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:439084</guid><dc:creator>tmintner</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/tmintner/comments/439084.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=439084</wfw:commentRss><description>&lt;P&gt;If you have downloaded and used RC1 of Powershell you will see that the Execution Policy is set to restricted by default.&amp;nbsp; This essentially means that scripts do not function by default within Powershell.&amp;nbsp; Although this is a great security feature that prevents the running of accidental scripts, it is not very usable.&lt;/P&gt;
&lt;P&gt;To change this option you must run the following command from within Powershell:&lt;/P&gt;
&lt;P&gt;Set-ExecutionPolicy Remotesigned&lt;/P&gt;
&lt;P&gt;This will require that all scripts be signed prior to running or you can go all out and run:&lt;/P&gt;
&lt;P&gt;Set-ExecutionPolicy Unrestricted&lt;/P&gt;
&lt;P&gt;This allows you to run all scripts regardless of whether or not they are signed.&lt;/P&gt;
&lt;P&gt;If you are trying to do this on Vista and you haven't disabled UAC then you will need to elevate Powershell prior to running the command.&amp;nbsp; Strangely enough, when you right click on Powershell in the "Start" (I don't know what to call this!!) menu there is no option to Run as Administrator.&amp;nbsp; To do this you must browse to the Powershell installation folder and right click on powershell.exe and click on Run as Administrator.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=439084" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Powershell Books</title><link>http://blogs.technet.com/tmintner/archive/2006/06/27/439078.aspx</link><pubDate>Wed, 28 Jun 2006 00:02:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:439078</guid><dc:creator>tmintner</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/tmintner/comments/439078.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=439078</wfw:commentRss><description>&lt;P&gt;If you are into printed books there are a couple of really good Powershell books that you should check out.&lt;/P&gt;
&lt;P&gt;O"Reilly has a great book simply titled Monad.&amp;nbsp; This book was originally written on one of the beta versions of Powershell but if you purchase the book you can get the updated version at no charge.&amp;nbsp; Check out the book here: &lt;A href="http://www.oreilly.com/catalog/powershell/"&gt;http://www.oreilly.com/catalog/powershell/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Jeffrey Hicks and Don Jones are also writing abook titled Powershell from Sapien Press.&amp;nbsp; It looks good so far.&amp;nbsp; I can't wait until it releases!&amp;nbsp; Check it out here: &lt;A href="http://www.sapienpress.com/"&gt;http://www.sapienpress.com/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=439078" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Sample Powershell Active Directory Phonebook Script</title><link>http://blogs.technet.com/tmintner/archive/2006/06/26/438935.aspx</link><pubDate>Mon, 26 Jun 2006 23:43:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:438935</guid><dc:creator>tmintner</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.technet.com/tmintner/comments/438935.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=438935</wfw:commentRss><description>&lt;P&gt;I have been learning the syntax of Powershell so I thought I would write a simple little script to search Active Directory for the mobile phone numbers of my co-workers.&amp;nbsp; This script will accept an input of lastname and even take wildcard characters so if I wanted to search for all people's mobile phone numbers that start with min I can just use min* as my search string.&lt;/P&gt;
&lt;P&gt;Check it out:&lt;/P&gt;
&lt;P&gt;function getmobilenumber($name)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp; $root = New-Object DirectoryServices.DirectoryEntry&lt;BR&gt;&amp;nbsp; $Searcher = New-Object DirectoryServices.DirectorySearcher&lt;BR&gt;&amp;nbsp; $Searcher.Searchroot = $root&lt;BR&gt;&amp;nbsp; $searcher.filter = ("(sn=$name)")&lt;BR&gt;&amp;nbsp; $Proplist = "cn","mobile"&lt;BR&gt;&amp;nbsp; $Proplist | foreach {[void]$Searcher.Propertiestoload.Add($_)}&lt;BR&gt;&amp;nbsp; $results = $searcher.findall()&lt;BR&gt;&amp;nbsp; foreach ($result in $results){$result.properties}&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;To use it just type getmobilephonenumber("lastname") where lastname is the name of the person you are searching for.&amp;nbsp; Note that the $proplist variable could be changed to whatever AD attributes that you wanted to search for.&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;
&lt;P&gt;BTW I learned a lot on how to do this from this blog entry: &lt;A href="http://mow001.blogspot.com/2006/04/large-ad-queries-in-monad.html"&gt;http://mow001.blogspot.com/2006/04/large-ad-queries-in-monad.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=438935" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Powershell command to see what’s installed</title><link>http://blogs.technet.com/tmintner/archive/2006/06/24/438680.aspx</link><pubDate>Sat, 24 Jun 2006 23:00:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:438680</guid><dc:creator>tmintner</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.technet.com/tmintner/comments/438680.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=438680</wfw:commentRss><description>&lt;p&gt;Here is a quick little Powershell script that I find useful to see what I have installed on my system.  
&lt;/p&gt;&lt;p&gt;This will return the installed program and the date that it was installed:
&lt;/p&gt;&lt;p&gt;get-wmiobject -class "win32reg_addremoveprograms" -namespace "root\cimv2" | select-object -property Displayname,Installdate
&lt;/p&gt;&lt;p&gt;To run this against a remote computer just add a –Computername “computername” before the first pipe.
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=438680" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item><item><title>Learning PowerShell</title><link>http://blogs.technet.com/tmintner/archive/2006/06/17/436944.aspx</link><pubDate>Sun, 18 Jun 2006 01:20:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:436944</guid><dc:creator>tmintner</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/tmintner/comments/436944.aspx</comments><wfw:commentRss>http://blogs.technet.com/tmintner/commentrss.aspx?PostID=436944</wfw:commentRss><description>&lt;p&gt;If you are involved with scripting at all you have probably heard about Powershell.  Powershell is formerly known as MONAD.  I will be posting some sample scripts here in the future but before reading those you should become familiar with some of the great Powershell/Monad sites out there:
&lt;/p&gt;&lt;p&gt;Check out these links for great Powershell information:
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;Powershell Portal: http://www.microsoft.com/powershell
&lt;/p&gt;&lt;p&gt;Powershell Team Blog: &lt;a href="http://blogs.msdn.com/powershell/"&gt;http://blogs.msdn.com/powershell/&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;Scripts.readify.net: &lt;a href="http://scripts.readify.net/"&gt;http://scripts.readify.net/&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;Jeffrey Hicks’ Blog (former coworker!): &lt;a href="http://jdhitsolutions.blogspot.com/"&gt;http://jdhitsolutions.blogspot.com/&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;Keith Hill’s Blog: &lt;a href="http://keithhill.spaces.msn.com/PersonalSpace.aspx?_c01_blogpart=blogmgmt&amp;amp;_c=blogpart"&gt;http://keithhill.spaces.msn.com/PersonalSpace.aspx?_c01_blogpart=blogmgmt&amp;amp;_c=blogpart&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;Powershell for Fun (includes Powershell remoting tools!): &lt;a href="http://mshforfun.blogspot.com/"&gt;http://mshforfun.blogspot.com/&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;MOW Powershelled: &lt;a href="http://mow001.blogspot.com/"&gt;http://mow001.blogspot.com/&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;There is also a PowerShell IDE available here: &lt;a href="http://www.powershell.com/"&gt;http://www.powershell.com/&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;Enjoy&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=436944" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/tmintner/archive/tags/Powershell/default.aspx">Powershell</category></item></channel></rss>