<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7309400939930129927</id><updated>2011-10-20T07:50:53.120+01:00</updated><category term='password policy'/><category term='windows server 2003'/><category term='user group'/><category term='active directory'/><category term='podcast'/><category term='citrix'/><category term='powergui'/><category term='powershell'/><category term='exchange 2003'/><category term='twitter'/><category term='tech.ed'/><category term='vmware'/><category term='events'/><category term='geek'/><category term='wmi'/><category term='blogging'/><category term='wsus'/><title type='text'>Jonathan Medd's Blog</title><subtitle type='html'>Scripting. Powershell, VBScript, Windows, Active Directory &amp;amp; Exchange.VMWare. All that kind of stuff.....</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>41</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-5549914168241950682</id><published>2009-04-16T22:10:00.003+01:00</published><updated>2009-04-16T22:16:36.053+01:00</updated><title type='text'>This blog has moved</title><content type='html'>I decided it was about time to smarten up my blog so from now on you should check out &lt;a href="http://jonathanmedd.net"&gt;http://jonathanmedd.net&lt;/a&gt; . I transferred the feed so anyone subscribed to &lt;a href="http://feeds2.feedburner.com/JonathanMedd"&gt;http://feeds2.feedburner.com/JonathanMedd&lt;/a&gt; will automatically get the new content.&lt;br /&gt;&lt;br /&gt;Thanks for staying with me :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-5549914168241950682?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/5549914168241950682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=5549914168241950682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5549914168241950682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5549914168241950682'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/04/this-blog-has-moved.html' title='This blog has moved'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-7472935048362555886</id><published>2009-04-07T21:33:00.002+01:00</published><updated>2009-04-07T22:02:49.461+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><title type='text'>Putting Shay's Powershell Registry Functions To Use</title><content type='html'>Recently I needed to check some registry key values on a bunch of servers. There were far too many servers to make this a manual task and in addition if they weren't what I was expecting then I needed to change them.&lt;br /&gt;&lt;br /&gt;Shay Levy has very helpfully published a &lt;a href="http://blogs.microsoft.co.il/blogs/scriptfanatic/archive/2007/10/30/stand-alone-registry-functions-library.aspx"&gt;Stand Alone Registry Functions Library&lt;/a&gt; which I made use of. It allows you to query and set registry values for things such as DWords, Strings, Binary Values on remote machines very easily. In my case I was particularly interested in some configuration settings for the ICA protocol, HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\ICA-tcp, all of them DWords.&lt;br /&gt;&lt;br /&gt;First of all we use Shay's Get-RegDWord function at the top of the script which contains some .NET code to query a remote registry&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Get-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;param&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;br /&gt;  [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;  [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;  [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;  [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;  [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$defaultValue&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Your default value&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hives&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;enum&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;getnames&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;([&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Microsoft.Win32.RegistryHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;])&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hives&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-notcontains&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;write-error&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Invalid hive value&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Microsoft.Win32.RegistryHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Microsoft.Win32.RegistryKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;OpenRemoteBaseKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$subKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.OpenSubKey(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;!&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$subKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;write-error&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;The specified registry key does not exist.&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$subKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetValue(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$defaultValue&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;} &lt;/span&gt;&lt;/pre&gt;Then we specify the list of servers to query. You could either use something like:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$servers&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-Content&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;servers.txt&lt;/span&gt;&lt;/pre&gt;or in my case they were all virtual servers in VMware so I used a couple of VI Toolkit commands to specify the list&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Connect to Virtual Center&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Connect-VIServer  vc&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Get a list of all the powered on APP servers&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$servers&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; Get-Folder &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Servers&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | Get-VM | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Where-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$_&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Powerstate &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-eq&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;PoweredOn&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Then we loop through each server, call Shay's Get-RegDWord function for each of the DWords we are interested in and store the results in the $myCOl variable. At the end we export the $myCol variable into a CSV file for handy viewing.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Create an empty array to store the results in&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$myCol&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; @()&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$servers&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;LocalMachine&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;System\CurrentControlSet\Control\Terminal Server\WinStations\ICA-tcp&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Find MaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valuename&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;MaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Get-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Find fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Get-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Find MaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;MaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Get-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Find fInheritMaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;fInheritMaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$fInheritMaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Get-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Add the results to the $MYInfo variable, then $myCol&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;select-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;MaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;MaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;fInheritMaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Name &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.MaxIdleTime &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.fInheritMaxIdleTime &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.MaxDisconnectionTime &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.fInheritMaxDisconnectionTime &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$fInheritMaxDisconnectionTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$myCol&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Export the results to a csv file&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$myCol&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Export-Csv&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;citrixservers.csv&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-NoTypeInformation&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Now that we can view the results I was able to see that I needed to set a lot of these values to something new. Using Shay's Set-RegDWord function it is a pretty straightfoward task to extend the above to do that. First of all add the function to the top of the script.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;function&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Set-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;param&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;br /&gt;      [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;      [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;      [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;      [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;br /&gt;      [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;double&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hives&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;enum&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;getnames&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;([&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Microsoft.Win32.RegistryHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;])&lt;br /&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hives&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-notcontains&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;write-error&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Invalid hive value&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;  }&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Microsoft.Win32.RegistryHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Microsoft.Win32.RegistryKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;OpenRemoteBaseKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regHive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$subKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$regKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.OpenSubKey(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$true&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;!&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$subKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;write-error&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;The specified registry key does not exist.&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;      &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;br /&gt;  }&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$subKey&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.SetValue(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,[&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Microsoft.Win32.RegistryValueKind&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;DWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$?&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) {&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$true&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;} &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$false&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;br /&gt;} &lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Then for each of the values you want to change use an if statement to check whether it needs changing and if so call Shay's Set-RegDword to make the necessary changes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Find fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Get-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; Check the value and change if necessary&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$fInheritMaxIdleTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-eq&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;Set-RegDWord&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$hive&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$keyName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$valueName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;   }&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Thanks again to Shay for publishing these functions, it made this particular task very easy to complete and I'm sure I'll be using them again in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-7472935048362555886?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/7472935048362555886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=7472935048362555886' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7472935048362555886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7472935048362555886'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/04/putting-shays-powershell-registry.html' title='Putting Shay&apos;s Powershell Registry Functions To Use'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-5784548368561564676</id><published>2009-03-12T21:44:00.005Z</published><updated>2009-03-16T12:41:36.904Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='active directory'/><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>Get-Scripting Guys Take Over the March UK Powershell User Group</title><content type='html'>Myself and &lt;a href="http://www.virtu-al.net/"&gt;Alan Renouf&lt;/a&gt; from the &lt;a href="http://get-scripting.blogspot.com/"&gt;Get-Scripting Podcast&lt;/a&gt; will be presenting this month at the &lt;a href="http://richardsiddaway.spaces.live.com/blog/cns%2143CFA46A74CF3E96%212100.entry"&gt;UK Powershell User Group on Thursday 26th March at Microsoft in Reading&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;First up on the night will be &lt;a href="http://richardsiddaway.spaces.live.com/default.aspx"&gt;Richard Siddaway&lt;/a&gt; talking to us about using Regular Expressions in Powershell. This was requested at a previous event and I know that Richard is really looking forward to talking about that subject ;-)&lt;br /&gt;&lt;br /&gt;Then the Get-Scripting guys will take over:&lt;br /&gt;&lt;br /&gt;I will be talking about some of the features that are part of Active Directory in Server 2008 R2 , currently in beta, in particular the native AD Powershell cmdlets which will ship as part of that product and what I have learned about them so far.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.vmware.com/communities/vexpert/"&gt;vExpert&lt;/a&gt; Alan Renouf will then tell us about the VI toolkit, which for those of you not in the know are the cmdlets shipped by VMware to enable you to manage their ESX product.&lt;br /&gt;&lt;br /&gt;A good mixture I think of general scripting skills, third-party added value to your Powershell learning and future technologies.&lt;br /&gt;&lt;br /&gt;If you can't make the event in person then as usual it will be broadcast by LiveMeeting (details &lt;a href="http://richardsiddaway.spaces.live.com/Blog/cns%2143CFA46A74CF3E96%212157.entry"&gt;here&lt;/a&gt;). It wouldn't be a UK Powershell event if the LiveMeeting part doesn't go 100% to plan, but we will endeavour to ensure we avoid the usual trick of the microphone going on mute.&lt;br /&gt;&lt;br /&gt;If you wish to attend the event in person you should contact Richard via his &lt;a href="http://richardsiddaway.spaces.live.com/default.aspx"&gt;blog&lt;/a&gt; so that he can have a badge for you at the welcome desk. If the prospect of us presenting isn't enough to attract you then as always there will be pizza at half-time :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-5784548368561564676?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/5784548368561564676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=5784548368561564676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5784548368561564676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5784548368561564676'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/03/get-scripting-guys-take-over-march-uk.html' title='Get-Scripting Guys Take Over the March UK Powershell User Group'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-841449013404693776</id><published>2009-03-10T22:17:00.003Z</published><updated>2009-03-10T22:44:52.811Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>Today's UK VMware User Group</title><content type='html'>Today's UK VMware User Group was a great community content event. Of course there was a sponsor presentation (Veeam) without whom these type of events can't be put on, but there were also a lot of contributions from people in the group.&lt;br /&gt;&lt;br /&gt;We had:&lt;br /&gt;&lt;br /&gt;1) &lt;a href="http://www.veeam.com/"&gt;Veeam&lt;/a&gt; talking about their reporting and backup products.&lt;br /&gt;&lt;br /&gt;2) Mike Laverick from &lt;a href="http://www.rtfm-ed.co.uk/"&gt;RTFM education&lt;/a&gt; talking about &lt;a href="http://www.vmware.com/products/srm/"&gt;Site Recovery Manager&lt;/a&gt; and not the VMware view of it, rather real world struggles - warts and all as he put it. Its great to see this kind of content because you get to find out how these products really function in reality. He also gave away a few copies of his &lt;a href="http://www.rtfm-ed.co.uk/?p=1038"&gt;book&lt;/a&gt; on Site Recovery Manager which I'm sure is a must read for this topic.&lt;br /&gt;&lt;br /&gt;3) &lt;a href="http://get-scripting.blogspot.com"&gt;Get-Scripting's&lt;/a&gt; very own vExpert &lt;a href="http://www.virtu-al.net/"&gt;Alan Renouf&lt;/a&gt; gave us a debrief from VMworld Europe in Cannes. By the sounds of it a great event, but possibly could be extended to include an extra day and maybe needs a bigger venue given the issues some people had getting into sessions.&lt;br /&gt;&lt;br /&gt;4) A presentation from another community member about technology futures, 'the cloud', advances in mobile devices, stuff like that, and how they may affect the corporate world. This is now the second event I have been to which has talked about employee owned IT, i.e. you turn up to a job with your own laptop and corporate IT supply you either with a VM to run corporate applications or all delivered through a browser. The demand coming from cool, young, hip people (like me :-)  ) who won't stand for the constraints of a corporate environment.&lt;br /&gt;&lt;br /&gt;"Why can't I run facebook / second life / quake / twitter on my macbook / ipod/ pink netbook and just run your apps on the same machine too?"&lt;br /&gt;&lt;br /&gt;5)  Steve Bruck and Alan Renouf (again) with an update about the recently released &lt;a href="http://blogs.vmware.com/vipowershell/"&gt;VI toolkit&lt;/a&gt; V1.5 . Some good examples, also lots of interest in &lt;a href="http://www.virtu-al.net/2009/02/23/vi-toolkit-quick-reference-guide/"&gt;Alan's getting started guide&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;6) Finally finished off with more community content, this time about the upcoming &lt;a href="http://vmblog.com/archive/2009/02/24/vmware-signs-oem-agreement-with-neverfail-to-protect-vcenter-heartbeat-solution.aspx"&gt;vCenter Heartbeat&lt;/a&gt; product.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It was great to see slightly more audience participation than normal this time, which I think might have come from the slightly smaller room and more, but shorter sessions. I really enjoyed it anyway.&lt;br /&gt;&lt;br /&gt;If you want to hear REAL people talking about how they really use VMware based products then this is the event for you.&lt;br /&gt;&lt;br /&gt;Next one 14th May! &lt;a href="http://communities.vmware.com/community/vmug/emea/london"&gt;More details can be found here.&lt;br /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-841449013404693776?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/841449013404693776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=841449013404693776' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/841449013404693776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/841449013404693776'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/03/todays-uk-vmware-user-group.html' title='Today&apos;s UK VMware User Group'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-469091855188911870</id><published>2009-03-04T22:39:00.002Z</published><updated>2009-03-04T23:03:47.055Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='citrix'/><title type='text'>Counting the Number of Sessions Per Citrix Server</title><content type='html'>Whilst monitoring some newly provisioned Citrix servers running on VMware hosts today, I soon became very bored with manually checking how many sessions were on each Citrix VM as the load on each one increased, whilst trying to get it to the optimum level.&lt;br /&gt;&lt;br /&gt;I knew it was possible to use Powershell to connect with Citrix servers, but had never really looked into it before. Not surprisingly it turned out to be very straightforward.&lt;br /&gt;&lt;br /&gt;By using some technology known as &lt;a href="http://community.citrix.com/blogs/citrite/vishalg/2008/05/01/The+ultimate+guide+to+Citrix+MFCOM+SDK"&gt;MFCom&lt;/a&gt; we can connect with the Citrix farm and get some cool information out.&lt;br /&gt;&lt;br /&gt;In the below example we create a new com object using MFCom, then initialise the connection. We are then able to access some methods and properties of that object. In this case we are looking at the Sessions property, we group all of the results by ServerName and then produce some output with the name and number of sessions on that Citrix box.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$farm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;New-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -com &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;MetaframeCOM.MetaframeFarm&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$farm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Initialize(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$farm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Sessions &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;| &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Group-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ServerName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Sort-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Format-Table&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Count&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -auto&lt;/span&gt;&lt;/pre&gt;which will give you something like:&lt;br /&gt;&lt;br /&gt;Name                                             Count&lt;br /&gt;&lt;br /&gt;CitrixServer01            38&lt;br /&gt;CitrixServer02            45&lt;br /&gt;CitrixServer03            41&lt;br /&gt;&lt;br /&gt;This would return all of the servers in the farm. In this particular instance I only wanted a particular selection of servers, so I stored them in a text file, got PS to read that file and then filter the query by only looking at servers in that list.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$servers&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-Content&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;c:\scripts\servers.txt&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$farm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;New-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -com &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;MetaframeCOM.MetaframeFarm&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$farm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Initialize(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$farm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.sessions | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Where-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$servers&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-contains&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$_&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.ServerName} | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Group-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ServerName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Sort-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Format-Table&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Count&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -auto&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Once again Powershell very easily gets rid of a really dull manual task.&lt;br /&gt;&lt;br /&gt;If you wish to take this a step further check out Powershell MVP Brandon Shell's blog where he has loads of Powershell / Citrix examples.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bsonposh.com/archives/tag/citrix"&gt;http://bsonposh.com/archives/tag/citrix&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-469091855188911870?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/469091855188911870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=469091855188911870' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/469091855188911870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/469091855188911870'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/03/counting-number-of-sessions-per-citrix.html' title='Counting the Number of Sessions Per Citrix Server'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-597509299590373759</id><published>2009-02-22T15:02:00.002Z</published><updated>2009-02-22T15:07:17.271Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='active directory'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>UK Active Directory User Group - 6pm GMT Wednesday 11th March</title><content type='html'>This is the second meeting of the newly formed UK Active Directory User Group:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Calibri; color: black; font-size: 14pt;"&gt;The second [ADUG] UK Active Directory User Group meeting will be on the &lt;strong&gt;evening &lt;/strong&gt;of the &lt;strong&gt;11th March&lt;/strong&gt; at Microsoft's &lt;st1:city&gt;London&lt;/st1:city&gt; (&lt;st1:state&gt;&lt;st1:place&gt;&lt;em&gt;Victoria&lt;/em&gt;&lt;/st1:place&gt;&lt;/st1:state&gt;) Offices. The meeting will co-hosted with the Windows Server User Group.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The draft agenda is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;18:00 for 18:25 Arrival and registration  &lt;/li&gt;&lt;li&gt;18:25-18:30 Welcome and introductions  &lt;/li&gt;&lt;li&gt;18:30-19:45 James O'Neill takes a quick tour through the new features in  Windows Server 2008 R2 (just to whet your appetite).  &lt;/li&gt;&lt;li&gt;19:45-20:00 Refreshments  &lt;/li&gt;&lt;li&gt;20:00-21:15 Amish Lukka (also from Microsoft) will be presenting an insight  into new Active Directory features in Windows Server 2008 R2.  &lt;/li&gt;&lt;li&gt;21:15-21:30 Wrap-up.  &lt;/li&gt;&lt;li&gt;21:20 Adjourn to a nearby public house where Mark Parris will be happy to  share his experiences of the Microsoft Certified Masters: Windows Server 2008:  Directory class that he attended last November. &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin: 0cm 30pt 0pt;"&gt;&lt;span style="font-family: Calibri; color: black; font-size: 14pt;"&gt;If you are interested in attending - please send an email to &lt;a href="mailto:registration@adug.co.uk"&gt;&lt;strong&gt;registration@adug.co.uk&lt;/strong&gt;&lt;/a&gt; with your name and see you there. The confirmed times will be in the confirmation email.&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0cm 30pt 0pt;"&gt;&lt;span style="font-family: Calibri; color: black; font-size: 14pt;"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0cm 30pt 0pt;"&gt;&lt;span style="font-family: Calibri; color: black; font-size: 14pt;"&gt;&lt;br /&gt;For those who can’t make it in person, we will set up a Live Meeting session (which will be recorded) and details will be made available closer to the event.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-597509299590373759?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/597509299590373759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=597509299590373759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/597509299590373759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/597509299590373759'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/uk-active-directory-user-group-6pm-gmt.html' title='UK Active Directory User Group - 6pm GMT Wednesday 11th March'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-3106639207258899865</id><published>2009-02-22T14:56:00.002Z</published><updated>2009-02-22T15:01:38.743Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>UK London VMware User Group Meeting, Tuesday 10th March 2009</title><content type='html'>These are great events if you are able to get to them (unfortunately no webcast for this one):&lt;br /&gt;&lt;br /&gt;The Steering Committee are pleased to announce the next UK London VMware User&lt;br /&gt;Group meeting, &lt;b&gt;now kindly sponsored by &lt;a class="jive-link-external" href="http://www.veeam.com/"&gt;Veeam&lt;/a&gt; Software&lt;/b&gt;, to be held&lt;br /&gt;on Tuesday 10th March 2009. We hope to see you at the meeting, and&lt;br /&gt;afterwards for a drink or two.&lt;br /&gt;&lt;br /&gt;Our meeting will be held at the Thames Suite, London Chamber of Commerce and&lt;br /&gt;Industry, 33 Queen Street, London EC4R 1AP, +44 (0)20 7248 4444. The nearest&lt;br /&gt;tube station is Mansion House, location information is available &lt;a class="jive-link-external" href="http://maps.google.co.uk/maps?f=q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;time=&amp;amp;date=&amp;amp;ttype=&amp;amp;q=EC4R+1AP&amp;amp;ie=UTF8&amp;amp;z=16&amp;amp;iwloc=addr&amp;amp;om=1"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;PLEASE NOTE: As well as the date changing from the previously-published one, the day&lt;br /&gt;has also changed to Tuesday, and we're in a different part of the venue&lt;br /&gt;from normal (out of the lift, turn right). Rest assured, the usual UG&lt;br /&gt;staples of great content and me banging on about Powershell will be&lt;br /&gt;present and correct.&lt;br /&gt;&lt;br /&gt;Reception is from 1230 for a prompt 1pm start, to finish around 5pm. Our agenda&lt;br /&gt;for is not final at the moment, but looks something like this:&lt;br /&gt;&lt;br /&gt;12:30 – 13:00      Arrive &amp;amp; Refreshments&lt;br /&gt;13:00 – 13:15      Welcome &amp;amp; News&lt;br /&gt;13:20 – 14:05      Sponsor Presentation - TBA&lt;br /&gt;14:10 – 14:55      Presentation on real world Site Recovery Manager experience&lt;br /&gt;15:00 – 15:20      Refreshments Break&lt;br /&gt;15:25 – 16:00      Committee-moderated, user-generated content and discussion (some good stuff being lined up here)&lt;br /&gt;16:05 – 16:45      VMworld Cannes debrief&lt;br /&gt;16:45 – 17:00      Close&lt;br /&gt;17:00 – Pub&lt;br /&gt;&lt;br /&gt;Please feel free to contribute to the 'UG content ideas' forum thread running &lt;a class="jive-link-thread" href="http://communities.vmware.com/thread/163372"&gt;here&lt;/a&gt;. We won't be able&lt;br /&gt;to incorporate all of the ideas for this coming meeting, but will do our best&lt;br /&gt;to include some of them.&lt;br /&gt;&lt;br /&gt;To register your interest in attending, please reply with up to two named&lt;br /&gt;attendees from your organisation to alaricdavies at yahoo dot com. If you do not receive a confirmation mail&lt;br /&gt;from us, please don't just turn up since we will not be able to admit you to&lt;br /&gt;the meeting. Content from the meetings will continue to be uploaded to &lt;a class="jive-link-external" href="http://public.box.net/londonug"&gt;http://public.box.net/londonug&lt;/a&gt;,&lt;br /&gt;NDA permitting.&lt;br /&gt;&lt;br /&gt;Sincerely, and with regards,&lt;br /&gt;&lt;br /&gt;The UKLVMUG Steering Committee&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-3106639207258899865?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/3106639207258899865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=3106639207258899865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3106639207258899865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3106639207258899865'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/uk-london-vmware-user-group-meeting.html' title='UK London VMware User Group Meeting, Tuesday 10th March 2009'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-8167314002183624460</id><published>2009-02-22T14:53:00.003Z</published><updated>2009-02-22T15:03:51.973Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>UK Powershell User Group Live Meeting - 7pm GMT on Thursday February 26th 2009</title><content type='html'>Don't forget &lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;7pm GMT on Thursday February 26th sees &lt;a href="http://twitter.com/PS_Rolf"&gt;Rolf Masuch&lt;/a&gt; presenting a Live Meeting to the UK PowerShell User group.  Rolf runs the German PowerShell User Group. &lt;/span&gt;&lt;p&gt; &lt;/p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Session abstract: &lt;/span&gt;&lt;p&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;PowerShell as Active Directory Login Script &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Loginscript, why? &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;The Script &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Draft in the form editor &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Start with PowerGUI Editor &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;The script skeleton &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;The script details &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Get in running &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Output of information &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Formatting of the information &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Putting the script on the server &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;The path on the domain controller &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Setting the users login script &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Running .ps1-files as login scripts &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Running loginscripts visible &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Possible errors&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;&lt;strong&gt;Live Meeting Details:&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;You are invited to attend an online meeting using Live Meeting.&lt;br /&gt;&lt;b&gt;&lt;a href="https://www.livemeeting.com/cc/usergroups/join?id=2C4W7Q&amp;amp;role=attend&amp;amp;pw=FbH%263S%5C%26C"&gt;Join the meeting.&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Audio Information&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Computer Audio&lt;/b&gt;&lt;br /&gt;To use computer audio, you need speakers and microphone, or a headset.&lt;br /&gt;&lt;b&gt;First Time Users:&lt;/b&gt;&lt;br /&gt;To save time before the meeting, &lt;/span&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=90703"&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;check your system &lt;/span&gt;&lt;/a&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;to make sure it is ready to use Microsoft Office Live Meeting.&lt;br /&gt;&lt;b&gt;Troubleshooting&lt;/b&gt;&lt;br /&gt;Unable to join the meeting? Follow these steps: &lt;/span&gt; &lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Copy this address and paste it into your web browser:&lt;br /&gt;https://www.livemeeting.com/cc/usergroups/join &lt;/span&gt; &lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;Copy and paste the required information:&lt;br /&gt;Meeting ID: 2C4W7Q&lt;br /&gt;Entry Code: FbH&amp;amp;3S\&amp;amp;C&lt;br /&gt;Location: https://www.livemeeting.com/cc/usergroups &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;If you still cannot enter the meeting, &lt;/span&gt;&lt;a href="http://r.office.microsoft.com/r/rlidLiveMeeting?p1=12&amp;amp;p2=en_US&amp;amp;p3=LMInfo&amp;amp;p4=support"&gt;&lt;span style=";font-family:Times New Roman;font-size:100%;"  &gt;contact support&lt;/span&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;b&gt;Notice&lt;/b&gt;&lt;br /&gt;Microsoft Office Live Meeting can be used to record meetings. By participating in this meeting, you agree that your communications may be monitored or recorded at any time during the meeting. &lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-8167314002183624460?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/8167314002183624460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=8167314002183624460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8167314002183624460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8167314002183624460'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/uk-powershell-user-group-live-meeting.html' title='UK Powershell User Group Live Meeting - 7pm GMT on Thursday February 26th 2009'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-1785235021485621516</id><published>2009-02-21T12:34:00.002Z</published><updated>2009-02-21T12:37:57.416Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange 2003'/><category scheme='http://www.blogger.com/atom/ns#' term='wmi'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>Slides from MMMUG presentation</title><content type='html'>As promised to those who attended the &lt;a href="http://www.mmmug.co.uk/"&gt;MMMUG&lt;/a&gt; on Wednesday night my slides from that evening are available on my &lt;a href="http://cid-bad8363d570d175b.skydrive.live.com/browse.aspx/.Public"&gt;SkyDrive&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Enjoy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-1785235021485621516?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/1785235021485621516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=1785235021485621516' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/1785235021485621516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/1785235021485621516'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/slides-from-mmmug-presentation.html' title='Slides from MMMUG presentation'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-5922191946274703357</id><published>2009-02-15T21:53:00.002Z</published><updated>2009-02-15T22:12:25.775Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><title type='text'>The Noble Array?</title><content type='html'>At last week's UK Powershell Usergroup &lt;a href="http://jonoble.spaces.live.com/default.aspx"&gt;Jonathan Noble&lt;/a&gt; was showing us some Powershell examples and at one point demonstrated something similar to the below.&lt;br /&gt;&lt;br /&gt;Essentially you create an empty array, but then somewhat surprisingly (well to me anyway) you can select some elements even though they don't exist! You are then able to add to the array using the names you have selected.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;select-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;CPUUsage&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Owner&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ProcessID&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Name &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.name&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.ProcessID &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.IdProcess&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.CPUUsage &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Math&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;Round&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc_perct&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Owner &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$process&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetOwner().user&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$myCol&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My friend and colleague &lt;a href="http://teckinfo.blogspot.com/"&gt;Alan Renouf&lt;/a&gt; had given me the above example a week or so previously to use in a script. I was puzzled to how it worked since I hadn't seen it used in any of the Powershell books I have read or other sources I use and neither had he, so when I saw Jonathan using it I was curious to find out more.&lt;br /&gt;&lt;br /&gt;Jonathan explains in more detail how this works on his &lt;a href="http://jonoble.spaces.live.com/blog/cns%21CC73D8744F0894A5%21525.entry"&gt;blog&lt;/a&gt; in a posting he made last year.&lt;br /&gt;&lt;br /&gt;OK, it doesn't really matter if it wasn't him who come up with the original idea, but heh that's how I'm going to remember it. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-5922191946274703357?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/5922191946274703357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=5922191946274703357' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5922191946274703357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5922191946274703357'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/noble-array.html' title='The Noble Array?'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-4434170041612736482</id><published>2009-02-12T22:42:00.002Z</published><updated>2009-02-12T23:01:35.397Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='geek'/><title type='text'>Geek Rhyming Slang</title><content type='html'>This started (for me anyway) when my wife told people I was away at Geek Week, i.e. Teched EMEA and I had for a long time described my (or lack of as others might say) own fashion style as Geek Chic. Anyway after the legends of the &lt;a href="http://www.channel4.com/programmes/the-it-crowd"&gt;IT Crowd&lt;/a&gt; used my Geek Chic phrase (OK, I'm claiming it) multiple times during one of their recent shows I decided to try and find some more and here's the results. Special thanks to @Jaykul, @Poshoholic and @ebgreen for the contributions.&lt;br /&gt;&lt;br /&gt;Translations added for any non-Geek Speak(ers)&lt;br /&gt;&lt;br /&gt;Geek Week - an IT conference like Teched, VMworld&lt;br /&gt;&lt;br /&gt;Geek Chic - fashion style (or lack of, can be either) displayed by an IT pro&lt;br /&gt;&lt;br /&gt;Geek Speak - jargon filled conversation&lt;br /&gt;&lt;br /&gt;Geek Freak - a person who (pretends to be?) hot for geeks&lt;br /&gt;&lt;br /&gt;Geek Bleak - how geeks normally decorate&lt;br /&gt;&lt;br /&gt;Geek Cheek - when IT thinks management can't touch them&lt;br /&gt;&lt;br /&gt;Geek Antique - a TRS-80, Amiga, or C-64&lt;br /&gt;&lt;br /&gt;Geek Boutique - Fry's, Best Buy, Future Shop&lt;br /&gt;&lt;br /&gt;Geek Physique - Wii Sports/Fitness&lt;br /&gt;&lt;br /&gt;Geek Tweak - a bug fix&lt;br /&gt;&lt;br /&gt;Geek Shriek - the sound of a wedgie&lt;br /&gt;&lt;br /&gt;Geek Clique - a huddle of geeks&lt;br /&gt;&lt;br /&gt;Geek Peak'd - completing a IT project&lt;br /&gt;&lt;br /&gt;Geek Mystique - this aura surrounds you when you do "exactly what I did" for a coworker, but it works for you on the first try&lt;br /&gt;&lt;br /&gt;Geek Critique -  ripping each other apart bassed on minutiae and technycalities and misspellings&lt;br /&gt;&lt;br /&gt;Geek Oblique - our version of subtle -- when you have to explain the joke, in case people don't know what oblique means&lt;br /&gt;&lt;br /&gt;Geek Technique - This is how we (over) do it&lt;br /&gt;&lt;br /&gt;I'm on a Geek Streak........&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-4434170041612736482?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/4434170041612736482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=4434170041612736482' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4434170041612736482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4434170041612736482'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/geek-rhyming-slang.html' title='Geek Rhyming Slang'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-3343502657981195347</id><published>2009-02-02T21:32:00.002Z</published><updated>2009-02-02T21:48:07.203Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>Upcoming for the UK Powershell User Group</title><content type='html'>Coming up in February are two events for the UK Powershell User Group.&lt;br /&gt;&lt;br /&gt;1) Following the &lt;a href="http://technet.microsoft.com/en-gb/bb945096.aspx"&gt;Technet Event&lt;/a&gt;  Managing Windows Servers with Powershell V2 on Feb 10th at Microsoft London there will be a &lt;a href="http://richardsiddaway.spaces.live.com/blog/cns%2143CFA46A74CF3E96%212032.entry"&gt;Powershell UserGroup meeting&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;My good friend &lt;a href="http://jonoble.spaces.live.com/"&gt;Jonathan Noble&lt;/a&gt; will be travelling down all the way from the North of England to present for us about using Powershell to automate tasks in the large University environment he works in - well worth turning up for. Let &lt;a href="http://richardsiddaway.spaces.live.com/blog/cns%2143CFA46A74CF3E96%212032.entry"&gt;Richard Siddaway know&lt;/a&gt; if you wish to attend.&lt;br /&gt;&lt;br /&gt;Sometime between the afternoon Technet Event and the evening User Group I shall be interviewing Jonathan for the &lt;a href="http://get-scripting.blogspot.com/"&gt;Get-Scripting Podcast&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2) February 26th Rolf Mausch, who runs the German Powershell User Group, will be presenting a live webcast for us about using Powershell in login scripts - an interesting topic since not a lot of people are doing that yet from what I have seen. &lt;a href="http://richardsiddaway.spaces.live.com/blog/cns%2143CFA46A74CF3E96%212032.entry"&gt;Early details here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-3343502657981195347?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/3343502657981195347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=3343502657981195347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3343502657981195347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3343502657981195347'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/upcoming-for-uk-powershell-user-group.html' title='Upcoming for the UK Powershell User Group'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-2478273990304330919</id><published>2009-02-02T21:13:00.003Z</published><updated>2009-02-02T21:29:07.389Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows server 2003'/><category scheme='http://www.blogger.com/atom/ns#' term='password policy'/><title type='text'>Windows 2003 Password Policy - Complexity Requirements Message</title><content type='html'>Doing a lot of investigation into password policies available in Windows Server 2003 and 2008 at the minute, plus some of the third-party solutions available around this area.&lt;br /&gt;&lt;br /&gt;One of the reasons I've never myself recommend using the 'Complexity On' feature in Windows Server is the sheer difficulty in trying to explain to users that you need to use characters from at least three of the following four groups:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Uppercase&lt;/li&gt;&lt;li&gt;Lowercase&lt;/li&gt;&lt;li&gt;Digits&lt;/li&gt;&lt;li&gt;Special Characters&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;They typically switch off as soon as you get to the ...at least three.... part of the above sentence and to be honest I don't really blame them.&lt;br /&gt;&lt;br /&gt;Even if you do head down this solution (good luck to you!) the message a user gets back when they fail to change their password successfully is fairly generic and does not even mention the fact that complexity is in use.&lt;br /&gt;&lt;br /&gt;However, today I was made aware of a &lt;a href="http://support.microsoft.com/kb/821425"&gt;hotfix for Windows 2003&lt;/a&gt; (and associated clients) where the user will now see mention of complexity requirements in the message they receive back. Since I've never heard or seen anyone else using this before I thought it was worth mentioning since it might make your deployment a bit smoother.&lt;br /&gt;&lt;br /&gt;I've yet to test this out myself, but I guess you gotta trust the KB article ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-2478273990304330919?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/2478273990304330919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=2478273990304330919' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/2478273990304330919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/2478273990304330919'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/02/windows-2003-password-policy-complexity.html' title='Windows 2003 Password Policy - Complexity Requirements Message'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-2284909669377665232</id><published>2009-01-28T22:25:00.002Z</published><updated>2009-01-28T22:42:08.380Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange 2003'/><title type='text'>Using Powershell to Find Free Space in Exchange 2003 databases</title><content type='html'>One regular task for Exchange admins can be reclaiming free space within Exchange mailbox stores either after a large amount of data has been removed or just a significant amount has built up over time for various reasons. For those of you who don't know, to reclaim the space the mailbox store has to be taken offline and the database defragged to get the space back on the disk.&lt;br /&gt;&lt;br /&gt;Finding good candidates for defragging especially in a large environment with multiple databases and Exchange servers can be a pretty tedious task. Exchange records an entry in the Application Event Log (Event ID 1221) after online maintenance has taken place which tells you how much free space is in the database - this means trawling through the event logs on each server and recording which databases you think are worth defragging. So naturally I wrote a Powershell script to save wasting time on this task!&lt;br /&gt;&lt;br /&gt;Using WMI the script queries the Application log on each of the Exchange servers you choose, looking for 1221 events in the last day. It sucks out the name of the mailbox store and the amount of free space in the database from the message field of the event and if the free space is greater than a particular figure (in the example below 3GB) adds the info to a csv file.&lt;br /&gt;&lt;br /&gt;You could obviously change the figure to meet your needs and also if you remove the if statement you could get it to report on every database so you have a report of free space across all databases.&lt;br /&gt;&lt;br /&gt;Tip: If you have clustered mailbox servers then you only need to point the script at one of the servers in the cluster since it will contain all of the event log entries for each server in the cluster.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Check to see if csv exists and if so remove it&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;If&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Test-Path&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;FreeSpaceGreaterThan1GB.csv&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Remove-Item&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;FreeSpaceGreaterThan1GB.csv&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Else&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Set the columns for the csv file&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$rows&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Servername,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Mailbox Store,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Free Space (MB),&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Add-Content&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;FreeSpaceGreaterThan1GB.csv&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$rows&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$ExchServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;server1&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;server2&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$Server&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$ExchServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;  &lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Get the time 1 day ago in the right format for WMI query&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$WmidtQueryDT&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;System.Management.ManagementDateTimeConverter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;ToDmtfDateTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;([&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;DateTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;Now&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;AddDays&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(-&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;))&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Perform WMI query of Event 1221 in Application log in the last day&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$1221&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-WmiObject&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -computer &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$ExchServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-query&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Select * from Win32_NTLogEvent Where Logfile='Application' and Eventcode = '1221' and TimeWritten &amp;gt;='&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$WmidtQueryDT&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;   &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$1221&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Get the name of the Mailbox Store&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBXStoreLocationStart&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Message.IndexOf(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storage Group&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;16&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBXStoreLocationFinish&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Message.IndexOf(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;has&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBXStoreLocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Message.SubString(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBXStoreLocationStart&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBXStoreLocationFinish&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBXStoreLocationStart&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Get the free space figure and convert it to an integer&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBLocationStart&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Message.IndexOf(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;has&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;4&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBLocationFinish&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Message.IndexOf(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;megabytes&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBLocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Message.SubString(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBLocationStart&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBLocationFinish&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBLocationStart&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$result&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;int&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MBLocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$ComputerName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$event&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.ComputerName&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;If free space &amp;gt; 3GB, add the details to the csv file&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$result&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-ge&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;3072&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$rowline&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;$ComputerName,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;$MBXStoreLocation,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;$MBLocation,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Add-Content&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;FreeSpaceGreaterThan1GB.csv&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$rowline&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;       }&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;       {&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-2284909669377665232?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/2284909669377665232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=2284909669377665232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/2284909669377665232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/2284909669377665232'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/using-powershell-to-find-free-space-in.html' title='Using Powershell to Find Free Space in Exchange 2003 databases'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-596476995924243801</id><published>2009-01-25T21:36:00.010Z</published><updated>2009-03-16T13:28:23.257Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>Using Powershell to Monitor VMware Guests -  on a Budget...</title><content type='html'>...i.e. a budget of £0.&lt;br /&gt;&lt;br /&gt;(Update 28/01/09  - FYI..got some feedback about this post and the reason we are not using the built in alerts in the VI client is because the CPU alerts in this case were not granular enough for us.)&lt;br /&gt;&lt;br /&gt;So this all stemmed from trying to track down which process was causing particular servers' CPU to hit 100% for a period. So first of all my colleague and Get-Scripting co-host &lt;a href="http://teckinfo.blogspot.com/"&gt;Alan Renouf&lt;/a&gt; traded a script back and forth which ended up as the CheckHighCPU function - it is now pretty cool and comes back with a list of processes sorted by how much CPU they are using and very importantly for our circumstance who is the owner of each process.&lt;br /&gt;&lt;br /&gt;The servers in question all belong to a particular cluster in ESX. Rather than constantly having to monitor the console, wait for a VM to turn red and then run the script to track down the process we decided to try and monitor them with a Powershell script, kick off the CheckHighCPU function when a server's CPU hit 100% for a significant enough period and email a warning through with the process details - and so the below script was born.&lt;br /&gt;&lt;br /&gt;OK, its not Operations Manager and to be honest its not really production quality, but it does the job we need it to.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://blogs.vmware.com/vipowershell/"&gt;VI Toolkit&lt;/a&gt; from VMware is a great set of cmdlets you can plug into your Powershell console to manage your VMware environment. You can use the Get-Cluster and Get-VM cmdlets to return a list of all the VM's in that cluster as objects. You can then use the very handy Get-Stat cmdlet to retrieve performance data for each VM.&lt;br /&gt;&lt;br /&gt;In this case we check the cpu.usage.average statistic of a period of the last few minutes (watch out for the -IntervalMins parameter it can produce a period slightly different to what you would expect) and if its over 99% run the CheckHighCPU function and send the results by email.&lt;br /&gt;&lt;br /&gt;We then make the script sleep for a short time period so that we are not constantly bombarded with alerts if a warning is triggered.&lt;br /&gt;&lt;br /&gt;Obviously if we wanted to make it production quality we would add in some error checking and testing to see if an alert had recently been sent, but for the time being its doing a great job for the requirements that exist.&lt;br /&gt;&lt;br /&gt;You could obviously re-use the below to monitor for different statistics offered by Get-Stat like disk or memory.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Function&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;EmailWarning&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ()&lt;br /&gt;{&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;param&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$ServerName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$Attachment&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;#&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Email warning&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Write-Output&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Creating E-Mail Structure&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$smtpServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;servername&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msg&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;new-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Net.Mail.MailMessage&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$att&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;new-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Net.Mail.Attachment&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$attachment&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$smtp&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;new-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Net.Mail.SmtpClient&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$smtpServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msg&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.From &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;sender&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msg&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.To.Add(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;recipient&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msg&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Subject &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Server Warning - High CPU on $Servername&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msg&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Body &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;$Servername has a CPU value of $HighCPU %&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msg&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Attachments.Add(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$att&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Write-Output&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Send E-Mail&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$smtp&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Send(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msg&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$att&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Dispose();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Function&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;CheckHighCPU&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ()&lt;br /&gt;{&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;param&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$Target&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$procs_total&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-WmiObject&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-Class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Win32_PerfRawData_PerfProc_Process&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-Filter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;name="_total"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-ComputerName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$Target&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$procs&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-WmiObject&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-Class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Win32_PerfRawData_PerfProc_Process&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-Filter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;name&amp;lt;&amp;gt;"_total"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-ComputerName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$Target&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;int64&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$totalpercentuser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$procs_total&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;{&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$totalpercentuser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$totalpercentuser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.PercentUserTime}&lt;br /&gt;&lt;br /&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;decimal&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;] &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$perc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;System.Convert&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;ToDecimal&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$totalpercentuser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$myCol&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; @()&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$procs&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc_perct&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ((&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.PercentUserTime &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;/&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$perc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;100&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc_perct&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-gt&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$Process&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-WmiObject&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;win32_process&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-ComputerName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$target&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;where&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$_&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.ProcessID &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-eq&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.IDProcess}&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;select-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;CPUUsage&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Owner&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ProcessID&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Name &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.name&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.ProcessID &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.IdProcess&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.CPUUsage &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;Math&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;Round&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$proc_perct&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Owner &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$process&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetOwner().user&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$myCol&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$MYInfo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$myCol&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Sort-Object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;CPUUsage&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-Descending&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Out-File&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$file&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160);"&gt;EmailWarning&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$VMname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$file&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Connect-VIServer &lt;span style="font-style: italic;"&gt;servername&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$vms&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-Cluster&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="font-style: italic;"&gt;clustername&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;get-vm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$time&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-Date&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;do&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$vm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$vms&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$VMname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$vm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.name&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$filename&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$VMname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;.txt&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$file&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;C:\Scripts\$filename&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$stats&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-Stat&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-entity&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$vm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-IntervalMins&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-stat&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;cpu.usage.average&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-MaxSamples&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;write-host&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$VMname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$stats&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$stats&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.value &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-ge&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;99&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$HighCPU&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$stats&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.value&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Write-Host&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Warning!&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-ForegroundColor&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;red&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;CheckHighCPU &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$VMname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Start-Sleep&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-Seconds&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;30&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;until&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$time&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.hour &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-ge&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;17&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-596476995924243801?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/596476995924243801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=596476995924243801' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/596476995924243801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/596476995924243801'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/using-powershell-to-monitor-vmware.html' title='Using Powershell to Monitor VMware Guests -  on a Budget...'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-7304394567852716992</id><published>2009-01-25T21:28:00.002Z</published><updated>2009-01-25T21:33:31.751Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange 2003'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>Presenting at MM&amp;M User Group UK - Wednesday 18th February</title><content type='html'>So I was lucky enough to receive an invite from Nathan Winters who runs the MM&amp;amp;M User Group UK (aka Exchange) to present at their next meeting on Wednesday 18th February at Microsoft in London.&lt;br /&gt;&lt;br /&gt;It will be an evening around using Powershell to manage Exchange, the agenda is as below:&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal"&gt;&lt;span&gt;18:15 - 18:40            Arrival&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;18:40 - 18:45            Introduction to speakers and the aims of the group&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;18:45 - 19:30            1st session; Jonathan Medd, Introduction to PowerShell and Using PowerShell to manage Exchange 2003!&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;19:30 - 19:50            Food!&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;19:50 - 20:45            2&lt;sup&gt;nd&lt;/sup&gt; session; Will Rawlings, Causing no harm with PowerShell, and using PowerShell on a large Exchange environment&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span&gt;20:45 - 21:00            Summing up and suggestions for future meetings.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt; &lt;span&gt;21:00                        The End!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you want to attend you can sign up here &lt;a href="http://www.mmmug.co.uk/forums/thread/26352.aspx"&gt;http://www.mmmug.co.uk/forums/thread/26352.aspx &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-7304394567852716992?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/7304394567852716992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=7304394567852716992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7304394567852716992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7304394567852716992'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/presenting-at-mm-user-group-uk.html' title='Presenting at MM&amp;M User Group UK - Wednesday 18th February'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-8763966756785885006</id><published>2009-01-13T21:26:00.002Z</published><updated>2009-01-13T22:22:54.621Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>UK Powershell User Group  - January Meeting</title><content type='html'>The January meeting of the UK &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Powershell&lt;/span&gt; User Group takes place Wednesday 21st Jan 2009 6.30pm GMT.&lt;br /&gt;&lt;br /&gt;&lt;span id="ctl00_MainContentPlaceholder_ctl01_ctl00_lblEntry"&gt;&lt;p&gt;Memphis Room&lt;/p&gt;&lt;p&gt;Building 3 &lt;/p&gt;&lt;p&gt;Microsoft Campus &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;TVP&lt;/span&gt; &lt;/p&gt;&lt;p&gt;Reading  UK &lt;/p&gt;&lt;p&gt;We have a Live Meeting with Jeffrey &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Snover&lt;/span&gt; talking about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;PowerShell&lt;/span&gt; v2 &lt;/p&gt;&lt;p&gt;Pizza break &lt;/p&gt;&lt;p&gt;Then Jeremy Pack from HP will then be doing a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;PowerShell&lt;/span&gt; demo - exact topic to be confirmed&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;It should be a great evening. Jeffrey is obviously the man to ask if you have any burning questions about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;Powershell&lt;/span&gt;, particularly V2 for this event. Jeremy is a long time member of the user group and is incredibly knowledgeable about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;Powershell&lt;/span&gt; so I'm really looking forward to seeing what he is going to talk about.&lt;br /&gt;&lt;br /&gt;If you want to turn up please contact Richard Siddaway at the below website, you can also find details of the webcast if you wish to watch from afar.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://richardsiddaway.spaces.live.com/blog/cns%2143CFA46A74CF3E96%211987.entry"&gt;http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!1987.entry&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-8763966756785885006?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/8763966756785885006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=8763966756785885006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8763966756785885006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8763966756785885006'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/uk-powershell-user-group-january.html' title='UK Powershell User Group  - January Meeting'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-8055969435193791774</id><published>2009-01-11T16:37:00.002Z</published><updated>2009-01-11T22:13:26.299Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='active directory'/><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange 2003'/><title type='text'>Modifying AD accounts with Powershell after an Exchange 2003 dial-tone restore</title><content type='html'>&lt;span style="font-family:arial;"&gt;Recently I've been testing out some different disaster recovery scenarios for Exchange 2003, one of which involved a &lt;/span&gt;&lt;a style="font-family: arial;" href="http://www.msexchange.org/tutorials/Exchange-Dial-tone-Restore-Method-Part1.html"&gt;dial-tone method&lt;/a&gt;&lt;span style="font-family:arial;"&gt; - i.e. create some new mailbox servers with blank databases to get users up and running quickly and then merge the restored data back in later. One of the types of dial tone method we used was to create new server names rather than re-use existing Exchange server names.&lt;br /&gt;&lt;br /&gt;So for example to re-create a four node (3 active, 1 passive) cluster with new names, instead of&lt;br /&gt;&lt;br /&gt;ExchangeServer1&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Exchange&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Server2&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Exchange&lt;/span&gt;&lt;span style="font-family:arial;"&gt;Server3&lt;br /&gt;&lt;br /&gt;you would now use something like&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ExchangeServer1New&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ExchangeServer2New&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;ExchangeServer3New&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then you would need to amend the AD user accounts for users on those Exchange Servers to point to the new locations - the following properties need to be changed.&lt;br /&gt;&lt;br /&gt;homemdb&lt;br /&gt;msexchhomeservername&lt;br /&gt;homemta&lt;br /&gt;&lt;br /&gt;None of these properties can be changed through ADUC, you would need to use ADSIEdit if you wanted to use a GUI. Of course those smart people among you would choose to user Powershell anyway.&lt;br /&gt;&lt;br /&gt;So naturally I turned to my trusty friend the &lt;a href="http://www.quest.com/activeroles-server/arms.aspx"&gt;Quest AD cmdlets&lt;/a&gt; to help me out.&lt;br /&gt;&lt;br /&gt;First of all we get all the users who have a mailbox based on one of the original servers; depending on your naming convention you may need to adjust this filter to make sure you are matching the correct people. The three properties mentioned are not returned by default from Get-QADUser so we have to specify them.&lt;br /&gt;&lt;br /&gt;We then loop through each user and using the Switch statement if we match ExchangeServer1, 2 or 3 we amend the text of each variable to be the new Exchange servername (note: homemta will be the same for all of these users) and then user the Set-QADUser cmdlet to change these properties on the account.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$users&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-ldapFilter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;(msExchHomeServerName=*ExchangeServer*)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-IncludedProperties&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;homemdb&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;homemta&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-sizelimit&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$users&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;){&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$homemdb&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.homemdb&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.msexchhomeservername&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemta&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;CN=Microsoft MTA,CN=ExchangeServer1New,CN=Servers,CN=Exchange,CN=Administrative Groups,CN=Springfield,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=springfield,DC=local&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;switch&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; -wildcard (&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$homemdb&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;*ExchangeServer1*&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemdblocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$homemdb&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.replace(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer1&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer1New&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;); &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newmsexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.replace(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer1&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer1New&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);  &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Set-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-objectAttributes&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; @{homemdb&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemdblocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newmsexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;homemta&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemta&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;break&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;*ExchangeServer2*&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemdblocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$homemdb&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.replace(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer2&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer2New&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;); &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newmsexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.replace(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer2&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer2New&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);  &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Set-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-objectAttributes&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; @{homemdb&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemdblocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newmsexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;homemta&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemta&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;break&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;*ExchangeServer3*&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemdblocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$homemdb&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.replace(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer3&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer3New&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;); &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newmsexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.replace(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer3&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ExchangeServer3New&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);  &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Set-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-objectAttributes&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; @{homemdb&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemdblocation&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;msexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newmsexchhomeservername&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;homemta&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$newhomemta&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;break&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;default&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Nothing for this user&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;I was also interested to see the resulting performance of this script and was pleasantly surprised to see it change 6000+ accounts in only 10 mins.&lt;br /&gt;&lt;br /&gt;A sidenote to this method is that you won't actually see the mailboxes appear in Exchange System Manager until either they receive an email or a user logs on to them. To prove that this method had worked I created a quick Distribution Group, used the below one-liner to populate it with all of the above users and then sent an email to this group.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-ldapFilter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;(msExchHomeServerName=*ExchangeServer*)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-sizelimit&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Add-QADGroupMember&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;TestGroup&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;There are of course many different ways to carry out Exchange DR, but this proved a useful exercise.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-8055969435193791774?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/8055969435193791774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=8055969435193791774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8055969435193791774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8055969435193791774'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/modifying-ad-accounts-with-powershell.html' title='Modifying AD accounts with Powershell after an Exchange 2003 dial-tone restore'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-7101355015214079211</id><published>2009-01-06T22:21:00.004Z</published><updated>2009-01-06T23:16:27.108Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='active directory'/><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><title type='text'>Powershell Active Directory One-Liners</title><content type='html'>Recently I&lt;a href="http://jonathanmedd.blogspot.com/2008/12/take-your-own-advice-jonathan.html"&gt; blogged about some scripts&lt;/a&gt; I left behind in my previous employment for managing AD - really a lot of them were just quick one liners. Not that that is necessarily a bad thing, one of the best things for me about Powershell is the way you can get great information with very little effort. Of course I am using my good friend the &lt;a href="http://www.quest.com/activeroles-server/arms.aspx"&gt;Quest AD cmdlets&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I thought I'd share a few of them:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Find Expired Users:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On the theme of cleaning out AD, find user accounts which have expired.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-searchroot&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;domain&lt;/span&gt;.local/resources/users&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-SizeLimit&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-ldapFilter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;(pwdlastset=0)&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;ft&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;passwordlastset&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Find Users Not Logged in Since X Days:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;On the same theme, supply X 'how many days to go back' and find users who haven't logged in during that time. (OK I cheated on the one line a bit on this one)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$now&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;get-date&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$daysSinceLastLogon&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; X; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-sizeLimit&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-SearchRoot&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;domain&lt;/span&gt;.local/resources&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;/users&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  | &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;where&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$_&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.lastlogontimestamp.value &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-and&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; ((&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$now&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-&lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$_&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.lastlogontimestamp.value).days &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;-gt&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$daysSinceLastLogon&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)} | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;ft&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;lastlogontimestamp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: X needs to be more than 14 days to allow for the lastlogontimestamp attribute to have replicated.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Find Users Whose Password is set to Not Expire:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Keep tabs on those naughty administrators who think they can exempt themselves from the corporate password policy - you know who you are!&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #5F9EA0; font-weight: bold;"&gt;Get-QADUser&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #5F9EA0; font-style: italic;"&gt;-Sizelimit&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #000000;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #5F9EA0; font-style: italic;"&gt;-SearchRoot&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #800000;"&gt;domain.local/resources/users&lt;/span&gt;&lt;span style="color: #800000;"&gt;'&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #5F9EA0; font-style: italic;"&gt;-PasswordNeverExpires&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;$True&lt;/span&gt;&lt;span style="color: #000000;"&gt; | &lt;/span&gt;&lt;span style="color: #5F9EA0; font-weight: bold;"&gt;ft&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;name&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;How Many Users in Active Directory?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Need to keep track on an expanding user population? Need to figure out how many CAL's you need? Easy.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Get-QADUser&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-DontUseDefaultIncludedProperties&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-SearchRoot&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;domain&lt;/span&gt;.local/resources&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;/users&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;'&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-style: italic;"&gt;-SizeLimit&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Measure-Object&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-7101355015214079211?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/7101355015214079211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=7101355015214079211' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7101355015214079211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7101355015214079211'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/powershell-active-directory-one-liners.html' title='Powershell Active Directory One-Liners'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-1940930860217572328</id><published>2009-01-05T22:31:00.005Z</published><updated>2009-01-05T22:41:41.869Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='powergui'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange 2003'/><title type='text'>PowerGUI webcast  - Exchange 2003 Powerpack demo</title><content type='html'>I was recently invited to record a &lt;a href="http://www.powergui.org/documentation.jspa"&gt;webcast&lt;/a&gt; by the Product Manager at Quest for PowerGUI, Darin Pendergraft, demoing the &lt;a href="http://www.powergui.org/entry.jspa?externalID=1956&amp;amp;categoryID=47"&gt;Exchange 2003 Powerpack&lt;/a&gt; I made for PowerGUI.&lt;br /&gt;&lt;br /&gt;They came up with the idea to make some videos  / webcasts giving some community members the opportunity to show what PowerGUI can do. A lot of people primarily use it only as a script editor, but the management console side of things is brilliant once you get into it - hopefully these examples will help inspire more people to make some powerpacks.&lt;br /&gt;&lt;br /&gt;I had a lot of fun recording the interview, it was funny to be on the other end of the questions for once, normally I'm asking them for the &lt;a href="http://get-scripting.blogspot.com"&gt;Get-Scripting podcast&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It runs for about 15 - 20 mins, I hope you enjoy &lt;a href="http://www.powergui.org/documentation.jspa"&gt;it&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-1940930860217572328?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/1940930860217572328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=1940930860217572328' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/1940930860217572328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/1940930860217572328'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/powergui-webcast-exchange-2003.html' title='PowerGUI webcast  - Exchange 2003 Powerpack demo'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-5239604126954984944</id><published>2009-01-05T21:42:00.002Z</published><updated>2009-01-05T21:56:35.651Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='podcast'/><title type='text'>Get-Scripting Podcast Episode 6</title><content type='html'>So we got &lt;a href="http://get-scripting.blogspot.com/2008/12/get-scripting-podcast-episode-6-ben.html"&gt;Episode 6&lt;/a&gt; of the Get-Scripting Podcast out last week. You can get it from here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://media.libsyn.com/media/getscripting/Get-ScriptingEpisode6.mp3"&gt;Download it here&lt;/a&gt;, subscribe in &lt;a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=286899256"&gt;iTunes&lt;/a&gt; or via a different &lt;a href="http://feeds.feedburner.com/Get-scripting"&gt;feed reader&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Normally Alan, Matt and I all arrange to be in the same place to record the show. Given we live in completely different places in the UK this is not easy and is probably the main reason we keep it to one show per month. We could do a Skype type thing, but we prefer to keep it a face-to-face recording. Now though that I work in the same office as Alan this time we took the opportunity to record the show during a lunchtime and I got Matt to post-edit the result when meeting for family time over Christmas.&lt;br /&gt;&lt;br /&gt;End result: I think the show was a bit more relaxed because we just let the tape roll and edited afterwards rather than stopping and starting when normally we sometimes re-record bits; logistically much easier; still took about the same time to edit.&lt;br /&gt;&lt;br /&gt;The interview with Ben Pearce which I had recorded a few weeks earlier was an absolute blast. Ben is such a fun guy to be around and made for a real easy interview because he doesn't stop talking; I think we got some great tips from him for Powershell beginners too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-5239604126954984944?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/5239604126954984944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=5239604126954984944' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5239604126954984944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5239604126954984944'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2009/01/get-scripting-podcast-episode-6.html' title='Get-Scripting Podcast Episode 6'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-5413558473106036228</id><published>2008-12-20T12:41:00.002Z</published><updated>2008-12-20T13:02:39.411Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>Powershellers on Twitter</title><content type='html'>So I was pretty sceptical for a long while about things like &lt;a href="http://twitter.com/jonathanmedd"&gt;Twitter&lt;/a&gt; and Facebook, but I finally gave in mostly thanks to my buddy &lt;a href="http://twitter.com/alanrenouf"&gt;Alan Renouf&lt;/a&gt; and to be honest its been brilliant. Its such a useful way to quickly find information and keep up to date with a particular topic, obviously in my case &lt;a href="http://search.twitter.com/search?q=powershell"&gt;Powershell&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Whilst at Teched it was a great tool to keep up with things which were going on in sessions or what people where up to. I also used it during a Powershell Q&amp;amp;A with Jeffrey Snover to invite fellow Twitterers to give me some questions for him.&lt;br /&gt;&lt;br /&gt;At the &lt;a href="https://twitter.com/getscripting"&gt;Get-Scripting podcast&lt;/a&gt; its a really useful tool for us to be able to put out info about the show, particularly when we release a new epsiode and conversley really handy to keep up to date with shows like the Powerscripting Podcast and &lt;a href="https://twitter.com/mindofroot"&gt;Mind of Root&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Steven Murawski from the Mind of Root podcast has helpfully posted a &lt;a href="http://www.mindofroot.com/powershell-twitterers/"&gt;list&lt;/a&gt; of Powershell people on Twitter who you can follow.&lt;br /&gt;&lt;br /&gt;Best news of all &lt;a href="https://twitter.com/jsnover"&gt;Jeffrey Snover&lt;/a&gt; has just started posting on Twitter! Now that is definitely a good person to follow for Powershell info. ;-)  There was lots of chat during the Powerscripting UStream the other night when Jeffrey and Bruce were on the show about how the chat that night was pretty similar to what goes on on Twitter, so I guess that's maybe we he signed up too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-5413558473106036228?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/5413558473106036228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=5413558473106036228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5413558473106036228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5413558473106036228'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/12/powershellers-on-twitter.html' title='Powershellers on Twitter'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-3660682403802380754</id><published>2008-12-17T22:50:00.003Z</published><updated>2008-12-17T23:06:47.482Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='podcast'/><title type='text'>PowerScripting Live CTP3 Special - Thursday 18th Dec</title><content type='html'>This is a must watch PowerScripting Podcast &lt;a href="http://powerscripting.wordpress.com/2008/12/15/big-show-coming-this-thursday/"&gt;special&lt;/a&gt; - the hint is in the title.&lt;br /&gt;&lt;br /&gt;Jeffrey Snover and Bruce Payette are the two guests, it should be an awesome show.&lt;br /&gt;&lt;br /&gt;Thursday 18th Dec 9pm EST, which translates to 2am UK time. I think I'm going to have to stay up for it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-3660682403802380754?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/3660682403802380754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=3660682403802380754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3660682403802380754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3660682403802380754'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/12/powerscripting-live-ctp3-special.html' title='PowerScripting Live CTP3 Special - Thursday 18th Dec'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-7669409445382296198</id><published>2008-12-11T23:25:00.003Z</published><updated>2008-12-12T00:13:26.881Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='powergui'/><title type='text'>Take your own advice Jonathan!</title><content type='html'>During this last year I've done quite a few presentations about Powershell and quite often as part of the demo I have included PowerGUI since I find it a great way to reel people in who aren't quite yet ready to make a jump the whole way to command line scripting.&lt;br /&gt;&lt;br /&gt;One of the topics I usually talk about around this is how I (like most people seem to) initially used the PowerGUI script editor for writing my scripts, but didn't really get what the PowerGUI console was all about. I couldn't quite get my head around why you would want a&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;GUI console&lt;/span&gt; for a &lt;span style="font-weight: bold;"&gt;command shell&lt;/span&gt; to manage a &lt;span style="font-weight: bold;"&gt;GUI &lt;/span&gt;OS or product,&lt;br /&gt;&lt;br /&gt;it didn't seem to make much sense to me.&lt;br /&gt;&lt;br /&gt;Luckily, we were very fortunate back in May to head over to Quest in the UK with the Powershell User Group for an evening's event. I decided I'd better figure out what the PowerGUI console was for before attending so watched some of the &lt;a href="http://www.powergui.org/documentation.jspa"&gt;videos on the PowerGUI&lt;/a&gt; site to give myself a better idea.&lt;br /&gt;&lt;br /&gt;Doing that and seeing Dmitry's presentation in the night made things finally click. You could use it to make custom management consoles for your own use or even better to give to a colleague or share with the community. That's where the idea for the &lt;a href="http://www.powergui.org/entry.jspa?externalID=1956&amp;amp;categoryID=47"&gt;Exchange 2003 PowerPack&lt;/a&gt; was born and the &lt;a href="http://get-scripting.blogspot.com/"&gt;Get-Scripting podcast&lt;/a&gt; was born almost by accident that night too, but those are stories for another day. :-)&lt;br /&gt;&lt;br /&gt;Anyway, back to the presenting. I often show PowerGUI and explain how you can use it to make custom management consoles to give to colleagues.&lt;br /&gt;&lt;br /&gt;Recently I have been working out my notice period before heading to a new job and one of the things I have done during that time is create a bunch of scripts for the regular admin tasks I or others carry out (particularly with AD) which I never got round to writing for myself or them and to save whoever took on my role or parts of it a load of hassle.&lt;br /&gt;&lt;br /&gt;For instance I finally got around to creating a script for de-provisioning users which should really help to improve the previous process which was in place. It was based on my good friend &lt;a href="http://jonoble.spaces.live.com/blog/cns%21CC73D8744F0894A5%21643.entry?sa=683735828"&gt;Jonathan Noble's blog post&lt;/a&gt; about setting logon hours for an account rather than disabling it so that the email doesn't bounce. Thanks Jon!&lt;br /&gt;&lt;br /&gt;Of course some of these scripts were to be handed over to the helpdesk. Now without being patronising (because we have some very smart people on our helpdesk) it can be quite a jump for a helpdesk person to read through all the documentation I wrote for each script and start running those scripts from the command shell and seeing their results in a blue on black window.&lt;br /&gt;&lt;br /&gt;So the cogs started whirring away in the old brain whilst I tried to think of a better way I could deliver these scripts for the helpdesk so they could get up and running with them much quicker and easier without having to read through all the boring documentation first and have a better experience when running them, i.e. don't put them off using the scripts once I'm not there anymore to help them.&lt;br /&gt;&lt;br /&gt;Finally it clicked. Why didn't I take my own advice I'd been giving out all year about making management consoles for your colleagues and go and do it myself! So the AD Admin Powerpack was born, I packaged up my scripts into this PowerPack, installed PowerGUI for them and instantly the scripts were far more useable.&lt;br /&gt;&lt;br /&gt;No need to read all of my boring documentation beforehand since its pretty obvious what clicking on script nodes such as 'Find Expired AD users' or 'How many users in Active Directory?' will do.&lt;br /&gt;&lt;br /&gt;Effective, very simple solutions which save people time, make them more efficient and its makes me feel good to leave something useful like that behind for them to use. Thank you PowerGUI!&lt;br /&gt;&lt;br /&gt;Of course the girls on the helpdesk love the train icon so it was an even easier win with them.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tNsLdz3cM-0/SUGqhDhTQ5I/AAAAAAAAADY/-VjIEuLqVAg/s1600-h/PowerGUI.PNG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 172px; height: 119px;" src="http://3.bp.blogspot.com/_tNsLdz3cM-0/SUGqhDhTQ5I/AAAAAAAAADY/-VjIEuLqVAg/s400/PowerGUI.PNG" alt="" id="BLOGGER_PHOTO_ID_5278687723112317842" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-7669409445382296198?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/7669409445382296198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=7669409445382296198' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7669409445382296198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7669409445382296198'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/12/take-your-own-advice-jonathan.html' title='Take your own advice Jonathan!'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tNsLdz3cM-0/SUGqhDhTQ5I/AAAAAAAAADY/-VjIEuLqVAg/s72-c/PowerGUI.PNG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-4582518041800228480</id><published>2008-11-27T08:49:00.003Z</published><updated>2008-11-27T08:59:38.940Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='podcast'/><title type='text'>Get-Scripting Podcast Episode 5 - (Dmitry Sotnikov - Quest AD cmdlets and PowerGUI)</title><content type='html'>We had a lot of fun recording the &lt;a href="http://get-scripting.blogspot.com/2008/11/get-scripting-podcast-episode-5-dmitry.html"&gt;latest episode&lt;/a&gt; of the Get-Scripting podcast on Tuesday night. Its been great having &lt;a href="http://teckinfo.blogspot.com/"&gt;Alan&lt;/a&gt; join the show, gives the show a much more conversational feel plus I don't have to come up with all the content. :-)&lt;br /&gt;&lt;br /&gt;We had a really interesting interview in this episode with &lt;a href="http://dmitrysotnikov.wordpress.com/"&gt;Dmitry Sotnikov&lt;/a&gt; talking about the Quest AD cmdlets and PowerGUI - go check it &lt;a href="http://get-scripting.blogspot.com/2008/11/get-scripting-podcast-episode-5-dmitry.html"&gt;out&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Coming up on the next show in December we have an interview with &lt;a href="http://blogs.technet.com/benp"&gt;Ben Pearce&lt;/a&gt; from Microsoft. Ben is the guy who recently presented Powershell sessions with Jeffrey Snover at TechEd EMEA, does a lot of Powershell training and is great fun to interview.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-4582518041800228480?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/4582518041800228480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=4582518041800228480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4582518041800228480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4582518041800228480'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/get-scripting-podcast-episode-5-dmitry.html' title='Get-Scripting Podcast Episode 5 - (Dmitry Sotnikov - Quest AD cmdlets and PowerGUI)'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-9054516001338108933</id><published>2008-11-20T09:50:00.002Z</published><updated>2008-11-20T11:12:50.221Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='wsus'/><title type='text'>WSUS 3.0 Cleaning out redundant computers</title><content type='html'>Following on from my last post about &lt;a href="http://jonathanmedd.blogspot.com/2008/11/wsus-30-approving-multiple-updates-for.html"&gt;WSUS 3.0 and Powershell&lt;/a&gt; another thing which bugged me about the WSUS 3.0 GUI is the Cleanup Wizard. This is a really useful tool for keeping your WSUS deployment running efficiently.&lt;br /&gt;&lt;br /&gt;It includes the ability to clean out computers which haven't synched with the WSUS server for over 30 days - unfortunately 30 days is the default value which can't be changed in the GUI. Arrgh! I've wanted to run this tool for a long time, but 30 days is way too short and I wanted to be able to specify my own time frame, e.g. 200 days.&lt;br /&gt;&lt;br /&gt;Luckily I met &lt;a href="http://blogs.technet.com/wsus/default.aspx"&gt;Marc Shepard&lt;/a&gt; at Teched EMEA and during a Q&amp;amp;A session for WSUS I asked why it wasn't possible to change the 30 day value. This developed into a discussion along the lines that the WSUS team didn't wish to promote removing lots of computers from WSUS - I can't remember exactly why now, I think it was along the lines of preventing lots of computers which were actually still alive synching back into WSUS. (Apologies if this is not the correct reason)&lt;br /&gt;&lt;br /&gt;Anyway, even though we had a slight difference of opinion about this (I want to remove old computers so that the monthly patch compliance reports are more accurate), Marc kindly agreed to send me over a Powershell script which would run the cleanup computer part of the wizard under the caveat that this was not their recommended method for maintenance.&lt;br /&gt;&lt;br /&gt;So here it is, this version will give you a list of computers who have not synched over the specified number of days:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;reflection.assembly&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;LoadWithPartialName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Microsoft.UpdateServices.Administration&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;out-null&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$days&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;read-host&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Please enter the number of days since Last Sync you wish to query for&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$ts&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;new-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;TimeSpan&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$days&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); font-style: italic;"&gt;WSUSServername&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$false&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$computerScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;new-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Microsoft.UpdateServices.Administration.ComputerTargetScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$computerScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.ToLastSyncTime &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;DateTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;UtcNow&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;Subtract&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$ts&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetComputerTargets(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$computerScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;sort&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;fulldomainname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;ft&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;fulldomainname&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;lastsynctime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you wish to remove them then simply change the last line to:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetComputerTargets(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$computerScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;) | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;foreach-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$_&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Delete();}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have added both of these scripts and the ApproveMultipleUpdates scripts from the last post to the &lt;a href="http://powergui.org/entry.jspa?categoryID=21&amp;amp;externalID=2061"&gt;WSUS PowerGUI Powerpack&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Also keep an eye on the &lt;a href="http://www.microsoft.com/technet/scriptcenter/scripts/sus/server/default.mspx?mfr=true"&gt;WSUS section of the MS Script Center&lt;/a&gt; Marc is hoping to soon publish some more Powershell scripts for managing WSUS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-9054516001338108933?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/9054516001338108933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=9054516001338108933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/9054516001338108933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/9054516001338108933'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/wsus-30-cleaning-out-redundant.html' title='WSUS 3.0 Cleaning out redundant computers'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-2007019592948975865</id><published>2008-11-16T19:47:00.002Z</published><updated>2008-11-16T19:50:38.553Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>Reminder: UK Powershell User Group Thursday 20th Nov</title><content type='html'>Richard has confirmed details of the next &lt;a href="http://richardsiddaway.spaces.live.com/blog/cns%2143CFA46A74CF3E96%211872.entry"&gt;UK Powershell User Group Meeting&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Date: Thursday 20th November&lt;br /&gt;Time: 6.30 - 9.30pm&lt;br /&gt;Location: Memphis Room, Building 3, Microsoft Campus, Thames Valley Park, Reading&lt;br /&gt;&lt;br /&gt;Agenda:&lt;br /&gt;&lt;br /&gt;Powershell Introduction: Objects and get-member&lt;br /&gt;PowerGUI SQL Server Reporting Services powerpack&lt;br /&gt;Powershell in SQL Server 2008&lt;br /&gt;&lt;br /&gt;If you want to attend please send an email to powershell-uk@hotmail.co.uk so that you can have a badge waiting for you on arrival.&lt;br /&gt;&lt;br /&gt;These are always great events and are well worth attending for anyone with an interest in Powershell (or even SQL this time!). There'll be free pizza too. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-2007019592948975865?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/2007019592948975865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=2007019592948975865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/2007019592948975865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/2007019592948975865'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/reminder-uk-powershell-user-group.html' title='Reminder: UK Powershell User Group Thursday 20th Nov'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-5692664042299237130</id><published>2008-11-13T08:35:00.002Z</published><updated>2008-11-13T08:38:38.669Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='user group'/><title type='text'>PowerShell Virtual User Group Meeting #7</title><content type='html'>Tonight there is a meeting of the Powershell Virtual User Group. I haven't been able to make one of these before because of the time difference, but this one seems to have been scheduled a little earlier than before so hoping to make it.&lt;br /&gt;&lt;br /&gt;Time: November 13th, 2008 at 12PM EST (noon; New York time)&lt;br /&gt;&lt;br /&gt;Some really interesting looking content:&lt;br /&gt;&lt;br /&gt;*&lt;a href="http://www.mmmug.co.uk/"&gt;Nathan Winters (MVP)&lt;/a&gt;: "Exchange 2007 from PowerShell".  Nathan will show how PowerShell can be used with Exchange 2007.&lt;br /&gt;*&lt;a href="http://huddledmasses.org/"&gt;Joel (Jaykul) Bennett&lt;/a&gt;: "PoSh Tools for the Huddled Masses". Joel, a prominent PowerShell developer, is always full of surprises. This should be a "must attend" for everyone.&lt;br /&gt;*&lt;a href="http://www.idera.com/"&gt;Idera&lt;/a&gt; (vendor): Idera will demo their &lt;a href="http://www.idera.com/Products/PowerShell/"&gt;PowerShellPlus&lt;/a&gt; product.  PowerShellPlus is a editor with strong PowerShell support.&lt;br /&gt;&lt;br /&gt;Check it out here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://marcoshaw.blogspot.com/2008/10/windows-powershell-virtual-user-group.html"&gt;http://marcoshaw.blogspot.com/2008/10/windows-powershell-virtual-user-group.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-5692664042299237130?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/5692664042299237130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=5692664042299237130' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5692664042299237130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5692664042299237130'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/powershell-virtual-user-group-meeting-7.html' title='PowerShell Virtual User Group Meeting #7'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-6695766617483614918</id><published>2008-11-11T11:43:00.005Z</published><updated>2008-11-11T12:55:53.089Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><category scheme='http://www.blogger.com/atom/ns#' term='wsus'/><title type='text'>WSUS 3.0: Approving Multiple Updates for a Specific Computer with Powershell</title><content type='html'>One of the best uses I have found for Powershell is for plugging gaps in holes left by GUI admin tools which don't do everything that you want. Prior to Powershell you would typically have had to wait for the next service pack / full release / possibly ever before you had the functionality that you wanted.&lt;br /&gt;&lt;br /&gt;I had an example of this recently with the GUI tool for WSUS 3.0. Essentially I was kicking off a project where we were going to target a particular group of machines for patching and the first step was to run a report for specific machines and then approve the updates to what WSUS calls a ComputerTargetGroup.&lt;br /&gt;&lt;br /&gt;The problem with this is that although WSUS can provide you with a report which shows which updates are required for a specific machine, there is no way in the GUI that you can approve all of those updates in one go. Since it takes 5 clicks per approval, you only have to get into the 10's of updates before this goes beyond tedious.&lt;br /&gt;&lt;br /&gt;I knew there were some sample scripts for &lt;a href="http://www.microsoft.com/technet/scriptcenter/scripts/sus/default.mspx?mfr=true"&gt;WSUS and Powershell&lt;/a&gt; on the Script Center so I headed over there and checked out some of the scripts. (This initial investigation led to the creation of the &lt;a href="http://powergui.org/entry.jspa?externalID=2061&amp;amp;categoryID=21"&gt;PowerGUI Powerpack for WSUS&lt;/a&gt; - fairly basic, but it was great way to learn what sort of things would be available)&lt;br /&gt;&lt;br /&gt;So I then spent some time working on a script to approve multiple updates for a specific computer which is shown below. I'd love to say that I put this all togther myself, but really it is another illustration of how helpful people within the Powershell community are. &lt;a href="http://blogs.microsoft.co.il/blogs/scriptfanatic/"&gt;Shay Levi&lt;/a&gt; was incredibly helpful putting the initial work of this script together, we got most of the way there, but it got left at the point where I could retrieve as objects the list of updates required for the computer, but couldn't figure out how to approve them for a particular computer group.&lt;br /&gt;&lt;br /&gt;Fortunately at Teched I went to a couple of sessions on WSUS 3.0 run by Program Manager Marc Shepard who contributes to the &lt;a href="http://blogs.technet.com/wsus/default.aspx"&gt;WSUS team blog&lt;/a&gt;. I went to see Marc at the 'Ask The Experts' stand inbetween the two sessions he was running. He seemed genuinely pleased to find someone with a particular request for the product (I guess it's free so hey that must be a tricky product to be a Program Manager for ;-)  ), took on my unfinished Powershell script and started coding away.&lt;br /&gt;&lt;br /&gt;By the time I got to the next session Marc had a working script for me - there is no better recommendation for going to Teched than this!&lt;br /&gt;&lt;br /&gt;The script is below. Before running the ApproveMultipleUpdates script you need to establish three things:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;WSUS Server Name&lt;/li&gt;&lt;li&gt;Full DNS name of the computer you wish to query&lt;/li&gt;&lt;li&gt;The Computer Group Target ID for the group you wish to make the approval to. You can find this either by using the PowerGUI Powerback or the code below:&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;Get-ComputerTargetGroups.ps1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;reflection.assembly&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;LoadWithPartialName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Microsoft.UpdateServices.Administration&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;WSUSServername&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$false&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetComputerTargetGroups()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;ApproveMultipleUpdates.ps1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;void&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;reflection.assembly&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]::&lt;/span&gt;&lt;span style="color: rgb(139, 69, 19);"&gt;LoadWithPartialName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Microsoft.UpdateServices.Administration&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;WSUSServername&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$machineName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Read-Host&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Please enter the full DNS name of the computer you wish to approve updates for&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateServer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$false&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;new-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Microsoft.UpdateServices.Administration.UpdateScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.includedInstallationStates &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;NotInstalled&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$com&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetComputerTargetByName(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$machineName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$groupid&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;Read-Host&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Please enter the Computer Group Target ID&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$group&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetComputerTargetGroup(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$groupid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$action&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [Microsoft.UpdateServices.Administration.UpdateApprovalAction]::Install&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updates&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$com&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetUpdateInstallationInfoPerUpdate(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updateScope&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$updates&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; | &lt;/span&gt;&lt;span style="color: rgb(95, 158, 160); font-weight: bold;"&gt;foreach-object&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; {&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$uid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 128);"&gt;$_&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.UpdateId; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$u&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$wsus&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.GetUpdate(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$uid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;); &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$u&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Title; &lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$u&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.Approve(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$action&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;$group&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;);}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is going to save us hours of work - big thanks to the guys who helped me out!&lt;br /&gt;&lt;br /&gt;(I think a version of this script should be making its way onto the MS Script Center at some point too)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-6695766617483614918?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/6695766617483614918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=6695766617483614918' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/6695766617483614918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/6695766617483614918'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/wsus-30-approving-multiple-updates-for.html' title='WSUS 3.0: Approving Multiple Updates for a Specific Computer with Powershell'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-5554160053424766362</id><published>2008-11-10T22:47:00.003Z</published><updated>2008-11-10T22:52:48.911Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Video of Teched Powershell Panel Discussion</title><content type='html'>Just got notification through of the various video available for Powershell Panel Discussion for the Teched Online website:&lt;br /&gt;&lt;br /&gt;Download (High res - approx 900MB): &lt;a href="http://microsofttech.fr.edgesuite.net/TechEdOnline/Videos/406_high.wmv"&gt;http://microsofttech.fr.edgesuite.net/TechEdOnline/Videos/406_high.wmv&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Or if you prefer not to crack your monitor / TV screen&lt;br /&gt;&lt;br /&gt;Download (Low res): &lt;a href="http://microsofttech.fr.edgesuite.net/TechEdOnline/Videos/406_low.wmv"&gt;http://microsofttech.fr.edgesuite.net/TechEdOnline/Videos/406_low.wmv&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Streaming (Low res): &lt;a href="http://mfile.akamai.com/14853/wmv/microsofttec.download.akamai.com/14853/TechEdOnline/Videos/406_low.asx"&gt;http://mfile.akamai.com/14853/wmv/microsofttec.download.akamai.com/14853/TechEdOnline/Videos/406_low.asx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What you get from the video that you might not have picked up on the audio is that we spent most of the time laughing which just goes to show how much fun everyone had doing it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-5554160053424766362?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/5554160053424766362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=5554160053424766362' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5554160053424766362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/5554160053424766362'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/video-of-teched-powershell-panel.html' title='Video of Teched Powershell Panel Discussion'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-8578019951304923141</id><published>2008-11-10T22:36:00.004Z</published><updated>2008-11-10T22:46:08.339Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>YMCA</title><content type='html'>If you were at Teched Powershell Community Dinner then you will appreciate these two photos - the dare did actually take place!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_tNsLdz3cM-0/SRi4LxGX4tI/AAAAAAAAAC4/fWXm9a3yctA/s1600-h/IMG_0041.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_tNsLdz3cM-0/SRi4LxGX4tI/AAAAAAAAAC4/fWXm9a3yctA/s400/IMG_0041.JPG" alt="" id="BLOGGER_PHOTO_ID_5267162276507935442" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tNsLdz3cM-0/SRi4dlaDGVI/AAAAAAAAADA/1UD3bHoNl3A/s1600-h/IMG_0043.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_tNsLdz3cM-0/SRi4dlaDGVI/AAAAAAAAADA/1UD3bHoNl3A/s400/IMG_0043.JPG" alt="" id="BLOGGER_PHOTO_ID_5267162582606879058" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-8578019951304923141?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/8578019951304923141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=8578019951304923141' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8578019951304923141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/8578019951304923141'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/ymca.html' title='YMCA'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_tNsLdz3cM-0/SRi4LxGX4tI/AAAAAAAAAC4/fWXm9a3yctA/s72-c/IMG_0041.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-58964408427295128</id><published>2008-11-08T20:42:00.003Z</published><updated>2008-11-08T20:48:37.541Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>TechEd Powershell Panel Discussion</title><content type='html'>After the TechEd Powershell Panel Discussion we all realised that none of us had arranged for a photo to be taken. :-(&lt;br /&gt;&lt;br /&gt;We're still waiting for the video, so thought we could screengrab something of that, but Tobias found that someone else had put a photo they had taken of it on their &lt;a href="http://gerver.blogspot.com/2008/11/itforum-barcelona-day-2.html"&gt;blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;From left to right below:&lt;br /&gt;&lt;br /&gt;Me, Ben Pearce, Richard Siddaway, Dmitry Sotnikov, James O'Neill, Tobias Weltner, Jeffrey Snover and MoW.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_tNsLdz3cM-0/SRX63E-8hjI/AAAAAAAAACo/KIeyk25IAIQ/s1600-h/PowershellPanel.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_tNsLdz3cM-0/SRX63E-8hjI/AAAAAAAAACo/KIeyk25IAIQ/s400/PowershellPanel.jpg" alt="" id="BLOGGER_PHOTO_ID_5266391163417167410" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-58964408427295128?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/58964408427295128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=58964408427295128' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/58964408427295128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/58964408427295128'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/teched-powershell-panel-discussion.html' title='TechEd Powershell Panel Discussion'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tNsLdz3cM-0/SRX63E-8hjI/AAAAAAAAACo/KIeyk25IAIQ/s72-c/PowershellPanel.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-4971414842835515109</id><published>2008-11-08T20:27:00.002Z</published><updated>2008-11-08T20:41:55.771Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Tech.ed Day 5</title><content type='html'>All good things must come to an end I guess, so after an amazing week at Teched it was time to attend the last few sessions.&lt;br /&gt;&lt;br /&gt;I attended a couple of sessions I have a particular interest in - WSUS 3.0, with Marc Shepard Program Manager. The sessions had promised some Powershell so I had taken along with me a script which I hadn't quite finished off and asked Marc about it afterwards at the Ask the Experts stand.&lt;br /&gt;&lt;br /&gt;He seemed genuinely interested and very kindly worked through most of it, then took it away with him and said he would either get it back to me next week or might have time before the next session. So I duely turned up for the next session and was really pleased when Marc presented me and demonstrated the finished script! I will blog about it in detail next week after I have been able to test it back in work, but for me this was a real value for going to Teched, you wouldn't get that kind of help from someone so close to the product at a normal training course.&lt;br /&gt;&lt;br /&gt;Marc ran a really great second session, which was a Q&amp;amp;A on WSUS 3.0. He gave some really great answers and took a lot of feedback about the product which you believed he actually would try to do something about.&lt;br /&gt;&lt;br /&gt;For the final session of the week I went to a repeat of the Powershell session with Ben and Jeffrey. Due to the fact a lot of people had left the conference by this time, the attendence wasn't massive, but both presenters were so relaxed that it made for a really funny session with lots of jokes. (Possibly more on this in a later post)&lt;br /&gt;&lt;br /&gt;Once finished it was off on the provided coaches to the airport and the usual waiting around. Luckily I went with Richard Siddaway, a colleague of his and the aforementioned Ben Pearce so the time went pretty quick.&lt;br /&gt;&lt;br /&gt;All in all I had a brilliant time, got loads out of it and now need to work on a plan for how to get there next year!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-4971414842835515109?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/4971414842835515109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=4971414842835515109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4971414842835515109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4971414842835515109'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/teched-day-5.html' title='Tech.ed Day 5'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-1838611918462759858</id><published>2008-11-07T09:30:00.002Z</published><updated>2008-11-07T09:37:43.315Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Tech.ed Day 4</title><content type='html'>Posting the day after this time, will keep it brief. All you need to know is:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Powershell sessions all day with Jeffrey Snover and the exuberant &lt;a href="http://blogs.technet.com/benp/"&gt;Ben Pearce&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Powershell community dinner, 18 attendees. Jeffrey + MoW = mental evening&lt;/li&gt;&lt;li&gt;Got back so late it was time for the live stream of the &lt;a href="http://powerscripting.wordpress.com/"&gt;Powerscripting podcast&lt;/a&gt; so thought I might as well stay up late and watch it for the first time - great fun.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The amount of sleep I am getting is decreasing by about half an hour each night - it started at about 5 hours on Sunday. This is so much fun though I don't even seem to notice.....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-1838611918462759858?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/1838611918462759858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=1838611918462759858' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/1838611918462759858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/1838611918462759858'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/teched-day-4.html' title='Tech.ed Day 4'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-6028304179833870789</id><published>2008-11-05T23:40:00.002Z</published><updated>2008-11-05T23:48:31.328Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Tech.ed Day 3</title><content type='html'>So a bit more of a relaxed day today after yesterday's panel discussion craziness.&lt;br /&gt;&lt;br /&gt;Some great Powershell sessions today.&lt;br /&gt;&lt;br /&gt;James O'Neill - how to get effective output from Powershell, in particular OpenXML - I really got challenged to give this a try for creating reports, it looks very useful and not too difficult.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.technet.com/jamesone/archive/2008/11/05/slides-and-scripts-from-open-xml-powershell-reporting-session-in-barcelona.aspx"&gt;http://blogs.technet.com/jamesone/archive/2008/11/05/slides-and-scripts-from-open-xml-powershell-reporting-session-in-barcelona.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Plus I saw Jeffrey Snover present for the first time - it was awesome, all about stuff coming up in V2 of Powershell - there will be CTP3 of V2 in Dec 08.&lt;br /&gt;&lt;br /&gt;Also Dmitry kindly gave me some of his time for an interview for the podcast, so we will get that out in November hopefully.&lt;br /&gt;&lt;br /&gt;All finished off by the UK country drinks party, a very chilled evening.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-6028304179833870789?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/6028304179833870789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=6028304179833870789' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/6028304179833870789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/6028304179833870789'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/teched-day-3.html' title='Tech.ed Day 3'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-3359745766919304603</id><published>2008-11-05T01:54:00.002Z</published><updated>2008-11-05T02:03:19.112Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Tech.ed Day 2</title><content type='html'>So its late, this will be brief, but I had another brilliant day at Tech.ed. The highlight of course was the Powershell Panel Discussion.&lt;br /&gt;&lt;br /&gt;I decided to get it out to the get-scripting podcast asap since it was so good, so there is a new episode with just that for content.&lt;br /&gt;&lt;br /&gt;Apart from that I went to a couple of interesting Exchange 2007 sessions, an Operations Manager 2007 R2 session and had a nice dinner with some new friends.&lt;br /&gt;&lt;br /&gt;This is so much fun........&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-3359745766919304603?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/3359745766919304603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=3359745766919304603' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3359745766919304603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3359745766919304603'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/teched-day-2.html' title='Tech.ed Day 2'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-7536414064500343242</id><published>2008-11-04T01:02:00.002Z</published><updated>2008-11-04T01:10:03.149Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Tech.ed Day 1</title><content type='html'>The day flew by really.  Wandered round Ramblas in the morning, checking out some of Barcelona.&lt;br /&gt;&lt;br /&gt;Then the guy I met yesterday (Andy) offered to show me the ropes in getting the Metro to the conference centre which was really helpful.&lt;br /&gt;&lt;br /&gt;Quick and easy registration, followed by some lunch and then the first session I went to, Steve Riley. This was amazing, a great presenter and he really made security interesting. (not easy). I think I may have to check out some of his other sessions.&lt;br /&gt;&lt;br /&gt;Later on I went to a session on Sysvol in 2008, i.e. you can replace NTFRS, with DFSR. One thing I learnt was you need to get to sessions early because this was totally full and I was the second last person allowed in.&lt;br /&gt;&lt;br /&gt;An evening reception and chance to check out vendors and Ask the Experts. I met Mow and Tobias on the Powershell stand which was great. I also thanked the very nice ladies at the Technet Plus stand for the competition I won to get me the place here - they want me to do a video for them on Wednesday so naturally was happy to return the favour.&lt;br /&gt;&lt;br /&gt;Just before leaving I was invited out by those great guys at Specops, so an excellent meal was had by all.&lt;br /&gt;&lt;br /&gt;Plenty of sessions to get stuck into tomorrow and of course the Powershell panel discussion.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-7536414064500343242?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/7536414064500343242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=7536414064500343242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7536414064500343242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/7536414064500343242'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/teched-day-1.html' title='Tech.ed Day 1'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-6646651981019846656</id><published>2008-11-03T18:04:00.003Z</published><updated>2008-11-03T18:08:17.184Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='powershell'/><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Powershell Panel Discussion at Teched</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Tuesday Nov 4th 2 - 3&lt;/span&gt; I will be hosting a Powershell Panel discussion on a stage adjacent to the Tech Talk Fishbowl.&lt;br /&gt;&lt;br /&gt;Invited attendees include:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Dmitry Sotnikov - Powershell MVP&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Richard Siddaway - Powershell MVP&lt;/li&gt;&lt;li&gt;MoW - Powershell MVP&lt;/li&gt;&lt;li&gt;James O'Neill - Microsoft&lt;/li&gt;&lt;li&gt;Some guy called Jeffrey&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;I will be recording the session for the get-scripting podcast, apparently it will also be videoed and available at the Teched Online website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-6646651981019846656?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/6646651981019846656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=6646651981019846656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/6646651981019846656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/6646651981019846656'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/powershell-panel-discussion-at-teched.html' title='Powershell Panel Discussion at Teched'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-4296543482103012923</id><published>2008-11-03T14:13:00.002Z</published><updated>2008-11-03T14:16:38.345Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><title type='text'>Visit this stand</title><content type='html'>If you are at Teched EMEA you must visit the Specops stand, especially if you are interested in Powershell.&lt;br /&gt;&lt;br /&gt;They may even give you one of the freebie underpants - possibly the strangest giveaway I have seen.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_tNsLdz3cM-0/SQ8HsbEoNWI/AAAAAAAAACg/dOYg3s21e1o/s1600-h/IMG_0016.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_tNsLdz3cM-0/SQ8HsbEoNWI/AAAAAAAAACg/dOYg3s21e1o/s400/IMG_0016.JPG" alt="" id="BLOGGER_PHOTO_ID_5264434949182207330" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-4296543482103012923?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/4296543482103012923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=4296543482103012923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4296543482103012923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/4296543482103012923'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/visit-this-stand.html' title='Visit this stand'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_tNsLdz3cM-0/SQ8HsbEoNWI/AAAAAAAAACg/dOYg3s21e1o/s72-c/IMG_0016.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-3318086220794027018</id><published>2008-11-02T23:29:00.003Z</published><updated>2008-11-02T23:42:07.780Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='tech.ed'/><category scheme='http://www.blogger.com/atom/ns#' term='events'/><title type='text'>Tech.ed Day 0 - (aka geek week as its now known in the Medd house)</title><content type='html'>So I'm out in Barcelona for my first Tech.ed, really looking forward to it kicking off tomorrow:&lt;br /&gt;&lt;br /&gt;Tip #1: Don't lift a chest of drawers up the stairs the day before going, its not good to travel with a back strain. I'm seriously hoping this wears off quickly&lt;br /&gt;&lt;br /&gt;Tip #2: Strike up conversations with Tech looking people, so far:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;At the airport car park I was waiting for a bus with one guy carrying a Tech.ed bag, obviously got chatting to him.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I got seated next to Nathan Winters - Exchange MVP on the plane. I knew who he was, but not vice-versa - he does now! (I think)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I tagged along with a similarly lost tech looking person at Barcelona airport looking for the bus into the city - he kindly pointed me in the right direction for my hotel after making it to the city and offered to show me how to get to the centre tomorrow via the metro.&lt;/li&gt;&lt;li&gt;Met up for the first time this evening with fellow Powershell fan Jon Noble, what a nice chap.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Consequently I have loads of tips and helpful info for getting the most out of this week.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I'll most likely be at all the Powershell sessions (also you will see me at AD and Exchange sessions), please say hello.&lt;br /&gt;&lt;br /&gt;Monday I will definitely be at:&lt;br /&gt;&lt;br /&gt;&lt;div class="schedule"&gt; &lt;div&gt;IDA01-IS Ok so what happened to SYSVOL in AD 2008? Do I need to care?  &lt;/div&gt; &lt;div&gt;Room 133  at 17.45&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-3318086220794027018?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/3318086220794027018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=3318086220794027018' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3318086220794027018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/3318086220794027018'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/11/teched-day-0-aka-geek-week-as-its-now.html' title='Tech.ed Day 0 - (aka geek week as its now known in the Medd house)'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7309400939930129927.post-528185570537372443</id><published>2008-10-27T20:05:00.001Z</published><updated>2008-10-27T20:06:57.455Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='blogging'/><category scheme='http://www.blogger.com/atom/ns#' term='podcast'/><title type='text'>Welcome</title><content type='html'>Welcome to the new home for my blogging. As explained over on the get-scripting podcast blog, I decided to seperate the podcast from my own personal ramblings which will from now on be here, the get-scripting site will be used for podcast stuff only.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7309400939930129927-528185570537372443?l=jonathanmedd.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jonathanmedd.blogspot.com/feeds/528185570537372443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7309400939930129927&amp;postID=528185570537372443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/528185570537372443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7309400939930129927/posts/default/528185570537372443'/><link rel='alternate' type='text/html' href='http://jonathanmedd.blogspot.com/2008/10/welcome.html' title='Welcome'/><author><name>Jonathan Medd</name><uri>http://www.blogger.com/profile/16003000142799678177</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
