<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>blog.powershell.no</title>
	<atom:link href="http://blog.powershell.no/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.powershell.no</link>
	<description>On Windows PowerShell and other admin-related topics</description>
	<lastBuildDate>Mon, 26 Jul 2010 13:44:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.powershell.no' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e22e511529c14fbc92cde5589d6231b4?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>blog.powershell.no</title>
		<link>http://blog.powershell.no</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.powershell.no/osd.xml" title="blog.powershell.no" />
	<atom:link rel='hub' href='http://blog.powershell.no/?pushpress=hub'/>
		<item>
		<title>Send text messages (SMS) using Windows PowerShell</title>
		<link>http://blog.powershell.no/2010/07/21/send-text-messages-sms-using-windows-powershell/</link>
		<comments>http://blog.powershell.no/2010/07/21/send-text-messages-sms-using-windows-powershell/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 15:01:41 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Active Directory management]]></category>
		<category><![CDATA[Microsoft Outlook]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[sms from powershell]]></category>
		<category><![CDATA[powershell send sms]]></category>
		<category><![CDATA[powershell send text message]]></category>

		<guid isPermaLink="false">https://janegilring.wordpress.com/2010/07/21/send-text-messages-sms-using-windows-powershell/</guid>
		<description><![CDATA[In Microsoft Office Outlook there is an add-in called Microsoft Outlook SMS Add-in (MOSA), which provides the ability to send text messages (SMS). MOSA is builtin to Outlook 2010, and are available as a plugin for Outlook 2003 and 2007 here. On the Microsoft Office Online Help you can find guidance on how to set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=571&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In Microsoft Office Outlook there is an add-in called Microsoft Outlook SMS Add-in (MOSA), which provides the ability to send text messages (SMS). MOSA is builtin to Outlook 2010, and are available as a plugin for Outlook 2003 and 2007 <a href="http://www.microsoft.com/downloads/details.aspx?familyid=240080b4-986e-4afb-ab21-3af2be63508b&amp;displaylang=en" target="_blank">here</a>.</p>
<p>On the <a href="http://office.microsoft.com/en-gb/outlook-help/send-and-receive-text-messages-sms-HA101823438.aspx" target="_blank">Microsoft Office Online Help</a> you can find guidance on how to set up the service account and sending a text message. To find the necessary settings for your mobile service provider, go <a href="http://messaging.office.microsoft.com/HostingProviders.aspx?src=O14&amp;lc=1033" target="_blank">here</a>.</p>
<p>I looked into the <a href="http://msdn.microsoft.com/en-us/library/ms268893(v=VS.80).aspx" target="_blank">COM-object for Outlook</a>, and it turned out to be rather easy to use this API to send text messages from MOSA.<br />
Based on that I created an <a href="http://technet.microsoft.com/en-us/library/dd315326.aspx" target="_blank">Advanced function</a> in Windows PowerShell v2 called <a href="http://poshcode.org/1999" target="_blank">Send-SMSMessage</a>.</p>
<p>To define the function you can either paste it directly into your session, save it as a ps1 script-file and <a href="http://technet.microsoft.com/en-us/library/ee176949.aspx#ECAA" target="_blank">dot source</a> it, put it into your <a href="http://technet.microsoft.com/en-us/library/ee692764.aspx" target="_blank">profile</a> or into a <a href="http://msdn.microsoft.com/en-us/library/dd901839(VS.85).aspx" target="_blank">module</a>.</p>
<p>When that is accomplished you can find usage information using the consistent Get-Help cmdlet:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/07/image.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/07/image_thumb.png?w=638&#038;h=531" border="0" alt="image" width="638" height="531" /></a></p>
<p>Sample usage:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/07/image1.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/07/image_thumb1.png?w=987&#038;h=55" border="0" alt="image" width="987" height="55" /></a></p>
<p>The function checks if Outlook are installed, and breaks out with a warning if not:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/07/image2.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/07/image_thumb2.png?w=984&#038;h=65" border="0" alt="image" width="984" height="65" /></a></p>
<p>It also checks to see if an account are configured for Text Messaging (SMS):</p>
<p><a href="http://janegilring.files.wordpress.com/2010/07/image3.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/07/image_thumb3.png?w=986&#038;h=64" border="0" alt="image" width="986" height="64" /></a></p>
<p>Any errors related to service availabilty, correct phonenumber format and so on are handled by the SMS Add-in itself. These error messages appear in the Outlook inbox:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/07/image4.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/07/image_thumb4.png?w=469&#038;h=216" border="0" alt="image" width="469" height="216" /></a></p>
<p>The function is tested from Outlook 2010 only, but should work from 2003 and 2007 also when MOSA is installed.</p>
<p>Since the function accepts ValueFromPipeline and ValueFromPipelineByPropertyName you can use it in conjunction with e.g. the <a href="http://technet.microsoft.com/en-us/library/ee617195.aspx" target="_blank">Active Directory cmdlets for Windows PowerShell</a>.  A given example of this retrieves all users from Active Directory with a derfined mobilephone number and sends them an SMS with their username:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/07/image5.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/07/image_thumb5.png?w=988&#038;h=77" border="0" alt="image" width="988" height="77" /></a></p>
<p>Another practical usage scenario I can think of is combining the Send-SMSMessage function with user provisioning, sending the new user it`s new username and password.<br />
Feel free to come up with more usage scenarios in the comment field below.</p>
<p><strong>Bonus tips</strong></p>
<ul>
<li>You can also send MMS messages using the Outlook COM-object. To do this, use “olMobileItemMMS” instead of “olMobileItemSMS” in the following line: $NewMessage = $outlook.CreateItem(&#8220;olMobileItemMMS&#8221;). You should also look into the other properties for MMS messages, like the Attachment-property.</li>
<li>If you got more than one account configured for text messaging, you can use the SendUsingAccount-property to define which account to send from.</li>
<li>If you use the Norwegian mobile service provider Telenor, the “Service Provider URL” in the account settings is <a title="https://telenormobil.no/smapi/services/omsv3_service" href="https://telenormobil.no/smapi/services/omsv3_service">https://telenormobil.no/smapi/services/omsv3_service</a></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/571/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/571/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/571/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=571&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/07/21/send-text-messages-sms-using-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/07/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/07/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/07/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/07/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/07/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/07/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Manage RDS RemoteApp with Windows PowerShell</title>
		<link>http://blog.powershell.no/2010/06/30/manage-rds-remoteapp-with-windows-powershell/</link>
		<comments>http://blog.powershell.no/2010/06/30/manage-rds-remoteapp-with-windows-powershell/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 21:01:21 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Remote Desktop Services]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Terminal Services]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>
		<category><![CDATA[rds powershell provider]]></category>

		<guid isPermaLink="false">https://janegilring.wordpress.com/2010/06/30/manage-rds-remoteapp-with-windows-powershell/</guid>
		<description><![CDATA[In Windows Server 2008 R2, Remote Desktop Services (formerly Terminal Services) includes a provider for managing RDS using Windows PowerShell. You may find more information along with some examples in this article on Microsoft TechNet. One of the many things you can manage this way is the new RemoteApp-feature introduced with Windows Server 2008. In [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=535&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In Windows Server 2008 R2, Remote Desktop Services (formerly Terminal Services) includes a provider for managing RDS using Windows PowerShell. You may find more information along with some examples in <a href="http://technet.microsoft.com/en-us/library/ee791871(WS.10).aspx" target="_blank">this article</a> on Microsoft TechNet.</p>
<p>One of the many things you can manage this way is the new RemoteApp-feature introduced with Windows Server 2008. In Windows Server 2008 R2, this feature got enhanced by the addition of <a href="http://blogs.msdn.com/b/rds/archive/2009/06/12/introducing-remoteapp-user-assignment.aspx" target="_blank">User Assignment</a> and <a href="http://blogs.msdn.com/b/rds/archive/2009/08/11/introducing-web-single-sign-on-for-remoteapp-and-desktop-connections.aspx" target="_blank">Web Single Sign-On</a> capabilities. These new features makes it possible for more and more customers to consider RDS without additional products like Citrix. One benefit using Citrix are more flexible application-management, since an published application may be available from a new farm member without adding each application manually.</p>
<p>Let`s look at a given example: You got a farm with 16 RDS-servers, and you`re leveraging the RemoteApp-feature. For each server in the farm, you must manually set up all applications in RemoteApp-manager after they`re installed. Although there is an export/import-feature in the GUI, many customers require no manual interaction in the server provisioning process. By the addition of the new PowerShell-provider for RDS, this is now possible in RemoteApp using scripting as part of either server provisioning or Group Policy.</p>
<p>For the average Windows sysadmin, I imagine that managing RemoteApp using the RDS PowerShell provider might be a bit tedious. To make this a little easier I`ve created a Windows PowerShell module for working with RDS RemoteApp, available from <a href="http://code.msdn.microsoft.com/PSRDSRemoteApp" target="_blank">here</a>.</p>
<p>This module contains the following functions:</p>
<ul>
<li><strong>Get-RDSRemoteApp</strong></li>
<li><strong>Export-RDSRemoteApps</strong></li>
<li><strong>Import-RDSRemoteApps</strong></li>
<li><strong>New-RDSRemoteApp</strong></li>
<li><strong>Remove-RDSRemoteApp</strong></li>
</ul>
<p>The functions let you administer the same application attributes as the graphical RemoteApp Manager:</p>
<ul>
<li>Displayname</li>
<li>Alias</li>
<li>Command-line arguments</li>
<li>RD Web Access availability</li>
<li>User Assignment</li>
</ul>
<p> </p>
<p><strong><span style="font-size:x-small;">Installing the RDSRemoteApp module</span></strong></p>
<p><a href="http://code.msdn.microsoft.com/PSRDSRemoteApp" target="_blank">Download</a> and unzip RDSRemoteApp.zip in the following location: %userprofile%\Documents\WindowsPowerShell\Modules\RDSRemoteApp</p>
<p>Alternatively you may save the module in any of the folders in the $Env:PSMODULEPATH variable.</p>
<p><strong><span style="font-size:x-small;">Using the RDSRemoteApp module</span></strong></p>
<p>First we`ll have a look at the RemoteApp Manager application-list in the lab-environment:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image8.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb8.png?w=468&#038;h=167" border="0" alt="image" width="468" height="167" /></a></p>
<p>Start Windows PowerShell on the RDS-server and import the module (you will need to run PowerShell with Administrative privileges):</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image9.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb9.png?w=244&#038;h=47" border="0" alt="image" width="244" height="47" /></a></p>
<p>Since I`ve leveraged the built-in help capabilities in Windows PowerShell v2 Advanced Functions, I`ll show the usage of the functions with a few screenshots from the help:</p>
<p><strong>Get-RDSRemoteApp</strong></p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image10.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb10.png?w=627&#038;h=110" border="0" alt="image" width="627" height="110" /></a></p>
<p><strong>New-RDSRemoteApp</strong></p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image11.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb11.png?w=629&#038;h=194" border="0" alt="image" width="629" height="194" /></a></p>
<p><strong>Remove-RDSRemoteApp</strong></p>
<p>  <a href="http://janegilring.files.wordpress.com/2010/06/image12.png"><img class="wlDisabledImage" style="display:inline;border:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb12.png?w=630&#038;h=208" border="0" alt="image" width="630" height="208" /></a></p>
<p><strong>Export-RDSRemoteApps</strong></p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image13.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb13.png?w=636&#038;h=133" border="0" alt="image" width="636" height="133" /></a></p>
<p><strong>Import-RDSRemoteApps</strong></p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image14.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb14.png?w=640&#038;h=138" border="0" alt="image" width="640" height="138" /></a> </p>
<p>Sample usage for export/import:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image15.png"><img class="wlDisabledImage" style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb15.png?w=645&#038;h=161" border="0" alt="image" width="645" height="161" /></a></p>
<p>Be aware that there are several other RDS settings that may be managed using the PowerShell provider, this module only leverages the RemoteApp functionality. If someone want to create a module for managing other aspects of RDS, feel free to include my RDSRemoteApp module. And as always, suggestions for improvements and new functionality are more than welcome.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/535/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/535/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/535/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=535&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/06/30/manage-rds-remoteapp-with-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Manage Windows Update installations using Windows PowerShell</title>
		<link>http://blog.powershell.no/2010/06/25/manage-windows-update-installations-using-windows-powershell/</link>
		<comments>http://blog.powershell.no/2010/06/25/manage-windows-update-installations-using-windows-powershell/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 11:46:18 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Group Policy]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Windows Update]]></category>
		<category><![CDATA[microsoft.update.session]]></category>

		<guid isPermaLink="false">https://janegilring.wordpress.com/2010/06/25/manage-windows-update-installations-using-windows-powershell/</guid>
		<description><![CDATA[In most domains Windows Update are controlled by Group Policy and Windows Server Update Services (WSUS). For client computers, it`s common to download and install updates automatically. For servers, we want to control the installation of Windows Updates inside a scheduled maintenance window, and hence the Windows Update settings are configured not to automatically install [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=516&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In most domains Windows Update are controlled by Group Policy and Windows Server Update Services (WSUS). For client computers, it`s common to download and install updates automatically. For servers, we want to control the installation of Windows Updates inside a scheduled maintenance window, and hence the Windows Update settings are configured not to automatically install updates.</p>
<p>If there are a few servers to manage, it won`t be that time consuming to log on to each server with Remote Desktop and do the Windows Update installations manually. In larger environments however, this won`t be an option, it must be automated in some way. While enterprise environments typically invest in a commercial product like <a href="http://www.bigfix.com/content/patch-management" target="_blank">BigFix</a> for patch management, this might be overkill or too expensive for environments smaller than an enterprise.</p>
<p>To manage Windows Update in an automated way we can access the <a href="http://msdn.microsoft.com/en-us/library/aa387287(v=VS.85).aspx" target="_blank">Windows Update Agent API</a> using a COM-object called Microsoft.Update.Session. Using the New-Object cmdlet in Windows PowerShell, it`s easy to work with this COM-object. Based on this COM-object and portions of <a href="http://blogs.technet.com/b/jamesone/archive/2009/01/27/managing-windows-update-with-powershell.aspx" target="_blank">James O`Neill`s functions</a> for managing Windows Update, I`ve written a PowerShell-script called <a href="http://poshcode.org/1932">Invoke-WindowsUpdate</a>.</p>
<p>This script is intended to be used to download and install Windows Updates on servers. It runs like expected when invoked from a local computer, however, invoking the script using PowerShell Remoting like I was planning turned out to be problematic: <span style="font-size:xx-small;">Invoke-Command -ComputerName ServerA -FilePath &#8216;C:\ps-scripts\Windows Update\Invoke-WindowsUpdate.ps1&#8242;</span></p>
<p>This will return the following error message:<br />
<em><span style="font-size:xx-small;">Exception calling &#8220;CreateUpdateDownloader&#8221; with &#8220;0&#8243; argument(s): &#8220;Access is denied. (Exception from HRESULT: 0&#215;80070005 E_ACCESSDENIED))&#8221;</span></em></p>
<p>This issue doesn`t seem to be related to PowerShell, as there are several others <a href="http://www.google.no/search?hl=no&amp;q=microsoft.update.session+access+is+denied&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai=" target="_blank">reporting</a> the same problem in other languages like VBScript.</p>
<p>The common workaround is to schedule the script to run as a scheduled task running as SYSTEM. I`ve chosen to use this approach and to use PowerShell Remoting to invoke the scheduled task to run the script. An example:</p>
<p><span style="font-size:xx-small;">$servers = Get-Content &#8216;C:\ps-scripts\Windows Update\BulkA.txt&#8217;<br />
foreach ($server in $servers) {<br />
Invoke-Command -Computer $server -ScriptBlock {schtasks /run /tn &#8220;PowerShell &#8211; download and install Windows Updates&#8221;}<br />
}</span></p>
<p>To create the scheduled task I would recommend you to use <a href="http://blog.powershell.no/2009/03/20/group-policy-preferences/" target="_blank">Group Policy Preferences</a>.<br />
A few sample screenshots from my lab setup:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image4.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb4.png?w=445&#038;h=124" border="0" alt="image" width="445" height="124" /></a></p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image5.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb5.png?w=439&#038;h=330" border="0" alt="image" width="439" height="330" /></a></p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image6.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb6.png?w=439&#038;h=331" border="0" alt="image" width="439" height="331" /></a></p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image7.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb7.png?w=442&#038;h=332" border="0" alt="image" width="442" height="332" /></a></p>
<p>Although it`s possible to invoke the script on all servers in the domain at once using i.e. the <a href="http://technet.microsoft.com/en-us/library/dd378937(WS.10).aspx" target="_blank">Active Directory-module for PowerShell</a> to get the server names, I would recommend to break down the installations in several bulks. This way you can control that all domain controllers doesn`t go offline at the same time and so on.</p>
<p>As you can see in the script it`s also possible to enable reporting to e-mail or file (HTML) to a central location, in addition to control whether the servers should reboot if required.<br />
Planned improvements include nicer reports, Windows Update settings in the reports and if possible make the script work without having to use scheduled tasks. Suggestions for other improvements are always welcome.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/516/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=516&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/06/25/manage-windows-update-installations-using-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Backing up Group Policy Objects using Windows PowerShell</title>
		<link>http://blog.powershell.no/2010/06/15/backing-up-group-policy-objects-using-windows-powershell/</link>
		<comments>http://blog.powershell.no/2010/06/15/backing-up-group-policy-objects-using-windows-powershell/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 23:57:22 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Active Directory management]]></category>
		<category><![CDATA[Group Policy]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">https://janegilring.wordpress.com/2010/06/15/backing-up-group-policy-objects-using-windows-powershell/</guid>
		<description><![CDATA[A best practice in domain environments are backing up the Group Policy Objects regularly. Even though a GPO may be restored by restoring a system state backup from a domain controller to an alternate location, and then copy the contents from the deleted GPO to a new GPO to restore the settings, this may be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=506&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>A best practice in domain environments are backing up the Group Policy Objects regularly. Even though a GPO may be restored by restoring a system state backup from a domain controller to an alternate location, and then copy the contents from the deleted GPO to a new GPO to restore the settings, this may be a hazzle since it`s not pretty straightforward. It also requires you to restart the domain controller affected in Directory Services Restore Mode.<br />
PowerShell MVP Don Jones has written a good article on this topic, available <a href="http://redmondmag.com/articles/2010/05/01/back-up-active-directory-and-gpos.aspx" target="_blank">here</a>.</p>
<p>For those of you who may not want to do GPO restore the hard way, or buy a commercial third party product, I would encourage you to schedule regular GPO backups using the Windows PowerShell Group Policy-module available in Windows Server 2008 R2, as well as RSAT in Windows 7.<br />
To accomplish this, I`ve written a small script which backs up all modified GPO`s in the specified timespan. I would generally recommend to have the script run once a day, thereby setting the timespan-variable to the last 24 hours. The script are called Backup-ModifiedGPOs.ps1, and available from <a href="http://poshcode.org/1914">here</a>.</p>
<p>All Group Policy Objects modified in the specified timespan are backup up to the specified backup path.<br />
Also, an HTML-report are created for each GPO-backup, with the unique backup GUID as part of the filename. This way you can easily see what settings each backup contains.</p>
<p>When restoring a GPO, you must first note the GUID of the backup you want to restore. Then you can restore the GPO by using the Restore-GPO cmdlet in the Group Policy-module. Sample usage:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image3.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb3.png?w=644&#038;h=163" border="0" alt="image" width="644" height="163" /></a></p>
<p>Administrators who feels more comfortable working with the GUI, may use the Group Policy Management Console to do the restore.</p>
<p>The following procedure from the <a href="http://technet.microsoft.com/en-us/library/cc754948(WS.10).aspx" target="_blank">Group Policy Planning and Deployment Guide</a> on Microsoft TechNet describes how to accomplish the restore operation from the GUI:</p>
<p><strong><span style="font-size:xx-small;"><span style="font-family:Calibri;"><span style="font-size:x-small;">To view the list of GPO backups</span> </span></span></strong></p>
<ol>
<li><span style="font-family:Calibri;font-size:xx-small;">In the GPMC console tree, expand the forest or domain that contains the GPOs that you want to back up.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">Right-click <strong>Group Policy Objects</strong>, and the click <strong>Manage Backups</strong>.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">In the <strong>Manage Backups</strong> dialog box, enter the path to the location where you stored the GPO backups that you want to view. Alternatively, you can click <strong>Browse</strong>, locate the folder that contains the GPO backups, and then click <strong>OK</strong>.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">To specify that only the most recent version of the GPOs be displayed in the <strong>Backed up GPOs</strong> list, select the <strong>Show only the latest version of each GPO</strong> check box. Click <strong>Close</strong>.</span></li>
</ol>
<p><strong><span style="font-family:Calibri;font-size:x-small;">Using the GPMC to restore GPOs</span></strong></p>
<p><span style="font-family:Calibri;font-size:xx-small;">You can also restore GPOs. This operation restores a backed-up GPO to the same domain from which it was backed up. You cannot restore a GPO from a backup into a domain that is different from the GPO’s original domain.</span></p>
<p><strong><span style="font-size:xx-small;"><span style="font-family:Calibri;"><span style="font-size:x-small;">To restore a previous version of an existing GPO</span> </span></span></strong></p>
<ol>
<li><span style="font-family:Calibri;font-size:xx-small;">In the GPMC console tree, expand <strong>Group Policy Objects</strong> in the forest or domain that contains the GPOs that you want to restore.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">Right-click the GPO that you want to restore to a previous version, and then click <strong>Restore from Backup</strong>.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">When the <strong>Restore Group Policy Object Wizard</strong> opens, follow the instructions in the wizard, and then click <strong>Finish</strong>.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">After the restore operation completes, a summary will state whether the restore succeeded. Click <strong>OK</strong>.</span></li>
</ol>
<p><strong><span style="font-size:xx-small;"><span style="font-family:Calibri;"><span style="font-size:x-small;">To restore a deleted GPO</span> </span></span></p>
<ol>
<li><span style="font-family:Calibri;font-size:xx-small;">In the GPMC console tree, expand the forest or domain that contains the GPO that you want to restore.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">Right-click <strong>Group Policy Objects</strong>, and then click <strong>Manage Backups</strong>.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">In the <strong>Manage Backups </strong>dialog box, click <strong>Browse</strong>, and then locate the file that contains your backed-up GPOs.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">In the <strong>Backed up GPOs </strong>list, click the GPO that you want to restore, and then click <strong>Restore</strong>.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">When you are prompted to confirm the restore operation, click <strong>OK</strong>.</span></li>
<li><span style="font-family:Calibri;font-size:xx-small;">After the restore operation completes, a summary will state whether the restore succeeded. Click <strong>OK</strong>. Click <strong>Close</strong>.</span></li>
</ol>
<p> </p>
<p><strong>Important:</strong> Since Group Policy links are stored on the Organizational Unit objects in Active Directory, this information are not backup up and also not restore. However, the HTML backup-reports contains this information, so you may manually re-link the GPO to the correct OU(s).</p>
<p>Also note that WMI filters and IPSec policies are not backed up by the backup feature in the Group Policy Management Console. For more information on how to manage these items, see the before mentioned Group Policy Planning and Deployment Guide.</p>
<p></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/506/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/506/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/506/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=506&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/06/15/backing-up-group-policy-objects-using-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic Remote Desktop Connection Manager connection list</title>
		<link>http://blog.powershell.no/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list/</link>
		<comments>http://blog.powershell.no/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 21:51:06 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Active Directory management]]></category>
		<category><![CDATA[RSAT]]></category>
		<category><![CDATA[Remote Desktop Services]]></category>
		<category><![CDATA[Remote Management]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>

		<guid isPermaLink="false">https://janegilring.wordpress.com/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list/</guid>
		<description><![CDATA[  Microsoft recently released a free tool for managing multiple remote desktop connections called “Remote Desktop Connection Manager”. A sample screenshot: There are several nice features, such as “Connect group” which lets you connect to all servers in a group at once: On the “Group Properties” you may set common settings for all connections in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=501&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>Microsoft recently released a free tool for managing multiple remote desktop connections called “<a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=4603c621-6de7-4ccb-9f51-d53dc7e48047" target="_blank">Remote Desktop Connection Manager</a>”.</p>
<p>A sample screenshot:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb.png?w=644&#038;h=192" border="0" alt="image" width="644" height="192" /></a></p>
<p>There are several nice features, such as “Connect group” which lets you connect to all servers in a group at once:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb1.png?w=244&#038;h=205" border="0" alt="image" width="244" height="205" /></a></p>
<p>On the “Group Properties” you may set common settings for all connections in the group, like logon credentials:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/06/image2.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/06/image_thumb2.png?w=501&#038;h=388" border="0" alt="image" width="501" height="388" /></a></p>
<p>Further, there are group properties for RDS Gateway (formerly TS Gateway), display settings, local resources and so on.</p>
<p>There are several applications for remote desktop connections on the market, and some of them got these settings as a per server setting. It`s nice to be able to group servers and configure common settings.</p>
<p><strong><span style="font-size:medium;">Dynamically creating the connection list</span></strong></p>
<p>When you work in larger environments with hundreds, maybe thousands of servers, setting up each connection manually isn`t an option.</p>
<p>Since Remote Desktop Connection Manager stores the config-files in xml-files, it`s rather easy to create dynamic config-files for a domain using Windows PowerShell. I`ve created a script to accomplish this, called New-RDCManFile.ps1, available from <a href="http://poshcode.org/1893">here</a>. It uses Microsoft`s <a href="http://technet.microsoft.com/en-us/library/dd378937(WS.10).aspx" target="_blank">PowerShell-module for Active Directory</a>, which is available in Windows Server 2008 R2 and <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d" target="_blank">RSAT for Windows 7</a>.</p>
<p><span style="text-decoration:underline;">The script does the following:</span><br />
Creates a template xml-file<br />
Inserts the logged on user`s domain name in the file properties<br />
Inserts the logged on user`s domain name in the group properties<br />
Inserts the logged on user`s username in the logoncredentials section<br />
Inserts the logged on user`s domain name in the logoncredentials section<br />
Retrieves all computer objects from Active Directory with the word “server” in the operatingsystem property<br />
Adds each computer object as a server object<br />
Saves the XML-file to %userprofile%\domain-name.rdg</p>
<p>When done you can open the rdg-file in Remote Desktop Connection Manager. I would recommend you to insert your password in the Group Properties to avoid being asked for credentials for each connection.</p>
<p>Feel free to customize the script to your needs, in example by editing the XML-template to edit the Group Properties. Another customization might be creating a group for each server OU for enhanced overview in larger environments.</p>
<p>If you would rather use Quest`s <a href="http://www.quest.com/powershell/activeroles-server.aspx" target="_blank">PowerShell Commands for Active Directory</a> (which works on downlevel operatingsystems like Windows XP and Windows Server 2003), or any other way to retrieve the server names, you may customize this on line 110.</p>
<p>You might also want to schedule the script to run on a regular basis, saving the file to a central location. This way the IT personnel will always have access to the latest version with the most recent servers added.</p>
<p>If you got any further ideas or comments, please let me know in the comments section below.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/501/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/501/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/501/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=501&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/06/02/dynamic-remote-desktop-connection-manager-connection-list/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/06/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Script to create a NLB-cluster for Exchange Server 2010</title>
		<link>http://blog.powershell.no/2010/05/21/script-to-create-a-nlb-cluster-for-the-cas-role-in-exchange-server-2010/</link>
		<comments>http://blog.powershell.no/2010/05/21/script-to-create-a-nlb-cluster-for-the-cas-role-in-exchange-server-2010/#comments</comments>
		<pubDate>Fri, 21 May 2010 11:50:08 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Exchange Server 2010]]></category>
		<category><![CDATA[Network Load Balancing]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Exchange Server 2010 NLB script;Exchange Server 2010 CAS load balancing]]></category>

		<guid isPermaLink="false">https://janegilring.wordpress.com/2010/05/21/script-to-create-a-nlb-cluster-for-the-cas-role-in-exchange-server-2010/</guid>
		<description><![CDATA[When documenting installations I perform I prefer to refer to scripts whenever possible, since this means less screenshots and a more concise reference. When deploying Exchange Server 2010 on Windows Server 2008 R2, we have access to the new PowerShell-module for administering NLB. With this in mind I`ve created a script to set up a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=491&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>When documenting installations I perform I prefer to refer to scripts whenever possible, since this means less screenshots and a more concise reference.<br />
When deploying Exchange Server 2010 on Windows Server 2008 R2, we have access to the new PowerShell-module for administering NLB. With this in mind I`ve created a script to set up a NLB-cluster for Exchange Server 2010 CAS/Hub-roles in Windows Server 2008 R2.</p>
<p>The script are interactive and will perform the following:</p>
<ul>
<li>Ask for input for variables (cluster FQDN, operation mode, etc.)</li>
<li>Create the new cluster based on the variables provided by the user</li>
<li>Remove the default port rule</li>
<li>Add port rules for http, https, POP3, RPC, IMAP4, SMTP, MSExchange RPC and MSExchange Address Book Service</li>
<li>Ask for the addition of additional nodes. Loops through this procedure until the user answers no</li>
</ul>
<p>Prerequisites:</p>
<ul>
<li>Install the NLB-feature (may be accomplished from the ServerManager module in PowerShell by executing Add-WindowsFeature NLB)</li>
<li>Configure the NLB NIC`s with the approriate name, IP-address and subnetmask (and disable “Register this connection`s addresses in DNS”)</li>
<li>Manually add the cluster FQDN to DNS</li>
<li>Configure static ports for the MS Exchange RPC and MS Exchange Address Book Service (see links in the resource section below)</li>
<li>Eventually, configure your network switches/routers based on the cluster operation mode you choose</li>
</ul>
<p>Screenshot:</p>
<p> <a href="http://janegilring.files.wordpress.com/2010/05/image.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/05/image_thumb.png?w=644&#038;h=360" border="0" alt="image" width="644" height="360" /></a></p>
<p>The script are available from <a href="http://poshcode.org/1868" target="_blank">here</a>. In a later revision I`m considering adding support for installing the NLB-feature (I dropped it for now since it could only be offered on the server running the script from, not the additional nodes. This can however be accomplished using PowerShell Remoting), setting the dedicated IP-addresses for the NLB NICs and turn off “Register this connection`s addresses in DNS”.</p>
<p>If you don`t want the interactive experience, replace the “Read-Host” sections with the actual variable values.</p>
<p>Please let me know in the comments below if you have any suggestions for improvements.</p>
<p><strong>Related resources</strong></p>
<p>Exchange Server TechCenter: <a href="http://technet.microsoft.com/en-us/library/ff625247.aspx" target="_blank">Understanding Load Balancing in Exchange 2010</a><br />
Exchange Server TechCenter: <a href="http://technet.microsoft.com/en-us/library/ff625248.aspx" target="_blank">Load Balancing Requirements of Exchange Protocols</a><br />
Microsoft TechNet Wiki: <a href="http://social.technet.microsoft.com/wiki/contents/articles/configuring-static-rpc-ports-on-an-exchange-2010-client-access-server.aspx" target="_blank">Configuring Static RPC Ports on an Exchange 2010 Client Access Server</a><br />
Bhargav Shukla (MSFT): <a href="https://blogs.technet.com/bshukla/archive/2010/05/19/script-to-configure-static-ports-on-exchange-server-2010.aspx" target="_blank">Script to configure static ports on Exchange Server 2010</a><br />
Windows Server TechCenter: <a href="http://technet.microsoft.com/en-us/library/cc732855(WS.10).aspx" target="_blank">Network Load Balancing</a><br />
Microsoft&#8217;s Failover and Network Load Balancing Clustering Team Blog: <a href="http://blogs.msdn.com/clustering/archive/2009/10/28/9913877.aspx" target="_blank">PowerShell for NLB</a><br />
Kraft Kennedy: <a href="http://blogs.kraftkennedy.com/index.php/2009/11/25/configuring-nlb-for-exchange-2010-cas-load-balancing/" target="_blank">Configuring NLB for Exchange 2010 CAS Load Balancing</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/491/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/491/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/491/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=491&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/05/21/script-to-create-a-nlb-cluster-for-the-cas-role-in-exchange-server-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/05/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Script to spread Exchange mailboxes alphabetically across databases</title>
		<link>http://blog.powershell.no/2010/05/14/script-to-spread-exchange-mailboxes-alphabetically-across-databases/</link>
		<comments>http://blog.powershell.no/2010/05/14/script-to-spread-exchange-mailboxes-alphabetically-across-databases/#comments</comments>
		<pubDate>Fri, 14 May 2010 00:02:54 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Exchange Server 2010]]></category>
		<category><![CDATA[Exchange Server management]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows PowerShell]]></category>

		<guid isPermaLink="false">https://janegilring.wordpress.com/2010/05/14/script-to-spread-exchange-mailboxes-alphabetically-across-databases/</guid>
		<description><![CDATA[I recently needed to write a script to spread mailboxes in Exchange Server 2010 alphabetically across databases. In my scenario there were 5 databases, and I used a regex switch in PowerShell to assign each mailbox to the correct database based on the first character in the user`s displayname: switch -regex ($displayname.substring(0,1))     {        [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=487&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I recently needed to write a script to spread mailboxes in Exchange Server 2010 alphabetically across databases. In my scenario there were 5 databases, and I used a regex switch in PowerShell to assign each mailbox to the correct database based on the first character in the user`s displayname:</p>
<p>switch -regex ($displayname.substring(0,1))<br />
    {<br />
       &#8220;[A-F]&#8221; {$mailboxdatabase = &#8220;MDB A-F&#8221;}<br />
       &#8220;[G-L]&#8221; {$mailboxdatabase = &#8220;MDB G-L&#8221;}<br />
       &#8220;[M-R]&#8221; {$mailboxdatabase = &#8220;MDB M-R&#8221;}<br />
       &#8220;[S-X]&#8221; {$mailboxdatabase = &#8220;MDB S-X&#8221; }<br />
       &#8220;[Y-Z]&#8221; {$mailboxdatabase = &#8220;MDB Y-Z&#8221; }<br />
        default {$mailboxdatabase = &#8220;MDB Y-Z&#8221; }<br />
    }</p>
<p>The reason for the un-even spreading of letters are that the Norwegian language contains 3 extra letters, and I just assign those as well as other non-letter characters to the last database.</p>
<p>The script are available from <a href="http://poshcode.org/1839" target="_blank">here</a>. You may of course adjust the number of databases, the ranges of letters to use, which user attribute to sort against (e.g. lastname) and so on to fit your needs.</p>
<p>Although there are several common approaches to provisioning mailboxes across databases, be aware of the new mailbox provisioning load balancer in Exchange Server 2010. If you don`t specify a database when creating or moving a mailbox, the load balancer will automatically select the database with the least number of mailboxes. Check out <a href="http://www.mikepfeiffer.net/2010/04/testing-out-load-balanced-mailbox-provisioning-in-exchange-2010/" target="_blank">this</a> post by Mike Pfeiffer to see this feature in action.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/487/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=487&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/05/14/script-to-spread-exchange-mailboxes-alphabetically-across-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>
	</item>
		<item>
		<title>Exchange Server 2010 Cross-Forest migration</title>
		<link>http://blog.powershell.no/2010/04/23/exchange-server-2010-cross-forest-migration/</link>
		<comments>http://blog.powershell.no/2010/04/23/exchange-server-2010-cross-forest-migration/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 14:51:22 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Exchange 2003]]></category>
		<category><![CDATA[Exchange Server 2007]]></category>
		<category><![CDATA[Exchange Server 2010]]></category>
		<category><![CDATA[Exchange Server management]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Exchange Server Cross-Forest;ADMT]]></category>

		<guid isPermaLink="false">http://janegilring.wordpress.com/2010/04/23/exchange-server-2010-cross-forest-migration/</guid>
		<description><![CDATA[  In Exchange Server 2010 we can move mailboxes between forests when a forest trust are in place. This can be accomplished using the New-MoveRequest cmdlet from the Exchange Management Shell as well as from the Exchange Management Console. Note that remote mailbox moves from legacy Exchange versions only can be accomplished from the Exchange Management [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=467&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>In Exchange Server 2010 we can move mailboxes between forests when a forest trust are in place. This can be accomplished using the <a href="http://technet.microsoft.com/en-us/library/dd351123.aspx">New-MoveRequest</a> cmdlet from the Exchange Management Shell as well as from the Exchange Management Console. Note that remote mailbox moves from legacy Exchange versions only can be accomplished from the Exchange Management Shell.<br />
Before any move requests can be made there are some preparation that needs to be done in the target forest. The users from the source forest must be created in the target forest as mail-enabled users with some specific attributes. The mandatory attributes in addition to several others are described in <a href="http://technet.microsoft.com/en-us/library/ee633491.aspx">this</a> article on the Exchange Server TechCenter.</p>
<p>Microsoft has published a sample script, <a href="http://technet.microsoft.com/en-us/library/ee861103.aspx">Prepare-MoveRequest</a>, to assist with the preparation in the target forest. The script will create new mail-enabled users in the target forest with the required attributes from the source forest. While this works quite well, many administrators wants to use alternate methods such as Active Directory Migration Tool (ADMT) or Microsoft Identity Lifecycle Manager (ILM) to preserve additional attributes. Especially SIDHistory and passwords are common.<br />
When these tools are used, the Prepare-MoveRequest script got a parameter named –UseLocalObject which tells the script to convert the local object to the required mail-enabled user. While this might work fine depending on the environment, we`ve seen several administrators reporting problems when using the Prepare-MoveRequest script after ADMT-migration. When the script doesn`t find or match any local user due to some missing attributes it rather creates new mail-enabled users. There are no switch to disable the creation of new users if a local object to use aren`t found. I did a test in a lab-environment trying to use Prepare-MoveRequest with the –UseLocalObject parameter to prepare an ADMT-migrated object. This resulted in a new user being created with some random numbers added to the displayname and samaccountname.</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/image5.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/04/image_thumb5.png?w=468&#038;h=41" border="0" alt="image" width="468" height="41" /></a></p>
<p>As an alternative to using the Prepare-MoveRequest sample script I`ve created another PowerShell-script named Invoke-MoveRequest, available from <a title="here" href="http://poshcode.org/1838" target="_blank">here</a>. This script are intended for scenarios where the user objects are already migrated using e.g. ADMT. Note that you must exclude Exchange-attributes when using ADMT, otherwise attributes like msExchHomeServerName which we don`t want to be migrated will come along. Using this script we will migrate the necessary Exchange-attributes.</p>
<p>The script will do the following:</p>
<ol>
<li>Copy the attribute Mail from the source object to the target object</li>
<li>Copy the attribute mailNickname from the source object to the target object</li>
<li>Copy the attribute msExchMailboxGUID from the source object to the target object</li>
<li>Set the attribute msExchRecipientDisplayType to –2147483642</li>
<li>Set the attribute msExchRecipientTypeDetails to 128</li>
<li>Copy the attribute msExchUserCulture from the source object to the target object</li>
<li>Set the attribute msExchVersion to 44220983382016</li>
<li>Copy the attribute proxyAddresses from the source object to the target object</li>
<li>Set the target objects attribute targetAddress equilent to the source object`s  mail attribute</li>
<li>Set the attribute userAccountControl to 514</li>
<li>Run the Update-Recipient cmdlet on the target mail-enabled user to set LegacyExchangeDN and other default Exchange-attributes</li>
<li>Create a new move request</li>
<li>Enable the target object and unset “User must change password on next logon”</li>
</ol>
<p>The attributes copied and set are according to the list of mandatory attributes in the <a href="http://technet.microsoft.com/en-us/library/ee633491.aspx">TechNet-article</a> mentioned above. The mandatory attributes like DisplayName who not are added to the script are already migrated by ADMT. I also considered adding the LegacyExchangeDN from the target object as an X500 address to the source object`s proxyaddresses to keep mail-flow between the forests after migration, however, it turns out that this are taken care of by the New-MoveRequest cmdlet.<br />
All variables in the “Custom variables”-section on the top of the script must be set before running. The script are set up to process all users in a specified Organizational Unit in the source domain, however, you may customize this for your needs by e.g. using a CSV-file or setup some filtering using the Where-Object cmdlet. You may also copy additional attributes mentioned in the TechNet-article.<br />
The computer you`re running the script from must have the Exchange Management Tools for Exchange Server 2010 and the free <a href="http://www.quest.com/powershell/activeroles-server.aspx">Quest PowerShell Commands for Active Directory</a>.</p>
<p>The script needs additional functionality regarding logging and error-handling, I`ll update this post when I`ve done so. Feel free to further enhance the script yourself, and please let me know in the comments below if you have any suggestions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/467/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=467&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/04/23/exchange-server-2010-cross-forest-migration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Exchange Server 2007/2010 Update Rollups</title>
		<link>http://blog.powershell.no/2010/04/20/installing-exchange-server-20072010-update-rollups/</link>
		<comments>http://blog.powershell.no/2010/04/20/installing-exchange-server-20072010-update-rollups/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 20:03:41 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Exchange Server 2007]]></category>
		<category><![CDATA[Exchange Server 2010]]></category>
		<category><![CDATA[Exchange Server management]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[update rollup 1603;exchange update rollup installation guidelines]]></category>

		<guid isPermaLink="false">http://janegilring.wordpress.com/2010/04/20/installing-exchange-server-20072010-update-rollups/</guid>
		<description><![CDATA[Have you ever tried to install an Exchange Server Update Rollup which ended with an error message? I recently did some troubleshooting on installing Exchange Server 2010 Update Rollup 3 and picked up some experiences I would like to share, in addition to provide some general guidelines for installing Exchange Update Rollups. The installation may [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=453&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to install an Exchange Server Update Rollup which ended with an error message?</p>
<p>I recently did some troubleshooting on installing Exchange Server 2010 Update Rollup 3 and picked up some experiences I would like to share, in addition to provide some general guidelines for installing Exchange Update Rollups.</p>
<p>The installation may fail when installing either manually by downloading the installation package or by using Windows Update. Afterwards event 1024 are logged to the application log stating that the installation failed with the error code 1603:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/image.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/04/image_thumb.png?w=415&#038;h=290" border="0" alt="image" width="415" height="290" /></a></p>
<p>This really doesn`t help much, and in addition to the failed installation all Exchange-related services are now stopped and disabled, leaving the server offline.</p>
<p>Start by restoring the service-state. First, enable and start Windows Management Service using an elevated Windows PowerShell prompt:</p>
<p>Get-Service Winmgmt | Set-Service –StartupType Automatic; Get-Service Winmgmt | Start-Service</p>
<p>Then run the ServiceControl.ps1 located in the Exchange bin-folder and the pass it the argument “AfterPatch”:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/04/image_thumb1.png?w=444&#038;h=27" border="0" alt="image" width="444" height="27" /></a></p>
<p>The server should now be restored to an operational state. Next, download the Exchange Update Rollup if you haven`t done that in the first installation attempt. Next, retry the installation from the elevated PowerShell promt using msiexec with the /lv parameter:</p>
<p>msiexec /lv c:\temp\ex-ur3-install.log /update C:\temp\Exchange2010-KB981401-x64-en.msp</p>
<p>This will instruct the Windows Installer service to log verbose output from the installation to the file specified. After the installation fails you will see an event with event ID 1023 logged to the Application log:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/image2.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/04/image_thumb2.png?w=436&#038;h=303" border="0" alt="image" width="436" height="303" /></a></p>
<p>Next, open the log-file and look through it for error messages. The output in this file are really verbose, so you might want to ask for assistance in the <a href="http://social.technet.microsoft.com/Forums/en/exchangesoftwareupdate/threads">Exchange Software Updates Forum</a> on the <a href="http://technet.microsoft.com/en-us/exchange/bb219569">Exchange Server TechCenter</a>.</p>
<p>In my recent troubleshooting incident I found the following in the log-file:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/image3.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/04/image_thumb3.png?w=644&#038;h=27" border="0" alt="image" width="644" height="27" /></a></p>
<p>This indicates that the servicecontrol.ps1 script failed to run correctly. As stated in KB-article <a href="http://support.microsoft.com/kb/981474">981474</a> this is caused by the defined PowerShell execution polices. For the installation to succeed, oddly enough, any execution policies must be temporarily undefined.</p>
<p>To see if any PowerShell execution polices are defined on the system, run Get-ExecutionPolicy –List:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/clip_image002.jpg"><img style="display:inline;border-width:0;" title="clip_image002" src="http://janegilring.files.wordpress.com/2010/04/clip_image002_thumb.jpg?w=450&#038;h=60" border="0" alt="clip_image002" width="450" height="60" /></a></p>
<p>In this case, an ExecutionPolicy was defined both locally and in a Group Policy Object. I first cleared the Group Policy setting and then the local setting using the following command:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/clip_image003.png"><img style="display:inline;border-width:0;" title="clip_image003" src="http://janegilring.files.wordpress.com/2010/04/clip_image003_thumb.png?w=383&#038;h=20" border="0" alt="clip_image003" width="383" height="20" /></a></p>
<p>Execute gpupdate /force and verify that all the ExecutionPolicies are set to “Undefined”:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/clip_image005.jpg"><img style="display:inline;border-width:0;" title="clip_image005" src="http://janegilring.files.wordpress.com/2010/04/clip_image005_thumb.jpg?w=450&#038;h=60" border="0" alt="clip_image005" width="450" height="60" /></a></p>
<p>Redo the steps described above to restore service-state and retry the installation. In this case the installation now succeeded:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/04/image4.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/04/image_thumb4.png?w=244&#038;h=147" border="0" alt="image" width="244" height="147" /></a></p>
<p>At the end I will provide some general guidelines for installing Update Rollups in Exchange Server 2007/2010:</p>
<ol>
<li>Use elevated Administrator-privileges when running the installation either from Windows Update or by manually downloading the installation file.</li>
<li>Verify that all Execution Policies are set to “Undefined”.</li>
<li>Uninstall any interim Exchange hotfixes installed since the last Update Rollup.</li>
<li>Verify that the ExchangeSetupLogs directory are present on the system-drive. The installer uses this directory for saving service-state information.</li>
</ol>
<p>Please leave a comment below if you got any further guidelines. I will update this blog-post if I gather more information regarding installing Update Rollups.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/453/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/453/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/453/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=453&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/04/20/installing-exchange-server-20072010-update-rollups/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/clip_image002_thumb.jpg" medium="image">
			<media:title type="html">clip_image002</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/clip_image003_thumb.png" medium="image">
			<media:title type="html">clip_image003</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/clip_image005_thumb.jpg" medium="image">
			<media:title type="html">clip_image005</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/04/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Enable and configure Windows PowerShell Remoting using Group Policy</title>
		<link>http://blog.powershell.no/2010/03/04/enable-and-configure-windows-powershell-remoting-using-group-policy/</link>
		<comments>http://blog.powershell.no/2010/03/04/enable-and-configure-windows-powershell-remoting-using-group-policy/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 13:42:09 +0000</pubDate>
		<dc:creator>Jan Egil Ring</dc:creator>
				<category><![CDATA[Active Directory management]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Group Policy]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows PowerShell]]></category>
		<category><![CDATA[Windows Server 2003 R2]]></category>
		<category><![CDATA[Windows Server 2008]]></category>
		<category><![CDATA[Windows Server 2008 R2]]></category>
		<category><![CDATA[Windows Vista]]></category>
		<category><![CDATA[Windows XP]]></category>
		<category><![CDATA[Windows PowerShell Remoting]]></category>
		<category><![CDATA[WinRM]]></category>

		<guid isPermaLink="false">http://janegilring.wordpress.com/2010/03/04/enable-and-configure-windows-powershell-remoting-using-group-policy/</guid>
		<description><![CDATA[As you may know, Windows PowerShell 2.0 introduced a new remoting feature, allowing for remote management of computers. While this feature can be enabled manually (or scripted) with the PowerShell 2.0 cmdlet Enable-PSRemoting, I would recommend using Group Policy whenever possible. This guide will show you how this can be accomplished for Windows Vista, Windows [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=436&subd=janegilring&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>As you may know, Windows PowerShell 2.0 introduced a new remoting feature, allowing for remote management of computers.</p>
<p>While this feature can be enabled manually (or scripted) with the PowerShell 2.0 cmdlet <a href="http://technet.microsoft.com/en-us/library/dd819498.aspx">Enable-PSRemoting</a>, I would recommend using Group Policy whenever possible. This guide will show you how this can be accomplished for Windows Vista, Windows Server 2008 and above. For Windows XP and Windows Server 2003, running Enable-PSRemoting in a PowerShell startup script would be the best approach.</p>
<p>Windows PowerShell 2.0 and WinRM 2.0 shipped with Windows 7 and Windows Server 2008 R2. To take advantage of Windows PowerShell Remoting, both of these are required on the downlevel operating systems Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008. Both Windows PowerShell 2.0 and WinRM 2.0 are available for download <a href="http://support.microsoft.com/kb/968929">here</a>, as part of the Windows Management Framework (Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0). To deploy this update to downlevel operating systems I would recommend to use WSUS, which are described in detail in <a href="http://trycatch.be/blogs/roggenk/archive/2010/07/26/deploying-powershell-2-0-in-your-environment.aspx">this</a> blog post by Kurt Roggen.</p>
<p><strong>Group Policy Configuration</strong></p>
<p>Open the Group Policy Management Console from a domain-joined Windows 7 or Windows Server 2008 R2 computer.</p>
<p>Create or use an existing Group Policy Object, open it, and navigate to Computer Configuration-&gt;Policies-&gt;Administrative templates-&gt;Windows Components</p>
<p>Here you will find the available Group Policy settings for Windows PowerShell, WinRM and Windows Remote Shell:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb.png?w=244&#038;h=86" border="0" alt="image" width="244" height="86" /></a></p>
<p>To enable PowerShell Remoting, the only setting we need to configure are found under “WinRM Service”, named “Allow automatic configuration of listeners”:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image1.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb1.png?w=467&#038;h=427" border="0" alt="image" width="467" height="427" /></a></p>
<p>Enable this policy, and configure the IPv4 and IPv6 addresses to listen on. To configure WinRM to listen on all addresses, simply use *.</p>
<p>No other settings need to be configured, however, I`ve provided screenshots of the other settings so you can see what`s available:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image2.png"><img style="display:inline;border:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb2.png?w=390&#038;h=122" border="0" alt="image" width="390" height="122" /></a></p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image3.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb3.png?w=543&#038;h=135" border="0" alt="image" width="543" height="135" /></a></p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image4.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb4.png?w=543&#038;h=149" border="0" alt="image" width="543" height="149" /></a></p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image5.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb5.png?w=544&#038;h=66" border="0" alt="image" width="544" height="66" /></a></p>
<p>There is one more thing to configure though; the Windows Firewall.</p>
<p>You need to create a new Inbound Rule under Computer Configuration-&gt;Policies-&gt;Windows Settings-&gt;Windows Firewall with Advanced Security-&gt;Windows Firewall with Advanced Security-&gt;Inbound Rules:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image6.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb6.png?w=242&#038;h=244" border="0" alt="image" width="242" height="244" /></a></p>
<p>The WinRM port numbers are predefined as “Windows Remote Management”:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image7.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb7.png?w=521&#038;h=417" border="0" alt="image" width="521" height="417" /></a></p>
<p>With WinRM 2.0, the default http listener port <a href="http://blogs.msdn.com/wmi/archive/2009/07/22/new-default-ports-for-ws-management-and-powershell-remoting.aspx">changed</a> from TCP 80 to TCP 5985. The old port number are a part of the predefined scope for compatibility reasons, and may be excluded if you don`t have any legacy WinRM 1.1 listeners.</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image8.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb8.png?w=519&#038;h=415" border="0" alt="image" width="519" height="415" /></a></p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image9.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb9.png?w=522&#038;h=419" border="0" alt="image" width="522" height="419" /></a></p>
<p>When the rule are created, you may choose to make further restrictions, i.e. to only allow the IP addresses of your management subnet, or perhaps some specific user groups:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image10.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb10.png?w=320&#038;h=420" border="0" alt="image" width="320" height="420" /></a></p>
<p>Now that the firewall rule are configured, we are done with the minimal configuration to enable PowerShell Remoting using Group Policy.</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image11.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb11.png?w=644&#038;h=31" border="0" alt="image" width="644" height="31" /></a></p>
<p>On a computer affected by the newly configured Group Policy Object, run gpupdate and see if the settings were applied:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image12.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb12.png?w=591&#038;h=347" border="0" alt="image" width="591" height="347" /></a></p>
<p>As you can see, the listener indicates “Source*”GPO”, meaning it was configured from a Group Policy Object.</p>
<p>When the GPO have been applied to all the affected computers you are ready to test the configuration.</p>
<p>Here is a sample usage of PowerShell Remoting combined with the Active Directory-module for Windows PowerShell:</p>
<p><a href="http://janegilring.files.wordpress.com/2010/03/image13.png"><img style="display:inline;border-width:0;" title="image" src="http://janegilring.files.wordpress.com/2010/03/image_thumb13.png?w=644&#038;h=93" border="0" alt="image" width="644" height="93" /></a></p>
<p>The example are saving all computer objects in the Domain Controller Organization Unit in a variable. Then, a foreach-loop are invoking a scriptblock, returning the status of the Netlogon-service on all of the Domain Controllers.</p>
<p><strong>Summary</strong></p>
<p>We`ve now had a look on how to enable and configure PowerShell Remoting using Group Policy.<br />
There are an incredible number of opportunities opening up with the new Remoting feature in Windows PowerShell 2.0. For a complete walkthrough on how you can use this new feature, I would like to recommend the excellent <a href="http://powershell.com/cs/media/p/4908.aspx">Administrator&#8217;s Guide to Windows PowerShell Remoting</a> written by Dr. Tobias Weltner, Aleksandar Nikolic and Richard Giles.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/janegilring.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/janegilring.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/janegilring.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/janegilring.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/janegilring.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/janegilring.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/janegilring.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/janegilring.wordpress.com/436/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/janegilring.wordpress.com/436/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/janegilring.wordpress.com/436/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.powershell.no&blog=5892504&post=436&subd=janegilring&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.powershell.no/2010/03/04/enable-and-configure-windows-powershell-remoting-using-group-policy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ed08d635415486b87539a6e5a81982b7?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">janegilring</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://janegilring.files.wordpress.com/2010/03/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>