<?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>msunified.net &#187; PowerShell</title>
	<atom:link href="http://msunified.net/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://msunified.net</link>
	<description>Technical blog about Exchange, OCS and Lync by Ståle Hansen</description>
	<lastBuildDate>Tue, 07 Feb 2012 11:13:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='msunified.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/87139ddc4ba9c9960cf07f9364dfc9f4?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>msunified.net &#187; PowerShell</title>
		<link>http://msunified.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://msunified.net/osd.xml" title="msunified.net" />
	<atom:link rel='hub' href='http://msunified.net/?pushpress=hub'/>
		<item>
		<title>Lync Server and PowerShell &#8211; My favourite features, oneliners and scripts</title>
		<link>http://msunified.net/2012/01/18/lync-server-and-powershell-my-favourite-features-oneliners-and-scripts/</link>
		<comments>http://msunified.net/2012/01/18/lync-server-and-powershell-my-favourite-features-oneliners-and-scripts/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 09:12:37 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Lync Server 2010]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=3129</guid>
		<description><![CDATA[I was preparing to speak at Microsoft Technology User Group (MTUG) here in Norway at the PowerShell Script Club. My session for the night was going to be Lync Server Management Shell. First I thought I was not going to prepare anything and wing the whole session. The more I thought about it, winging any session that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=3129&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was preparing to speak at <a href="http://mtug.no/nb-no/forside.aspx" target="_blank">Microsoft Technology User Group (MTUG)</a> here in Norway at the PowerShell Script Club. My session for the night was going to be Lync Server Management Shell. First I thought I was not going to prepare anything and wing the whole session. The more I thought about it, winging any session that I am going to give in front of an audience is seldom a good idea. So I thought, ok make a blog post instead. I will here add my favourite features, oneliners and scripts that I have found working with Lync Server. I will update this blogpost as I remember and find new features, oneliners and scripts. Please let me know of your best PowerShell tricks in Lync.</p>
<pre>Last updated 17.01.2012</pre>
<h1>Connecting</h1>
<p>In addition to log on the Lync Server and open Lync Server Management Shell you can also access and work with Lync through remote PowerShell which came available in V2. Here is what you need to connect. The url could be your external webservices url as well</p>
<p><pre class="brush: powershell;">
$session = New-PSSession -ConnectionUri https://lync-admin.contoso.local/OcsPowershell -Credential (Get-Credential)
Import-PSSession -Session $session
</pre></p>
<h1>Finding cmdlets</h1>
<p>There are several ways to find cmdlets in Lync. If you like the graphical representation like a mind map there is some good ones created by <a href="http://lyncdup.com/tom-arbuthnot/" target="_blank">MVP Tom Arbuthnot </a></p>
<ul>
<li><a href="http://lyncdup.com/Lync2010PowerShellCmdletsbyVerbMindmap.swf" target="_blank">Lync 2010 PowerShell Commandlets by Verb</a></li>
<li><a href="http://lyncdup.com/Lync2010PowerShellcmdletsbyCategoryMindmap.swf" target="_blank">Lync 2010 PowerShell Commandlets by Category</a></li>
</ul>
<p>In PowerShell there is some cmdlets available as well when finding what is available</p>
<p><pre class="brush: powershell;">
#Get all cmdlets for Lync that contains -Cs
Get-Command *-Cs* -CommandType cmdlet -Module Lync
#Get all cmdlets that contains user
Get-Command *user* -CommandType cmdlet -Module Lync

#When you find the cmdlet you want to use find the syntax on how to use it
Get-Help Get-CsUser -Examples
#Use -Online to open the TechNet website for that cmdlet
Get-Help Get-CsUser -Online

#Looking for a specific setting to set and don't know which cmdlet that can modify it use the below code
$params = Get-Command -CommandType Cmdlet *-Cs* | % { $n = $_.Name ; $_.Parameters.Values | % { Add-Member -in $_ noteproperty CmdletName $n; $_ } }
$params | where { $_.Name -like &quot;*meeting*&quot; } | select Name,CmdletName
#This is cool, found the trick over at http://blogs.technet.com/b/csps/archive/2010/06/14/howtofindsetting.aspx
</pre></p>
<h1>Cmdlets</h1>
<p>There are some cmdlets I use more than others and find useful. Let me know what is your most used cmdlets.</p>
<p><pre class="brush: powershell;">
#List a lot of the topology information, here you can sort to find URLs, ports and servernames configured
Get-CsService

#List all pools in your topology, useful for finding Front End pool name, when you forget it
Get-CsPool

#The only policy that is not available in Lync Control Panel, lot of nice features can be configured here
Get-CsClientPolicy

#Update the AddressBook files
Update-CsAddressBook

#List the CMS replication status for each Lync Server
Get-CsManagementStoreReplicationStatus
</pre></p>
<h1>Oneliners</h1>
<p>The most used oneliners that I use</p>
<p><pre class="brush: powershell;">
#Find what Lync Services are running
Get-CsWindowsService -ExcludeActivityLevel | ft Name, Status
#Start any stopped services
Get-CsWindowsService -ExcludeActivityLevel | where {$_.Status -like &quot;Stopped&quot;} | Start-CsWindowsService

#Find all users that are enabled for Lync and have a LineUri, sort them by LineUri, display displayname and LineUri
Get-CsUser -Filter {LineURI -ne $Null} | sort -Property LineURI | ft DisplayName,LineURI

#Quickly find and open the share folder for the Lync pool
Invoke-Item(Get-CsService -FileStore | Select-Object -ExpandProperty UncPath)
</pre></p>
<h1>Scripts</h1>
<p>There are a lot of scripts that is created and expand on Lync Server PowerShell functionality and and some that simplifies working with Lync as well as monitors the solution. Below are some of my favourite scripts. Please let me know of other epic scripts out there.</p>
<p><a href="http://msunified.net/lyncdownloads/script-set-lync2010windows2008r2features-ps1/" target="_blank">Set-Lync2010Features.ps1</a></p>
<p style="padding-left:30px;">A script to install prerequisites on Server 2008 R2 before you start install Lync Server on the OS.  You can download the resource kit tools, Silverlitght and other tools easily. You even have som post deployment options in the script as well. This script is highly recommended and I use it in every deployment.</p>
<p><a href="http://msunified.net/lyncdownloads/script-list-unusednumbers-ps1/">List-UnusedNumbers.ps1</a></p>
<p style="padding-left:30px;">A scripts that read unassigned numbers and depends on you having put you entire number serie there. It will find all numbers assigned to users, devices and features in Lync and find what numbers are available in any given unassigned numbers series. This is a script that saves you the pain of managing available numbers in an excel sheet.</p>
<p><a href="http://msunified.net/lyncdownloads/script-set-globalvoicerouting-ps1/">Set-GlobalVoiceRouting.ps1</a></p>
<p style="padding-left:30px;">This script is for demo or initial deployments only. It is created for norwegian rules and genereates an easy way to dial out through one gateway and has the usual normalization rules for Norway. To edit the script and find the nomralization rules for your country see the <a href="http://www.lyncoptimizer.com/" target="_blank">Dialing Rule Optimizer</a>.</p>
<p><a href="http://msunified.net/lyncdownloads/script-reset-userpolicies-ps1/">Reset-UserPolicies.ps1</a></p>
<p style="padding-left:30px;">This script is used in an OCS to Lync migration scenario. It will reset all policies to $Null so that they use Global or Pool level policies for External access, Voice Policy and so on. The reason for this is that all users should use what you define for Lync and not what you inherit from OCS.</p>
<p><a href="http://www.ehloworld.com/269" target="_blank">Get-CsConnections.ps1</a></p>
<p style="padding-left:30px;">This script lists user connections, client versions and the distribution of users in a load balanced scenario</p>
<p><a title="Permanent Link to Monitoring OCS and Lync Peak Call Capacity" href="http://www.confusedamused.com/notebook/monitoring-ocs-and-lync-peak-call-capacity/" rel="bookmark">Monitoring OCS and Lync Peak Call Capacity</a></p>
<p style="padding-left:30px;">Script to monitor how many concurrent calls a particular OCS or Lync Mediation Server is handling. The script grabs the counters for inboud and outbound calls, parses their values, adds them together, and dumps the output into a CSV file. A good tool to find how many concurrent calls you have on your deployment</p>
<p><a href="http://marjuss.wordpress.com/2011/12/16/lync-corporate-photo-update-script/" target="_blank">Update-AdPhoto.ps1 </a></p>
<p style="padding-left:30px;">A script that enables you to import AD photos from file and store it in the thumbnailPhoto attribute. It is a central feature in Lync to show a photo of users</p>
<p><a href="http://www.codesalot.com/2012/adding-external-contacts-to-the-lync-addressbook/" target="_blank">New-SipContact.ps1</a></p>
<p style="padding-left:30px;">A script to enable users to search for external contacts and Video Conferencing endpoints from Lync. It creates a contact in AD and adds the SIP address to the msRTCSIP-PrimaryUserAddress so it will be synced to the addressbook in Lync.</p>
<h1>Scripting Tips</h1>
<p>There is a lot of techniques used for scripting. The best script tips I know of I will list here.</p>
<h4>Use Write-Debug</h4>
<p>Lets you easilly define debug lines that can test variables and logic in you script that is good to use when developing the script but that not need to be there when it is used in production. When you want to debug the script you change the $DebugPreference from &#8216;SilentlyContinue&#8217; to &#8216;Continue&#8217;. Then all Write-Debug lines will be displayed.</p>
<p><pre class="brush: powershell;">
$DebugPreference = 'Continue'

$var = Read-Host &quot;Enter a computer name&quot;
Write-Debug “’$var’ contains $var“

$DebugPreference = 'SilentlyContinue'
</pre></p>
<h4>Use Functions</h4>
<p>Functions are scripts in scripts. If it is certain things you need to do more than once in you script, make it a function with an input and output. I have also seen functions being used to organize your script in a better way to make it easier and more ordered to view.</p>
<p><pre class="brush: powershell;">
Function Do-Something ($computername,$domainname) {
	# function code goes here
}
</pre></p>
<h1>Resources</h1>
<p>The Official Lync PowerShell Blog: <a href="http://blogs.technet.com/b/csps/p/categories.aspx">http://blogs.technet.com/b/csps/p/categories.aspx</a><br />
The Official Lync PowerShell Blog Cmdlet Descriptions: <a href="http://blogs.technet.com/b/csps/archive/2010/07/16/refallcmdlets.aspx">http://blogs.technet.com/b/csps/archive/2010/07/16/refallcmdlets.aspx</a><br />
MVP Pat Richard&#8217;s Blog: <a href="http://www.ehloworld.com/category/powershell">http://www.ehloworld.com/category/powershell</a></p>
<br />Filed under: <a href='http://msunified.net/category/lync-server-2010/'>Lync Server 2010</a> Tagged: <a href='http://msunified.net/tag/lync-server-2010/'>Lync Server 2010</a>, <a href='http://msunified.net/tag/powershell/'>PowerShell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/3129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/3129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/3129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/3129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/3129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/3129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/3129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/3129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/3129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/3129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/3129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/3129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/3129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/3129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=3129&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2012/01/18/lync-server-and-powershell-my-favourite-features-oneliners-and-scripts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>
	</item>
		<item>
		<title>Change the default Calendar AccessRight on all mailboxes to Reviewer</title>
		<link>http://msunified.net/2011/09/30/change-the-default-calendar-accessright-on-all-mailboxes-to-reviewer/</link>
		<comments>http://msunified.net/2011/09/30/change-the-default-calendar-accessright-on-all-mailboxes-to-reviewer/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 12:13:11 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Office 365]]></category>
		<category><![CDATA[Exchange Online]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=2822</guid>
		<description><![CDATA[Back in july 2010 I created a script to set the default AccessRight to Reviewer for Exchange 2010. This was a new feature for Exchange 2010 that we could use the command Set-MailboxFoldersPermission to change AccessRights on specific folders on the server level. As the calendar is a folder we now could do this organization [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=2822&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Back in july 2010 I created a script to set the default AccessRight to Reviewer for Exchange 2010. This was a new feature for Exchange 2010 that we could use the command Set-MailboxFoldersPermission to change AccessRights on specific folders on the server level. As the calendar is a folder we now could do this organization wide using PowerShell.</p>
<p>The reason for creating this script is when migrating customers in Norway most of them want to allow everyone to use side by side calendaring in Outlook and Oulook Web App. In Exchange 2003/2007 we needed to instruct users how to set Default to Reviewer. This script sets it for all users. The script works for both Exchange Online and Exchange Server 2010. For Exchange 2007 check out this post on how to do it: <a href="http://exchangeshare.wordpress.com/2008/05/27/faq-give-calendar-read-permission-on-all-mailboxes-pfdavadmin/">http://exchangeshare.wordpress.com/2008/05/27/faq-give-calendar-read-permission-on-all-mailboxes-pfdavadmin/</a></p>
<p>Get the script here: <a href="http://msunified.net/exchange-downloads/script-set-calendarpermissions-ps1/">http://msunified.net/exchange-downloads/script-set-calendarpermissions-ps1/</a></p>
<p>What the script does</p>
<p><a href="http://msunified.net/exchange-downloads/script-set-calendarpermissions-ps1/" target="_blank"><img class="alignnone size-full wp-image-2828" style="border:0 currentColor;" title="Set-CalendarPremissions.ps1" src="http://stalehansen.files.wordpress.com/2011/09/01script.png" alt="" width="629" height="219" /></a></p>
<p>As the picture shows you get three menu items.</p>
<ol>
<li>Will set the permission on all users and resources</li>
<li>Will set the permission on all users and reources created the last 30 days</li>
<li>Will give a user you specify Editor access to a mailbox you specify</li>
<ul>
<li>This is good for switchboard or secretary functions</li>
</ul>
</ol>
<p>How to run the script against an Exchange Online environment</p>
<ul>
<li>Connect to Exchange Online through PowerShell Remoting</li>
</ul>
<p><pre class="brush: powershell;">
$cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $cred -Authentication Basic -AllowRedirection
Import-PSSession $Session
</pre></p>
<ul>
<li>Set Execution Policy to unrestricted</li>
</ul>
<p><pre class="brush: powershell;">
Set-ExecutionPolicy Unrestricted
</pre></p>
<ul>
<li>Run the script by copying the script, saving it as a ps1 file, navigate to it in PowerShell and start typing set-Cal and hit TAB to use TAB completion</li>
</ul>
<p><pre class="brush: powershell;">
.\Set-CalendarPremissions.ps1
</pre></p>
<p><strong>Resources</strong></p>
<p>Administering Microsoft Office 365 using Windows PowerShell:<strong> <a href="http://blog.powershell.no/2011/05/09/administering-microsoft-office-365-using-windows-powershell/">http://blog.powershell.no/2011/05/09/administering-microsoft-office-365-using-windows-powershell/</a></strong></p>
<br />Filed under: <a href='http://msunified.net/category/exchange-2010/'>Exchange 2010</a>, <a href='http://msunified.net/category/office-365/'>Office 365</a> Tagged: <a href='http://msunified.net/tag/exchange-2010/'>Exchange 2010</a>, <a href='http://msunified.net/tag/exchange-online/'>Exchange Online</a>, <a href='http://msunified.net/tag/office-365/'>Office 365</a>, <a href='http://msunified.net/tag/powershell/'>PowerShell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/2822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/2822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/2822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/2822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/2822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/2822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/2822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/2822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/2822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/2822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/2822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/2822/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/2822/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/2822/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=2822&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2011/09/30/change-the-default-calendar-accessright-on-all-mailboxes-to-reviewer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>

		<media:content url="http://stalehansen.files.wordpress.com/2011/09/01script.png" medium="image">
			<media:title type="html">Set-CalendarPremissions.ps1</media:title>
		</media:content>
	</item>
		<item>
		<title>Script to enable Global Voice Routing in Lync Server 2010</title>
		<link>http://msunified.net/2011/02/18/script-to-enable-global-voice-routing/</link>
		<comments>http://msunified.net/2011/02/18/script-to-enable-global-voice-routing/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 14:09:04 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Lync Server 2010]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=2176</guid>
		<description><![CDATA[With Lync Server 2010 more and more deployments involve Enterprise Voice and Pstn access. When implementing in pilots and single site environments my customers tend to want everyone activated being able to dial to the Pstn network regardless of location or position. With this in mind I have created a script to easily implement appropriate [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=2176&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>With Lync Server 2010 more and more deployments involve Enterprise Voice and Pstn access. When implementing in pilots and single site environments my customers tend to want everyone activated being able to dial to the Pstn network regardless of location or position.</p>
<p>With this in mind I have created a script to easily implement appropriate Nomralization Rules, Pstn Usage, Route with Gateway and Voice Policy without any typos. Since all this is intended for global use and the scope is global, all users get access to the Dial Plan and Route. All calls and numbers are routed through a single Gateway.</p>
<p>The script is run at your <span style="text-decoration:underline;">own risk</span>, tips and feedback is most appreciated</p>
<p>View and download the script here: <a href="http://msunified.net/lyncdownloads/script-set-globalvoicerouting-ps1/">http://msunified.net/lyncdownloads/script-set-globalvoicerouting-ps1/</a></p>
<p><strong>Intended Scenario</strong></p>
<ul>
<li>One CentralSite</li>
<li>One PstnGateway</li>
<li>All Enterprise Voice users will be able to call</li>
<li>All previous configuration will be removed</li>
</ul>
<p><strong>To have a clean as possible configuration some existing default configuration is removed</strong></p>
<ul>
<li>The &#8220;Prefix All&#8221; Normalization Rule on the Global Dial Plan</li>
<li>The Local Route under Routes is removed</li>
<li>All the default PstnUsage records are removed</li>
<li>Running the script several times does no harm, all error messages are suppressed</li>
</ul>
<p><strong>The Script creates the following</strong></p>
<ul>
<li>Four Norwegian Nomralization Rules under the Global Dial Plan
<ul>
<li>No need to Grant users with usage</li>
<li>Just change and adapt them to your own country/environment before running the script</li>
</ul>
</li>
<li>Creates PstnUsage named Global</li>
<li>Edits the Global Voice Policy and adds PstnUsage Global</li>
<li>Finds the PstnGateway configured in the Topology Builder
<ul>
<li>Only one is added</li>
</ul>
</li>
<li>Creates a new Route named GlobalRoute and adds Global as PstnUsage and the PstnGateway found earlier</li>
<li>Creates a VoiceTestConfiguration for one of the normalization rules</li>
<li>Runs the Test</li>
<li>Displays the result</li>
</ul>
<p><strong>Screenshot</strong></p>
<p><a href="http://msunified.net/lyncdownloads/script-set-globalvoicerouting-ps1/"><img class="size-full wp-image-2177 alignnone" style="border:0;" title="Set-GlobalVoiceRouting" src="http://stalehansen.files.wordpress.com/2011/02/set-globalvoicerouting.png" alt="" width="671" height="330" /></a></p>
<br />Filed under: <a href='http://msunified.net/category/lync-server-2010/'>Lync Server 2010</a> Tagged: <a href='http://msunified.net/tag/lync-server-2010/'>Lync Server 2010</a>, <a href='http://msunified.net/tag/powershell/'>PowerShell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/2176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/2176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/2176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/2176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/2176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/2176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/2176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/2176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/2176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/2176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/2176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/2176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/2176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/2176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=2176&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2011/02/18/script-to-enable-global-voice-routing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>

		<media:content url="http://stalehansen.files.wordpress.com/2011/02/set-globalvoicerouting.png" medium="image">
			<media:title type="html">Set-GlobalVoiceRouting</media:title>
		</media:content>
	</item>
		<item>
		<title>Script to find available telephone numbers in Lync Server 2010</title>
		<link>http://msunified.net/2011/01/17/script-to-find-available-telephone-numbers-in-lync-server-2010/</link>
		<comments>http://msunified.net/2011/01/17/script-to-find-available-telephone-numbers-in-lync-server-2010/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 02:37:55 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Lync Server 2010]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Unassigned Numbers]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=2083</guid>
		<description><![CDATA[Having worked on a couple of Enterprise Voice deployments since the launch of Lync Server 2010 I have been missing a feature that I honestly thought would be incorporated by launch. It is the ability to find unused available numbers in a given number range assigned to the Lync Server based on Unassigned Numbers. I even hoped [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=2083&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having worked on a couple of Enterprise Voice deployments since the launch of Lync Server 2010 I have been missing a feature that I honestly thought would be incorporated by launch. It is the ability to find unused available numbers in a given number range assigned to the Lync Server based on Unassigned Numbers. I even hoped it would be possible to assign a teluri to users through a drop down list in the Silverlight GUI since the information is available in the server. I hope this will be available in a later Service Pack or Cumulative Update.</p>
<p>Since this is a feature I really want, I have tried to create a PowerShell Script to find out how many numbers are available in any given number range and what they are. First of all I want to declare that I am a PowerShell novice so my syntax may not be that optimized. The script works, though there&#8217;s a lot of variables and loops that I am sure could be done better. The script does the following:</p>
<ul>
<li>It goes through each entry in Unassigned Phone Numbers that needs to be populated with all numbers series available to the Lync Server
<ul>
<li>See TechNet on how to do it: <a href="http://technet.microsoft.com/en-us/library/gg412748.aspx">http://technet.microsoft.com/en-us/library/gg412748.aspx</a></li>
<li>Also see TechNet on how to configure an Announcement required by Unassagnied Numbers: <a href="http://technet.microsoft.com/en-us/library/gg412783.aspx">http://technet.microsoft.com/en-us/library/gg412783.aspx</a></li>
</ul>
</li>
<li>Then it gets all teluri&#8217;s for all the users, dial-in conferencing and Exchange UM contacts
<ul>
<li>I didn&#8217;t find the response group command to get the teluri while I was at it, will add this in an update</li>
</ul>
</li>
<li>Then the string gets &#8220;washed&#8221; for &#8220;tel:+47&#8243; where 47 is the hardcoded region code for Norway
<ul>
<li>The string also get &#8220;washed&#8221; for any extension numbers</li>
</ul>
</li>
<li>After that a new string gets created to get rid of property types and so on</li>
<li>I use Compare-Object to compare the Unassigned Number array with the used numbers
<ul>
<li>Run a check to find what numbers where not used and count them</li>
</ul>
</li>
<li style="text-align:left;">Then I find out what the total number of unused numbers are and write the output</li>
</ul>
<p style="text-align:left;"><a href="http://msunified.net/lyncdownloads/script-list-unusednumbers-ps1/"><img class="alignnone size-full wp-image-2084" style="border:0;" title="List-UnusedNumbers.ps1" src="http://stalehansen.files.wordpress.com/2011/01/list-unassignednumbers.png" alt="" width="603" height="301" /></a></p>
<p style="text-align:left;">I hope this script will come useful to anyone who needs this feature and that others can use this to and adapt it to their needs. Please share any improvements that could be made to the script. Enjoy!</p>
<p><a href="http://msunified.net/lyncdownloads/script-list-unusednumbers-ps1/">http://msunified.net/lyncdownloads/script-list-unusednumbers-ps1/</a></p>
<br />Filed under: <a href='http://msunified.net/category/lync-server-2010/'>Lync Server 2010</a> Tagged: <a href='http://msunified.net/tag/lync-server-2010/'>Lync Server 2010</a>, <a href='http://msunified.net/tag/powershell/'>PowerShell</a>, <a href='http://msunified.net/tag/unassigned-numbers/'>Unassigned Numbers</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/2083/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/2083/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/2083/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/2083/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/2083/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/2083/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/2083/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/2083/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/2083/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/2083/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/2083/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/2083/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/2083/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/2083/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=2083&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2011/01/17/script-to-find-available-telephone-numbers-in-lync-server-2010/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>

		<media:content url="http://stalehansen.files.wordpress.com/2011/01/list-unassignednumbers.png" medium="image">
			<media:title type="html">List-UnusedNumbers.ps1</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing Lync Server 2010 Prerequisites on Windows Server 2008 R2</title>
		<link>http://msunified.net/2010/11/23/installing-lync-server-2010-prerequisites-on-windows-server-2008-r2/</link>
		<comments>http://msunified.net/2010/11/23/installing-lync-server-2010-prerequisites-on-windows-server-2008-r2/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 10:49:24 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Lync Server 2010]]></category>
		<category><![CDATA[Lync Server Prerequisites]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Server 2008 R2]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=1940</guid>
		<description><![CDATA[When installing Lync Server 2010 some roles requires specific Windows Features to be installed. The features are about the same as for OCS 2007 R2. NOTE: This article will be updated when more information and requirements become available and necessary. Last update 02.12.2010 Part One – Prerequisites required on all server roles Open PowerShell as administrator [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1940&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When installing Lync Server 2010 some roles requires specific Windows Features to be installed. The features are about the same as for <a href="http://msunified.net/2010/04/09/installing-ocs-2007-r2-prerequisites-on-windows-server-2008-r2/">OCS 2007 R2. </a></p>
<p><em><strong>NOTE:</strong> This article will be updated when more information and requirements become available and necessary. Last update 02.12.2010</em></p>
<h2><strong>Part One – Prerequisites required on all server roles</strong></h2>
<ul>
<li>Open PowerShell as administrator and run the following commands</li>
<li><em>Import-Module ServerManager</em></li>
<li><em>Add-WindowsFeature NET-Framework-Core,Telnet-Client</em>
<ul>
<li>This installs the following features
<ul>
<li>[NET-Framework-Core] – .Net Framework 3.5 SP1</li>
<li>[Telnet-Client] – Telnet Client (recommended not required)</li>
</ul>
</li>
<li>For .Net Framework 3.5 SP1 download the following updates
<ul>
<li><a id="ctl00_MTCS_main_ctl31_ctl00_ctl13_ctl00_ctl07_ctl00_ctl01" href="http://go.microsoft.com/fwlink/?linkid=197396" target="_blank">http://go.microsoft.com/fwlink/?linkid=197396</a>, which addresses a set of known application compatibility issues</li>
<li><a id="ctl00_MTCS_main_ctl31_ctl00_ctl13_ctl00_ctl07_ctl00_ctl02" href="http://go.microsoft.com/fwlink/?linkid=197397" target="_blank">http://go.microsoft.com/fwlink/?linkid=197397</a>, which addresses a file association issue for XPS document</li>
</ul>
</li>
</ul>
</li>
<li>Install the prerequisites for the specific role as described in <strong>Part Three</strong>
<ul>
<li>A <strong>PowerShell</strong> script for installing the prerequisites: <a href="http://msunified.net/lyncdownloads/script-set-lync2010windows2008r2features-ps1/">SCRIPT: Set-Lync2010Windows2008R2Features.ps1</a></li>
</ul>
</li>
<li>Run Windows Update untill everything is updated</li>
<li>Install the Lync Server 2010 binaries for the role you are installing</li>
<li>Do post installation tasks as described in <strong>Part Two</strong></li>
</ul>
<h2><strong>Part Two – What to install AFTER Lync Server 2010 is installed</strong></h2>
<p><em>I describe it here so it is more accessible rather than in the end of the post</em></p>
<ul>
<li>Download and install the <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=80cc5ce7-970d-4fd2-8731-d5d7d0829266&amp;displaylang=en" target="_blank">Lync Server 2010 Resource Kit Tools</a></li>
<li>Download and install the latest updates for Lync Server 2010 (Link can be found here: <a href="http://msunified.net/lyncdownloads/">http://msunified.net/lyncdownloads/)</a></li>
</ul>
<h2><strong>Part Three – Commands to install prerequisites for Lync Server 2010 on Windows Server 2008 R2</strong></h2>
<p><strong>Front End, Director and Group Chat Server Roles on Windows Server 2008 R2</strong></p>
<p><em><strong>NOTE: </strong>To be able to run schema, forest and domain prep from the Front End Server you need to have the Remote Server Administrative Tools [RSAT-ADDS] installed. It is only required on the first Front End server in you organization. For more information on preparing AD see: <a href="http://technet.microsoft.com/en-us/library/gg398607.aspx">http://technet.microsoft.com/en-us/library/gg398607.aspx</a></em></p>
<ul>
<li>Open PowerShell as administrator and run the following commands</li>
<li><em>Import-Module ServerManager</em></li>
<li><em>Add-WindowsFeature RSAT-ADDS,Web-Static-Content,Web-Default-Doc,Web-Http-Errors,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Http-Logging,Web-Log-Libraries,Web-Http-Tracing,Web-Windows-Auth,Web-Filtering,Web-Stat-Compression,Web-Mgmt-Console,Web-Scripting-Tools,Web-Client-Auth,Desktop-Experience</em></li>
</ul>
<p>Installs the following components:</p>
<ul>
<li>[RSAT-ADDS] &#8211; Remote Server Administrative Tools</li>
<li>[Web-Static-Content] &#8211; Static Content</li>
<li>[Web-Default-Doc] &#8211; Default Document</li>
<li>[Web-Http-Errors] &#8211; HTTP Errors</li>
<li>[Web-Asp-Net] &#8211; ASP.NET</li>
<li>[Web-Net-Ext] &#8211; .NET Extensibility</li>
<li>[Web-ISAPI-Ext] &#8211; Internet Server API (ISAPI) Extensions</li>
<li>[Web-ISAPI-Filter] &#8211; ISAPI Filters</li>
<li>[Web-Http-Logging] &#8211; HTTP Logging</li>
<li>[Web-Log-Libraries] &#8211; Logging Tools</li>
<li>[Web-Http-Tracing] &#8211; Tracing</li>
<li>[Web-Windows-Auth] &#8211; Windows Authentication</li>
<li>[Web-Filtering] &#8211; Request Filtering</li>
<li>[Web-Stat-Compression] &#8211; Static Content Compression</li>
<li>[Web-Mgmt-Console] &#8211; IIS Management Console</li>
<li>[Web-Scripting-Tools] &#8211; IIS Management Scripts and Tools</li>
<li>[Web-Client-Auth] &#8211; Client Certificate Mapping Authentication</li>
<li>Anonymous Authentication (This is installed by default when IIS is installed)</li>
<li>[Desktop-Experience] &#8211; Desktop Experience</li>
</ul>
<p><em><strong>NOTE:</strong> Installing on Server 2008 R2 SP1, you need to do this step manually. All Front End Servers and Standard Edition servers where conferencing will be deployed must have the Windows Media Format Runtime installed. The Windows Media Format Runtime is required to run the Windows Media Audio (.wma) files that the Call Park, Announcement, and Response Group applications play for announcements and music. Thats why Desktop Experience is installed. If you only want to install the correct runtime run the command below:</em></p>
<ul>
<li><code><span style="font-family:Georgia;">Run using Command Prompt as administrator</span></code></li>
<li><code><span style="font-family:Georgia;">Requires reboot</span></code></li>
<li>%systemroot%\system32\dism.exe /online /add-package<br />
/packagepath:%windir%\servicing\Packages\Microsoft-Windows-Media-Format-Package~31bf3856ad364e35~amd64~~6.1.7601.17514.mum<br />
/ignorecheck<br />
<code></code></li>
</ul>
<p><strong>Mediation Server Role on Windows Server 2008 R2</strong></p>
<ul>
<li><em></em><em></em>No additional features required for mediation</li>
</ul>
<p><strong>EDGE Server Role on Windows Server 2008 R2</strong></p>
<ul>
<li>Need one aditional hotfix for Lync EDGE Server Role.
<ul>
<li>Note: This hotfix is included in SP1 for Server 2008 R2</li>
<li>Windows Server 2008 R2 update available from Microsoft Knowledge Base article 2028827, &#8220;The applications that use the TDI driver for network traffic may stop responding in Windows Server 2008 R2 or in Windows 7,&#8221; at <a id="ctl00_MTCS_main_ctl08_ctl00_ctl01" href="http://go.microsoft.com/fwlink/?LinkId=205459" target="_blank">http://go.microsoft.com/fwlink/?LinkId=205459</a></li>
</ul>
</li>
</ul>
<p><strong>Monitoring and Archiving Server Roles on Windows Server 2008 R2</strong></p>
<p><em></em><em><strong>NOTE:</strong> If Monitoring og Archiving is deployed in the topology, all server roles must install the below features, including the Monitoring and Archiving Servers</em></p>
<ul>
<li>Open PowerShell as administrator and run the following commands</li>
<li><em>Import-Module ServerManager</em></li>
<li><em></em><em>Add-WindowsFeature msmq-server,msmq-directory</em></li>
</ul>
<p>Installs the following components:</p>
<ul>
<li>[MSMQ-Server] – Message Queuing Server</li>
<li>[MSMQ-Directory] – Directory Service Integration</li>
</ul>
<h2>Software Automatically Installed by Lync Server Setup</h2>
<div>
<div id="sectionSection6">
<p>When you install Lync Server 2010 on a server, some software that is required by Lync Server is installed automatically (that is, if the required software is not already installed on the server). This includes the following:</p>
<ul>
<li>Microsoft Visual C++ 2008 Redistributable</li>
<li>Microsoft Visual J# version 2.0 Redistributable</li>
<li>URL Rewrite Module version 2.0 Redistributable</li>
<li>SQL Server 2008 Express SP1</li>
<li>SQL Server 2008 Native Client</li>
</ul>
</div>
</div>
<p><strong>References:</strong><br />
For more information see TechNet documentation: <a href="http://technet.microsoft.com/en-us/library/gg398686.aspx">http://technet.microsoft.com/en-us/library/gg398686.aspx</a></p>
<br />Filed under: <a href='http://msunified.net/category/lync-server-2010/'>Lync Server 2010</a> Tagged: <a href='http://msunified.net/tag/lync-server-2010/'>Lync Server 2010</a>, <a href='http://msunified.net/tag/lync-server-prerequisites/'>Lync Server Prerequisites</a>, <a href='http://msunified.net/tag/powershell/'>PowerShell</a>, <a href='http://msunified.net/tag/server-2008-r2/'>Server 2008 R2</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/1940/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/1940/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/1940/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1940&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2010/11/23/installing-lync-server-2010-prerequisites-on-windows-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>
	</item>
		<item>
		<title>Exchange 2010 RTM and SP1 OWA Integration With OCS 2007 R2</title>
		<link>http://msunified.net/2010/06/22/exchange-2010-rtm-and-sp1-owa-integration-with-ocs-2007-r2/</link>
		<comments>http://msunified.net/2010/06/22/exchange-2010-rtm-and-sp1-owa-integration-with-ocs-2007-r2/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 22:25:06 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[OCS 2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[OCS 2007 R2]]></category>
		<category><![CDATA[owa]]></category>
		<category><![CDATA[OWA OCS Integration]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=1663</guid>
		<description><![CDATA[I recently integrated Exchange 2010 RTM OWA with OCS 2007 R2 for chat and presence. Having read some blog posts about how to implement the feature I decided to blog how I got this feature working based on these blogs and my own findings. I will cover the steps for both the Exchange 2010 RTM and SP1 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1663&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://stalehansen.files.wordpress.com/2010/06/ocshost.png"></a><div class="tweetmeme-button" id="tweetmeme-button-post-1663" style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'>
<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmsunified.net%2F2010%2F06%2F22%2Fexchange-2010-rtm-and-sp1-owa-integration-with-ocs-2007-r2%2Ftweetmeme_alias%3Dhttp%3A%2F%2Fwp.me%2Fpv8hB-qP%26tweetmeme_source%3D%E2%80%9Dstalehansen%E2%80%9D"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmsunified.net%2F2010%2F06%2F22%2Fexchange-2010-rtm-and-sp1-owa-integration-with-ocs-2007-r2%2F" height="61" width="51" /></a>
</div>I recently integrated Exchange 2010 RTM OWA with OCS 2007 R2 for chat and presence. Having read some blog posts about how to implement the feature I decided to blog how I got this feature working based on these blogs and my own findings. I will cover the steps for both the Exchange 2010 RTM and SP1 versions since the steps are different.</p>
<p><strong>Prerequisites</strong></p>
<ol>
<li>Download and install OCS 2007 R2 Web Trust Tool on the Exchange 2010 server
<ol>
<li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=ca107ab1-63c8-4c6a-816d-17961393d2b8">http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=ca107ab1-63c8-4c6a-816d-17961393d2b8</a> </li>
<li>Locate and install the following files in elevated mode by running cmd.exe as administrator
<ul>
<li>vc_redistx64</li>
<li>UCMAredist.msi</li>
<li>CWAOWASSP.msi</li>
</ul>
</li>
</ol>
</li>
<li>If the Exchange 2010 server is running on Server 2008 R2 you also need to install the latest cumulative hotfix update for OCS 2007 R2 on the Exchange server
<ol>
<li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=b3b02475-150c-41fa-844a-c10a517040f4">http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=b3b02475-150c-41fa-844a-c10a517040f4</a></li>
<li>Download and run ServerUpdateInstaller.exe</li>
<li>Also download the latest update for UCMAredist that is not included in CU5
<ul>
<li><a href="http://support.microsoft.com/?kbid=982614">http://support.microsoft.com/?kbid=982614</a></li>
</ul>
</li>
<li>Reboot the server</li>
</ol>
</li>
</ol>
<p><strong>Configuring Exchange 2010 RTM</strong></p>
<p><strong>NOTE:</strong> The below steps need to be done on all Exchange 2010 CAS servers in you deployment</p>
<ol>
<li>Download and run the PowerShell Script found in the below link
<ol>
<li><a href="http://msunified.net/exchange-downloads/script-imexintegration-ps1/">http://msunified.net/exchange-downloads/script-imexintegration-ps1/</a></li>
<li>The script will not configure anything</li>
<li>It takes backup of web.conf and  generates the configuration you manually need to add the web.conf file</li>
<li>The script makes it easy to generate the correct syntax for populating the below keys </li>
</ol>
</li>
<li>Navigate to the web.conf file
<ol>
<li>C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Owa\web.conf</li>
<li style="text-align:left;">Edit the file and search for the string IMPoolName</li>
<li style="text-align:left;">Replace the three &#8220;add key&#8221; strings with the ones provided with the script</li>
</ol>
</li>
<li style="text-align:left;">In Exchange Management Shell run the following command to configure OWA Virtual Directory
<ul>
<li style="text-align:left;"><pre class="brush: powershell;">Get-OwaVirtualDirectory -Server &quot;CasServer&quot; | Set-OwaVirtualDirectory -InstantMessagingType 1</pre>
<ul>
<li style="text-align:left;"><strong>NOTE:</strong> The RTM documentation states OCS, but that don&#8217;t work. Use 1 as InstantMessagingType</li>
</ul>
</li>
</ul>
</li>
<li style="text-align:left;">Run IISreset in PowerShell</li>
</ol>
<p><strong>Configuring Exchange 2010 SP1</strong></p>
<p>The Exchange 2010 SP1 guide is based on this great post written by Martin Sundström: <a href="http://msundis.wordpress.com/2010/06/21/integrate-ocs-2007-r2-with-exchange-server-2010-sp1-owa/">http://msundis.wordpress.com/2010/06/21/integrate-ocs-2007-r2-with-exchange-server-2010-sp1-owa/</a> The configuration on Exchange is now moved from web.conf to the per server OWA Virtual Directory. I will definitely create a script automating the below process when I get more hands on :)</p>
<p><strong>NOTE:</strong> The below steps need to be done on all Exchange 2010 CAS servers in you deployment </p>
<ol>
<li>Get the active Exchange 2010 certificate using this command in Exchange Management Shell 
<ul>
<li><pre class="brush: powershell;">Get-ExchangeCertificate | Where-Object {$_.Services -match &quot;IIS&quot;} | Get-ExchangeCertificate | fl thumbprint,subject</pre>
<ul>
<li>This command gets the active certificate on the local server, because only one certificate can have IIS as service at a time</li>
</ul>
</li>
</ul>
</li>
<li>Use the thumbprint and OCS pool FQDN in the command below
<ul>
<li><pre class="brush: powershell;">Get-OwaVirtualDirectory -Server &quot;CasServer&quot; | Set-OwaVirtualDirectory -InstantMessagingCertificateThumbprint 4DC1EE3506E06E971FF82AC8DD60015EAC11B21E -InstantMessagingServerName ocspool01.domain.local -InstantMessagingType OCS -InstantMessagingEnabled $true</pre>
<ul>
<li><strong>NOTE:</strong> This time we use OCS as InstantMessagingType</li>
</ul>
</li>
</ul>
</li>
<li>Run iisreset</li>
</ol>
<p><strong>Configuring OCS 2007 R2</strong></p>
<p>In order to allow the Exchange 2010 server to communicate with OCS using SIP containing presence and chat you need to add every Exchange 2010 CAS servers as authorized hosts on OCS.</p>
<ol>
<li>On your OCS R2 Pool server configure authorized host
<ul>
<li><strong>NOTE:</strong> Your user needs to be member of the RTCUniversalServerAdmins group</li>
</ul>
</li>
<li>Open Office Communications Server R2 under Administrative Tool</li>
<li>Expand forest and Enterprise pool or Standard Edition Servers depending on you deployment</li>
<li>Right click your pool and choose properties-&gt;Front End Properties</li>
<li>On the Hosts Authorization tab</li>
<li>You need to add the Client Access server FQDN and configure as the below image 
<ul>
<li><strong>NOTE:</strong> This is the FQDN of your subject name (CN) on the certificate used on the CAS server</li>
</ul>
</li>
</ol>
<p> <img style="border:0;" title="ocshost" src="http://stalehansen.files.wordpress.com/2010/06/ocshost.png?w=376&#038;h=276" alt="" width="376" height="276" /></p>
<ul>
<li>On OCS Front End you need to install the same cumulative update as we installed on the Exchange server if you have not already done it
<ol>
<li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=b3b02475-150c-41fa-844a-c10a517040f4">http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=b3b02475-150c-41fa-844a-c10a517040f4</a></li>
<li>Download and run ServerUpdateInstaller.exe</li>
<li><strong>NOTE:</strong> It is good practice to have all OCS servers on the same hotfix level</li>
<li>Reboot the server</li>
</ol>
</li>
</ul>
<p><strong>Troubleshooting the Installation (RTM)</strong></p>
<p>Next are a few troubleshooting steps that can assist with some of the more common problems encountered with Exchange/OCS integration. I found these valid troubleshooting steps on Rand Morimoto&#8217;s post: <a href="http://www.networkworld.com/community/node/47348">http://www.networkworld.com/community/node/47348</a></p>
<p><em>Configuring the Firewall on the CAS Server</em></p>
<p>If the Client Access Server has the Windows Firewall enabled, it might need an exception to enable OCS 2007 R2 to communicate with it. To create the exception, perform the following steps:</p>
<ol>
<li>From the Control Panel, open Windows Firewall </li>
<li>On the left side of the Windows Firewall window, click .“Allow a Program Through Windows Firewall.</li>
<li>Click Add Program; then click Browse.</li>
<li>Browse to C:\Windows\System32\inetsrv and select w3wp.exe.</li>
<li>Click Open and then click OK twice to apply changes and close the window. Be sure to perform this step on all CAS servers with IM integration enabled.</li>
</ol>
<p><em>User Configuration</em></p>
<ul>
<li>Before the user community can utilize the IM features, they must be “provisioned” for Office Communications Server R2 and must be enabled for Enhance Presence. When the user is initially enabled on OCS 2007 R2, he will automatically be enabled for Enhanced Presence.</li>
<li>Users must also have a valid SIP proxy address for the OWA IM integration component to enable the IM Integration UI.</li>
<li>When attempting to view the Instant Messaging contact list, a user might receive a notification that states
<ul>
<li>Instant Messaging Isn’t Available Right Now. The Contact List Will Appear When the Service Becomes Available.</li>
</ul>
</li>
<li>If this occurs, perform the following steps:
<ol>
<li>Using the same user account, confirm that you can access the IM services using the Office Communicator 2007 R2 client.</li>
<li>If functional, confirm that the OCS Server name is properly entered in the Web.Config file of the CAS server.</li>
<li>Also confirm the configuration of the Authorized Hosts option on the OCS pool contains all IM Integrated Client Access Servers.</li>
</ol>
</li>
</ul>
<p><em>OWA Certificate Error</em></p>
<p>If OWA cannot locate the certificate, an error stating The Local Certificate Specified Was Not Found in the Store for the Local Computer appears.</p>
<p>In this case, confirm that the value of the OCSCertificateIssuer and OCSCertificateSerialNumber fields in the Web.Config file are correct. Also ensure that there are blank spaces between every two characters in the serial number to separate octets in the string.</p>
<p><strong>References</strong></p>
<p>TechNet: <a href="http://technet.microsoft.com/en-us/library/ee633458%28EXCHG.140%29.aspx">http://technet.microsoft.com/en-us/library/ee633458%28EXCHG.140%29.aspx</a><br />
Chris and Robin&#8217;s Technology blog: <a href="http://chrislehr.com/2009/11/implementing-integrated-ocs-in-owa-2010.htm">http://chrislehr.com/2009/11/implementing-integrated-ocs-in-owa-2010.htm</a><br />
Martin Sundström: <a href="http://msundis.wordpress.com/2010/06/21/integrate-ocs-2007-r2-with-exchange-server-2010-sp1-owa/">http://msundis.wordpress.com/2010/06/21/integrate-ocs-2007-r2-with-exchange-server-2010-sp1-owa/</a><br />
Rand Morimoto: <a href="http://www.networkworld.com/community/node/47348">http://www.networkworld.com/community/node/47348</a></p>
<br />Filed under: <a href='http://msunified.net/category/exchange-2010/'>Exchange 2010</a>, <a href='http://msunified.net/category/ocs-2007/'>OCS 2007</a> Tagged: <a href='http://msunified.net/tag/exchange-2010/'>Exchange 2010</a>, <a href='http://msunified.net/tag/ocs-2007-r2/'>OCS 2007 R2</a>, <a href='http://msunified.net/tag/owa/'>owa</a>, <a href='http://msunified.net/tag/owa-ocs-integration/'>OWA OCS Integration</a>, <a href='http://msunified.net/tag/powershell/'>PowerShell</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/1663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/1663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/1663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/1663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/1663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/1663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/1663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/1663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/1663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/1663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/1663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/1663/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/1663/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/1663/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1663&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2010/06/22/exchange-2010-rtm-and-sp1-owa-integration-with-ocs-2007-r2/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>

		<media:content url="http://stalehansen.files.wordpress.com/2010/06/ocshost.png" medium="image">
			<media:title type="html">ocshost</media:title>
		</media:content>
	</item>
		<item>
		<title>Script for Configuring Exchange 2010 Internal and External URLs</title>
		<link>http://msunified.net/2010/05/07/script-for-configuring-exchange-2010-internal-and-external-urls/</link>
		<comments>http://msunified.net/2010/05/07/script-for-configuring-exchange-2010-internal-and-external-urls/#comments</comments>
		<pubDate>Fri, 07 May 2010 00:54:41 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[ExternalURL]]></category>
		<category><![CDATA[InternalUrl]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=1556</guid>
		<description><![CDATA[In Exchange 2010 you need to set the Internal URLs for various services on the Client Access Server. Outlook 2007/2010 uses Autodiscover to connect to the Exchange server. If the Internal URLs are configured wrong you could get certificate errors when logging on to Outlook as well as errors when using free busy and oof services internally. Also when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1556&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><div class="tweetmeme-button" id="tweetmeme-button-post-1556" style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'>
<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmsunified.net%2F2010%2F05%2F07%2Fscript-for-configuring-exchange-2010-internal-and-external-urls%2Ftweetmeme_alias%3Dhttp%3A%2F%2Fwp.me%2Fpv8hB-p6%26tweetmeme_source%3D%E2%80%9Dstalehansen%E2%80%9D"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmsunified.net%2F2010%2F05%2F07%2Fscript-for-configuring-exchange-2010-internal-and-external-urls%2F" height="61" width="51" /></a>
</div>In Exchange 2010 you need to set the Internal URLs for various services on the Client Access Server. Outlook 2007/2010 uses Autodiscover to connect to the Exchange server. If the Internal URLs are configured wrong you could get certificate errors when logging on to Outlook as well as errors when using free busy and oof services internally. Also when deploying Outlook Anywhere you need to configure the External URLs correct for the same services to work.</p>
<p><strong>This script may come in handy in the following scenarios:</strong></p>
<ul>
<li>Initial configuration, avoid typos</li>
<li>Expansion in the infrastructure with load balanced CAS</li>
<li>Change in internal FQDN if you change certificate name</li>
<li>When you have a total disaster on site 1 and need to fail over to a second site with a passive DAG server that holds all server roles</li>
</ul>
<p><strong>Please keep in mind:</strong></p>
<ul>
<li>The Script is developed for Exchange 2003 coexistence and migration scenarios</li>
<li>The script must not be run in an Exchange 2007 coexistence and migration scenario</li>
<li>For InternalURL the script will look for a CASArray (It is recommended to create a CASArray in any scenario)</li>
<li>The script assumes there is only one ADsite</li>
</ul>
<p><strong>About the script:</strong></p>
<ul>
<li>First you will be presented with som choices on what to do</li>
<li>InternalURL will autoconfigure based on CASArray</li>
<li>ExternalURL will prompt for public FQDN and assume one external address
<ul>
<li>Will use same FQDN for OWA, ActiveSync, Autodiscover and so on</li>
</ul>
</li>
<li>Will prompt for Exchange 2003 URL</li>
<li>All configuration will output the changes made</li>
</ul>
<p> <a href="http://msunified.net/exchange-downloads/script-internalexternalurls-ps1/"><img class="alignnone size-full wp-image-1557" style="border:0;" title="Get-InternalExternalURLs.ps1" src="http://stalehansen.files.wordpress.com/2010/05/ps.jpg" alt="" width="723" height="128" /></a></p>
<p><strong>Update 27.05.2010: </strong></p>
<ul>
<li>Added support for Exchange 2007 and Exchange 2007/2010 coexistence scenarios.</li>
<li>The script will check for Exchange version before applying any settings.</li>
<li>When applying Exchange 2010 Internal URL the script will match the CAS servers to the correct CASarray in the correct ADsite</li>
</ul>
<p> <a href="http://msunified.net/exchange-downloads/script-internalexternalurls-ps1/"><img class="alignnone size-full wp-image-1600" style="border:0;" title="Set-InernalExternalURLs.ps1 v02" src="http://stalehansen.files.wordpress.com/2010/05/intexturl.png" alt="" width="563" height="172" /></a></p>
<p><strong></strong><strong>Update 28.05.2010</strong></p>
<ul>
<li>Added option for checking current configuration</li>
<li>Corrected some errors on the Exchange 2007 configuration and listing of URLs</li>
<li>Tested in Exchange 2007 only deployments and Exchange 2010 and 2007 coexistence deployments</li>
</ul>
<p><a href="http://msunified.net/exchange-downloads/script-internalexternalurls-ps1/"><img class="size-full wp-image-1714 alignnone" style="border:0;" title="exchv3" src="http://stalehansen.files.wordpress.com/2010/05/exchv3.png" alt="" width="546" height="178" /></a></p>
<p> The Script can be viewed and downloaded here: <a href="http://msunified.net/exchange-downloads/script-internalexternalurls-ps1/">http://msunified.net/exchange-downloads/script-internalexternalurls-ps1/</a></p>
<br />Filed under: <a href='http://msunified.net/category/exchange-2010/'>Exchange 2010</a> Tagged: <a href='http://msunified.net/tag/exchange-2010/'>Exchange 2010</a>, <a href='http://msunified.net/tag/externalurl/'>ExternalURL</a>, <a href='http://msunified.net/tag/internalurl/'>InternalUrl</a>, <a href='http://msunified.net/tag/powershell/'>PowerShell</a>, <a href='http://msunified.net/tag/web-services/'>Web Services</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/1556/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/1556/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/1556/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1556&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2010/05/07/script-for-configuring-exchange-2010-internal-and-external-urls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>

		<media:content url="http://stalehansen.files.wordpress.com/2010/05/ps.jpg" medium="image">
			<media:title type="html">Get-InternalExternalURLs.ps1</media:title>
		</media:content>

		<media:content url="http://stalehansen.files.wordpress.com/2010/05/intexturl.png" medium="image">
			<media:title type="html">Set-InernalExternalURLs.ps1 v02</media:title>
		</media:content>

		<media:content url="http://stalehansen.files.wordpress.com/2010/05/exchv3.png" medium="image">
			<media:title type="html">exchv3</media:title>
		</media:content>
	</item>
		<item>
		<title>Configure Exchange 2010 InternalUrl PowerShell script</title>
		<link>http://msunified.net/2010/01/13/configure-exchange-2010-internalurl-powershell-script/</link>
		<comments>http://msunified.net/2010/01/13/configure-exchange-2010-internalurl-powershell-script/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 22:11:35 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Exchange 2010]]></category>
		<category><![CDATA[Autodiscover]]></category>
		<category><![CDATA[InternalUrl]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=1135</guid>
		<description><![CDATA[UPDATE: This script has been updated and revamped 07.05.2010 and described in this post: http://msunified.net/2010/05/07/script-for-configuring-exchange-2010-internal-and-external-urls/ In Exchange 2010 you need to set the internal URL for various services on the Client Access Server. Outlook 2007 uses autodiscover internally to connect to the exchange server. If internal URL is configured wrong you could get certificate errors when [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1135&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme-button" id="tweetmeme-button-post-1135" style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'>
<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmsunified.net%2F2010%2F01%2F13%2Fconfigure-exchange-2010-internalurl-powershell-script%2Ftweetmeme_alias%3Dhttp%3A%2F%2Fwp.me%2Fpv8hB-ij%26tweetmeme_source%3D%E2%80%9Dstalehansen%E2%80%9D"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmsunified.net%2F2010%2F01%2F13%2Fconfigure-exchange-2010-internalurl-powershell-script%2F" height="61" width="51" /></a>
</div>
<p><strong>UPDATE: This script has been updated and revamped 07.05.2010 and described in this post:</strong> <a href="http://msunified.net/2010/05/07/script-for-configuring-exchange-2010-internal-and-external-urls/">http://msunified.net/2010/05/07/script-for-configuring-exchange-2010-internal-and-external-urls/</a></p>
<p>In Exchange 2010 you need to set the internal URL for various services on the Client Access Server. Outlook 2007 uses autodiscover internally to connect to the exchange server. If internal URL is configured wrong you could get certificate errors when logging on to Outlook as well as errors when using other services internally.</p>
<p>This script may come in handy in the following scenarios</p>
<ul>
<li>Initial configuration</li>
<li>Expansion in the infrastructure with load balanced CAS</li>
<li>Change in internal FQDN if you change certificate name</li>
<li>Change from https to http</li>
<li>When you have a total disaster on site 1 and need to fail over to a second site with a passive DAG server that holds all server roles</li>
</ul>
<p> It is a very simple script, if you have some advice to make the script better I would be happy if you let me know. The script does the following:</p>
<ul>
<li>The server path is specified with a prompt</li>
<li>The script is set up with &#8220;-identity *&#8221; if you have more than one instance you need to specify wich instance you want to configure</li>
<li>The url is generated using the variable and the default location of the services</li>
<li>After configuring the URL&#8217;s the scritp lists all changes so its easy to doublecheck the configuration</li>
<li>The UM role is excluded because it is not supported to be hosted on the same server as CAS</li>
</ul>
<p>To run the script do the following:</p>
<ul>
<li>Copy this into a txt file and rename it to a ps1 file</li>
<li>Open powershell and navigate to the location where the file is saved</li>
<li>Use tab in powershell to get the correct run syntax</li>
<li>Run it and type the correct FQDN like this when prompted: https://yourcasserver.domain.local</li>
</ul>
<p><pre class="brush: powershell;">
#InternalURL.ps1
$urlpath = Read-Host &quot;Type internal Client Access FQDN starting with http:// or https://&quot;
Set-AutodiscoverVirtualDirectory -Identity * –internalurl “$urlpath/autodiscover/autodiscover.xml”
Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath/autodiscover/autodiscover.xml”
Set-webservicesvirtualdirectory –Identity * –internalurl “$urlpath/ews/exchange.asmx”
Set-oabvirtualdirectory –Identity * –internalurl “$urlpath/oab”
Set-owavirtualdirectory –Identity * –internalurl “$urlpath/owa”
Set-ecpvirtualdirectory –Identity * –internalurl “$urlpath/ecp”
Set-ActiveSyncVirtualDirectory -Identity * -InternalUrl &quot;$urlpath/Microsoft-Server-ActiveSync&quot;
#get commands to  to doublecheck the config
get-AutodiscoverVirtualDirectory | ft identity,internalurl
get-ClientAccessServer | ft identity,AutodiscoverServiceInternalUri
get-webservicesvirtualdirectory | ft identity,internalurl
get-oabvirtualdirectory | ft identity,internalurl
get-owavirtualdirectory | ft identity,internalurl
get-ecpvirtualdirectory | ft identity,internalurl
get-ActiveSyncVirtualDirectory | ft identity,internalurl
</pre></p>
<br />Posted in Exchange 2010 Tagged: Autodiscover, Exchange 2010, InternalUrl, PowerShell <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/1135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/1135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/1135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/1135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/1135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/1135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/1135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/1135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/1135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/1135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/1135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/1135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/1135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/1135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=1135&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2010/01/13/configure-exchange-2010-internalurl-powershell-script/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>
	</item>
		<item>
		<title>How to save your Exchange 2007 PowerShell session transcript</title>
		<link>http://msunified.net/2009/07/06/how-to-save-your-exchange-2007-powershell-session-transcript/</link>
		<comments>http://msunified.net/2009/07/06/how-to-save-your-exchange-2007-powershell-session-transcript/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 18:38:56 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Start-Transcript]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=555</guid>
		<description><![CDATA[I was doing some troubleshooting when I came over an article for automating the process for saving your transcript in PowerShell to a file. The article can be found here : http://blogs.technet.com/benw/archive/2007/07/24/how-to-save-your-exchange-2007-powershell-session-transcript.aspx In the article the author talks about editing the PowerShell Profile. I cant do this for every customer site I am at, so I have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=555&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was doing some troubleshooting when I came over an article for automating the process for saving your transcript in PowerShell to a file. The article can be found here : <a href="http://blogs.technet.com/benw/archive/2007/07/24/how-to-save-your-exchange-2007-powershell-session-transcript.aspx">http://blogs.technet.com/benw/archive/2007/07/24/how-to-save-your-exchange-2007-powershell-session-transcript.aspx</a></p>
<p>In the article the author talks about editing the PowerShell Profile. I cant do this for every customer site I am at, so I have edited the syntax to fit my needs. If this is run after you launch PowerShell the file is saved at the root of your C drive.</p>
<p><strong>CD \</strong><br />
<strong>$date = get-date -UFormat %y%m%d<br />
Start-Transcript c:\$date.txt -append -noclobber<br />
</strong><br />
This will set the working directory to the root of the C drive (gives you more real estate to work with), defines a variable called $date, and specifies that it will get the date in the format of YearMonthDay (i.e. 090706), then tells Powershell to start the transcript, and it uses the variable we defined earlier to automatically create a new text file based on the current date.  Additionally, since the default behavior of start-transcript is to overwrite the previous file, we are telling it to append to an existing file (if present), and the -noclobber tells it to not overwrite the previous file.</p>
<p>Powershell does have some other options here.  The Start-Transcript command includes a -Path parameter that you can define, but it is not used here.</p>
<br />Posted in Exchange 2007 Tagged: Exchange 2007, PowerShell, Start-Transcript <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/555/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/555/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/555/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=555&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2009/07/06/how-to-save-your-exchange-2007-powershell-session-transcript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>
	</item>
		<item>
		<title>Allowing application servers to relay off Exchange Server 2007</title>
		<link>http://msunified.net/2009/05/14/allowing-application-servers-to-relay-off-exchange-server-2007/</link>
		<comments>http://msunified.net/2009/05/14/allowing-application-servers-to-relay-off-exchange-server-2007/#comments</comments>
		<pubDate>Wed, 13 May 2009 23:33:34 +0000</pubDate>
		<dc:creator>Ståle Hansen</dc:creator>
				<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Relay]]></category>

		<guid isPermaLink="false">http://msunified.net/?p=326</guid>
		<description><![CDATA[To allow application servers to relay through your Exchange 2007 server do the following Create a new internal receive connector in EMC Add the servers that need to relay When created edit the settings and navigate to Permission Groups Select only Anonymous users, deselect other options Navigate to the Authentication tab Deselect every checkbox so that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=326&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To allow application servers to relay through your Exchange 2007 server do the following</p>
<ul>
<li>Create a new internal receive connector in EMC</li>
<li>Add the <a href="http://msexchangeteam.com/photos/postpictures2/images/432009/original.aspx">servers</a> that need to relay</li>
<li>When created edit the settings and navigate to Permission Groups</li>
<li>Select only Anonymous users, deselect other options</li>
<li>Navigate to the Authentication tab</li>
<li>Deselect every checkbox so that nothing is selected</li>
<li>Apply changes</li>
<li>Open EMS and run the following commandlet</li>
<li><span style="font-family:Courier New;">Get-ReceiveConnector &#8220;InternalRelay&#8221; | Add-ADPermission -User &#8220;NT AUTHORITY\ANONYMOUS LOGON&#8221; -ExtendedRights &#8220;ms-Exch-SMTP-Accept-Any-Recipient&#8221;</span></li>
<li>Relay should now work for the selected servers</li>
</ul>
<p>This information was based on this blog, <a href="http://msexchangeteam.com/archive/2006/12/28/432013.aspx" target="_blank">http://msexchangeteam.com/archive/2006/12/28/432013.aspx</a></p>
<br />Posted in Exchange 2007 Tagged: Exchange, Exchange 2007, PowerShell, Relay <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stalehansen.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stalehansen.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stalehansen.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stalehansen.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stalehansen.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stalehansen.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stalehansen.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stalehansen.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stalehansen.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stalehansen.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stalehansen.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stalehansen.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stalehansen.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stalehansen.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=msunified.net&amp;blog=7420011&amp;post=326&amp;subd=stalehansen&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://msunified.net/2009/05/14/allowing-application-servers-to-relay-off-exchange-server-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/961ad6f4a2b1289352341cb9964f2f36?s=96&#38;d=http%3A%2F%2Fs0.wp.com%2Fi%2Fmu.gif&#38;r=G" medium="image">
			<media:title type="html">Ståle Hansen</media:title>
		</media:content>
	</item>
	</channel>
</rss>
