<?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/"
	>

<channel>
	<title>Inside OCS &#187; Powershell</title>
	<atom:link href="http://blog.insideocs.com/category/management/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.insideocs.com</link>
	<description>Microsoft Office Communications Server - Tips, Tricks, and Insight</description>
	<lastBuildDate>Thu, 26 Jan 2012 20:13:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Microsoft Lync Remote PowerShell Administration</title>
		<link>http://blog.insideocs.com/2011/08/18/microsoft-lync-remote-powershell-administration/</link>
		<comments>http://blog.insideocs.com/2011/08/18/microsoft-lync-remote-powershell-administration/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 16:12:58 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Microsoft Lync 2010 Powershell Administration]]></category>
		<category><![CDATA[Microsoft Lync 2010 Remote Powershell]]></category>
		<category><![CDATA[Microsoft Lync Administration 32-bit]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=1284</guid>
		<description><![CDATA[<p>A new post on InsideLync.com &#8211; Microsoft Lync Remote PowerShell Administration (http://blog.insidelync.com/2011/08/remote-lync-powershell-administration/).</p>
]]></description>
			<content:encoded><![CDATA[<p>A new post on InsideLync.com &#8211; Microsoft Lync Remote PowerShell Administration (<a href="http://blog.insidelync.com/2011/08/remote-lync-powershell-administration/">http://blog.insidelync.com/2011/08/remote-lync-powershell-administration/</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2011/08/18/microsoft-lync-remote-powershell-administration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft Lync PowerShell Cheat Sheet</title>
		<link>http://blog.insideocs.com/2011/02/15/microsoft-lync-powershell-cheat-sheet/</link>
		<comments>http://blog.insideocs.com/2011/02/15/microsoft-lync-powershell-cheat-sheet/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 22:57:26 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Lync]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[OCS 2010]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Microsoft Lync 2010 powershell]]></category>
		<category><![CDATA[microsoft lync management]]></category>
		<category><![CDATA[Microsoft Lync Powershell Cheat Sheet]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=1171</guid>
		<description><![CDATA[<p>I just posted my Microsoft Lync PowerShell Cheat Sheet on a new blog dedicated to Microsoft Lync: InsideLync.com.</p>
<p>Your can read about it and download it here: http://blog.insidelync.com/2011/02/microsoft-lync-powershell-cheat-sheet/.</p>
<p>In a nutshell it is a quick reference card for PowerShell use with Lync Server 2010.</p>
]]></description>
			<content:encoded><![CDATA[<p>I just posted my <a href="http://blog.insidelync.com/2011/02/microsoft-lync-powershell-cheat-sheet/">Microsoft Lync PowerShell Cheat Sheet</a> on a new blog dedicated to Microsoft Lync: <a href="http://www.InsideLync.com">InsideLync.com</a>.</p>
<p>Your can read about it and download it here: <a href="http://blog.insidelync.com/2011/02/microsoft-lync-powershell-cheat-sheet/">http://blog.insidelync.com/2011/02/microsoft-lync-powershell-cheat-sheet/</a>.</p>
<p>In a nutshell it is a quick reference card for PowerShell use with Lync Server 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2011/02/15/microsoft-lync-powershell-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Lync and OCS Administration Tools</title>
		<link>http://blog.insideocs.com/2010/12/10/lync-and-ocs-administration-tools/</link>
		<comments>http://blog.insideocs.com/2010/12/10/lync-and-ocs-administration-tools/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 05:06:03 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Lync]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[OCS R2]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Microsoft Lync Administration]]></category>
		<category><![CDATA[Microsoft Lync administration tools]]></category>
		<category><![CDATA[Microsoft lync merge topology]]></category>
		<category><![CDATA[Microsoft Lync OCS administration tools]]></category>
		<category><![CDATA[Microsoft lync ocs migration]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=1140</guid>
		<description><![CDATA[<p>A quick post with 5 key reminders about administering OCS and Lync in a coexistence scenario. As with previous OCS/Lync releases, the general rule is that you must use the administrative tools that ship with the server version that you want to manage.</p>
1. The Lync Server Administration Tools Cannot be Installed Alongside the OCS 2007 [...]]]></description>
			<content:encoded><![CDATA[<p>A quick post with 5 key reminders about administering OCS and Lync in a coexistence scenario. As with previous OCS/Lync releases, the general rule is that you must use the administrative tools that ship with the server version that you want to manage.</p>
<h3><strong>1. The Lync Server Administration Tools Cannot be Installed Alongside the OCS 2007 or OCS 2007 R2 Tools.</strong></h3>
<p>If you try to install the Lync Administrative Tools on a machine that already as the OCS 2007 R2 Administrative Tools, you will see the following error:</p>
<p><img class="alignnone size-full wp-image-1141" title="Lync Admin Tool Install" src="http://blog.insideocs.com/wp-content/uploads/2010/12/Lync-Admin-Tool-Install.png" alt="Lync Admin Tool Install" width="514" height="400" /></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Note: if you want to by-pass the Lync Deployment Wizard GUI to install the Administrative tools directly from the setup files, this worked for me:</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1.<span style="white-space: pre;"> </span>First install the core components from:  .. \Lync Server 2010 Eval (US)\Setup\amd64\Setup\ocscore.msi</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2.<span style="white-space: pre;"> </span>Next, install the administrative tools from: ..\Lync Server 2010 Eval (US)\Setup\amd64\Setup\admintools.msi.</div>
<p><span style="text-decoration: underline;">Note</span>: if you want to by-pass the Lync Deployment Wizard GUI to install the Administrative tools directly from the setup files, this worked for me:</p>
<ul>
<li>First install the core components from:  .. \Setup\amd64\Setup\ocscore.msi</li>
<li>Next, install the administrative tools from: ..\Setup\amd64\Setup\admintools.msi.</li>
</ul>
<h3>2. You can View your OCS 2007 R2 Topology in the Lync Topology Builder</h3>
<p>A key step in the the OCS migration process is to merge topology information. This merges data from a previous OCS 2007 or OCS 2007 R2 topology data into the Lync Central Management Store. See Microsoft TechNet Lync Server Migration (<a href="http://technet.microsoft.com/en-us/library/gg425746.aspx">http://technet.microsoft.com/en-us/library/gg425746.aspx</a>) for full migration details. This is a key step to allow side-by-side coexistence and user migration.</p>
<p>The “Merge 2007 or 2007 R2 Topology…” action from the Topology builder (<a href="http://technet.microsoft.com/en-us/library/gg398172.aspx">http://technet.microsoft.com/en-us/library/gg398172.aspx</a>) creates a root tree node named “<strong>BackCompatSite</strong>” which shows up in the Lync Topology Builder where you can view your OCS Topology components.  The OCS information under this node is just read-only; no actions can be taken.</p>
<div><img class="alignnone size-full wp-image-1142" title="Lync OCS Topology" src="http://blog.insideocs.com/wp-content/uploads/2010/12/Lync-OCS-Topology.png" alt="Lync OCS Topology" width="318" height="465" /></div>
<p><strong>Important Notes:</strong></p>
<ul>
<li>Always save a copy of your existing Lync topology first.</li>
<li>Before you merge the topology, you need to install the “WMI Backward Compatibility Package”.  This compatibility package is located in the Lync distribution at:
<ul>
<li>…\Setup\amd64\Setup\<strong>OCSWMIBC.msi</strong></li>
</ul>
</li>
<li>The &#8220;<strong>BackCompatSite</strong>&#8221; OCS tree node is a snapshot of your legacy OCS environment – it does not keep it synchronized! If you makes changes, you will need to remerge.</li>
</ul>
<div>
<h3>3.  The OCS WMI Classes can be Installed on a Lync Server Admin Machine and can be Used with PowerShell</h3>
<div>The WMI Backward Compatibility Package (OCSWMIBC.msi) can be installed on any machine in the domain that has the Lync Server 2010 Core Components and Lync Server Management Shell installed, and has access to the Office Communications Server 2007 R2 topology (WMI provider to Active Directory and SQL Server). OCSWMIBC.msi is typically installed on a Front-End server in the topology.</div>
<div>You can then use PowerShell to query information about your OCS environement, such as:</div>
<div>
<ul>
<li>Get-wmiobject -class msft_sipesusersetting | Select-Object DisplayName, Enabled<span style="white-space:pre"> (</span>to see user information)</li>
<li>Get-WmiObject -class MSFT_SIPLocalNormalizationRuleData”   (to see your OCS normalization rules)</li>
<li>Get-WmiObject -class MSFT_SIPLocationProfileData | Select-Object -Property Name   (to see your OCS location profiles)</li>
<li>Get-WmiObject -class MSFT_SIPTrustedServiceSetting | Select-Object FQDN, Port<span style="white-space:pre"> (</span>to see your OCS servers and services)</li>
</ul>
</div>
<div>Do not use the WMI classes to change anything in your OCS environment – use the respective OCS Administrative Tools for that.</div>
</div>
<div>Again, the WMI Backward Compatibility Package is available on your distribution media at: …\Setup\amd64\Setup\OCSWMIBC.msi.</div>
<div>
<h3>4. There is only a 64-bit Version of the Lync Server Administrative Tools</h3>
<div>There is only a 64-bit version of the Lync Administrative tools currently available. There are a couple of options:</div>
<div>
<ul>
<li>You can use the web-based Lync Server 2010 Control Panel (from any computer running IE 7, IE 8, or Firefox 3+), but having administrative access via PowerShell will allow you to do more powerful custom administration – specifically Topology related administration.</li>
<li>It is possible to launch a remote PowerShell 2.0 remote session on a 32-bit machine to the Lync server, load the Lync Server Management module, and use the Lync PowerShell cmdlets if you are in a pinch. For more information on this see my blog post: <a href="http://blog.insidelync.com/2011/08/remote-lync-powershell-administration/">Microsoft Lync Remote PowerShell Administration</a>.</li>
</ul>
</div>
<h3>5. There is no Active Directory Users and Computers Add-In for Lync Server</h3>
<div>Lync user management should be done through the Lync Control Panel Administration tool.  As usual, the non-Lync user Active Directory attributes can be managed through ADUC.</div>
<div><strong>Tip</strong>: If you are trying to enable an AD user for Lync, and get the error: &#8220;<strong>Insufficient access rights to perform the operation</strong>&#8220;, see the following:</div>
<div>
<ol>
<li><a href="http://blogs.technet.com/b/nexthop/archive/2010/12/27/lync-2010-server-control-panel-returns-that-error-quot-insufficient-access-rights-to-perform-the-operation-quot-when-attempting-a-move-user-or-enable-user-command.aspx">Lync Server 2010 Control Panel returns the error &#8220;Insufficient access rights to perform the operation&#8221; when attempting a move user or enable user command</a></li>
<li><a href="http://support.microsoft.com/kb/2466000#appliesto">Microsoft KB article 2466000</a></li>
</ol>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2010/12/10/lync-and-ocs-administration-tools/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Managing the OCS 2007 R2 QoE and CDR Data</title>
		<link>http://blog.insideocs.com/2010/07/08/managing-ocs-2007-r2-qoe-and-cdr-data/</link>
		<comments>http://blog.insideocs.com/2010/07/08/managing-ocs-2007-r2-qoe-and-cdr-data/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 23:48:26 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[OCS R2]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Reporting]]></category>
		<category><![CDATA[microsoft ocs 2007 monitoring server data]]></category>
		<category><![CDATA[microsoft ocs 2007 MSFT_SIPQoESetting MSFT_SIPCDRServiceSetting]]></category>
		<category><![CDATA[microsoft ocs 2007 purge database]]></category>
		<category><![CDATA[microsoft ocs 2007 r2 QoE CDR Data]]></category>
		<category><![CDATA[microsoft ocs 2007 “quality of experience” “call detail record” data]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=923</guid>
		<description><![CDATA[<p>The Call Detail Record (CDR) and Quality of Experience (QoE) data available through the OCS 2007 R2 Monitoring Server role enables very good usage and quality of experience reporting.  This blog post covers how to estimate the size of the database, and how to manage the database data rentention and purge time.</p>
<p>1) QoE and CDR Database [...]]]></description>
			<content:encoded><![CDATA[<p>The Call Detail Record (CDR) and Quality of Experience (QoE) data available through the OCS 2007 R2 Monitoring Server role enables very good usage and quality of experience reporting.  This blog post covers how to estimate the size of the database, and how to manage the database data rentention and purge time.</p>
<p><span style="text-decoration: underline;"><strong>1) QoE and CDR Database Sizing</strong><br />
</span>Based on a sample Microsoft OCS feature usage model (the same one used for the <a href="http://technet.microsoft.com/en-us/library/dd425159(office.13).aspx">OCS 2007 R2 Capacity Planning</a>), the CDR database grows 8.8 KB per day, and the QoE database grows 16.8 KB per day.  Once we know this, we can estimate the database size using this formula:</p>
<p>&gt; Database size (KB) = (DB growth per user per day) * (Number of users) * (Number of days)</p>
<p>For example, the CDR and QoE database in a 3500 OCS user organization would consume a total of <strong>5.3 GB</strong> in 60 days ((8.8+16.8) * 3500 * 60).</p>
<p><strong><span style="text-decoration: underline;">2) Setting the Data Retention</span></strong><br />
The default data retention for both CDR and QoE data is<strong> 60 days</strong>. Every night the purge process will delete any records which are older than this value. The retention setting can be viewed and set in the OCS Administrator Console by doing a right-click | Properties on particular monitoring server in the left-hand tree. The <strong>property</strong> page looks like the following:</p>
<p><img class="alignnone size-full wp-image-924" style="border: black 1px solid;" title="OCS Monitoring Settings" src="http://blog.insideocs.com/wp-content/uploads/2010/07/OCS-Monitoring-Settings.JPG" alt="OCS Monitoring Settings" width="394" height="390" /></p>
<p>Set the <strong>Maximum Days Logged</strong> to the number of days that you wish to retain the respective data sets.</p>
<p><strong>Note:</strong></p>
<ul>
<li>To purge everything, use a value of <strong>zero</strong>.</li>
<li>Leave the checkbox unchecked to turn-off purging all together.</li>
<li>You can also manage these settings through WMI.</li>
</ul>
<p><strong><span style="text-decoration: underline;">3) Setting the Purge Time</span></strong></p>
<p>Specifying the time of day that the SQL database purges the data cannot be set through the OCS Administrative Console. You need to use WMI to make this setting. The WMI classes to set the QoE and CDR purge times are shown below:</p>
<ol>
<li>QoE:  use the <strong>MSFT_SIPQoESetting</strong> class and set the <strong>PurgeJobStartTime</strong> property.  The value is an integer representing the number of hours after midnight to start the purging (i.e the hour based on a 24 hour clock).  For example, a value of “1” will start the purging at 1am.</li>
<li>CDR:  use the <strong>MSFT_SIPCDRServiceSetting</strong> class and set the <strong>PurgeTime</strong> property. This also is an integer value representing the number of hours after midnight to start the purging of outdated records.</li>
</ol>
<p>These classes are <strong>only installed and available on the Monitoring Server</strong>. However, you can use the “-computername” parameter in WMI provider to remotely view and set value.</p>
<p>For example, the following two lines of Powershell, can be used to remotely set the Purge Time for the CDR database to be 4am:</p>
<address> &gt; <strong>$CDRObject = Get-WmiObject -class MSFT_SIPCDRServiceSetting -computername &lt;monitoring_server_hostname&gt; | Select-Object</strong></address>
<address> &gt; <strong>$CDRObject.PurgeTime = 4</strong></address>
<address><strong>&gt; $CDRObject.Put()</strong></address>
<p><strong>Note</strong>: if you are using multiple monitoring servers connected to one monitoring database, it is important to not start the purging on each server simultaneously.  See the TechNet article <a href="http://technet.microsoft.com/en-us/library/dd572795(office.13).aspx">Microsoft Office Communications Server 2007 R2 Configuring Retention of QoE and CDR Data</a> for more information</p>
<p><strong>Addition Information</strong></p>
<ul>
<li><a href="http://technet.microsoft.com/en-us/library/dd572795(office.13).aspx">Microsoft Office Communications Server 2007 R2 Configuring Retention of QoE and CDR Data</a> (TechNet)</li>
<li>Key high-level information about the OCS 2007 R2 Monitoring role: <a href="http://blog.insideocs.com/2010/01/28/ocs-2007-r2-monitoring-role-faq/">OCS 2007 R2 Monitoring Role FAQ</a> (InsideOCS post)</li>
<li><a href="http://technet.microsoft.com/en-us/library/dd441306(office.13).aspx">Microsoft Office Communications Server 2007 R2Monitoring Support</a> (TechNet)</li>
<li>MSDN <a href="http://msdn.microsoft.com/en-us/library/dd167384(office.13).aspx">MSFT_SIPQoESetting (New)</a></li>
<li>MSDN <a href="http://msdn.microsoft.com/en-us/library/dd146623(office.13).aspx">MSFT_SIPCDRServiceSetting (New)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2010/07/08/managing-ocs-2007-r2-qoe-and-cdr-data/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>OCS WMI Reference</title>
		<link>http://blog.insideocs.com/2009/07/07/ocs-wmi-reference/</link>
		<comments>http://blog.insideocs.com/2009/07/07/ocs-wmi-reference/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 20:19:14 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[OCS R2]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[OCS WMI Reference]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=384</guid>
		<description><![CDATA[<p>OCS installs a set of Windows Management Instrumentation (WMI) classes that expose a wealth of information on everything from global settings about an OCS deployment, OCS user settings, or configuration information about a particular server. These classes can be used to programmatically gather configuration information, manage an OCS environment, and automate administrative tasks using a [...]]]></description>
			<content:encoded><![CDATA[<p>OCS installs a set of Windows Management Instrumentation (WMI) classes that expose a wealth of information on everything from global settings about an OCS deployment, OCS user settings, or configuration information about a particular server. These classes can be used to programmatically gather configuration information, manage an OCS environment, and automate administrative tasks using a Windows Scripting Host language or Powershell.</p>
<p>The WMI classes that are installed with the OCS Administrative Tools and Server Roles are part of the Office Communications Server Management API.  Below I provide a handy reference to the most useful MSDN OCS WMI information.  Note:  R2 = OCS 2007 R2; R1 = OCS 2007.</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="191" valign="top"><strong>Description</strong></td>
<td width="229" valign="top"><strong>OCS 2007 R2</strong></td>
<td width="192" valign="top"><strong>OCS 2007</strong></td>
</tr>
<tr>
<td width="191" valign="top"><strong>OCS WMI Reference Portal</strong><br />
<address>Start here if you are unfamiliar with the WMI classes.</address>
</td>
<td width="229" valign="top"><a href="http://msdn.microsoft.com/en-us/library/dd146871(office.13).aspx">http://msdn.microsoft.com/en-us/library/dd146871(office.13).aspx</a> </p>
<p>                                             </td>
<td width="192" valign="top"><a href="http://msdn.microsoft.com/en-us/library/bb679969.aspx">http://msdn.microsoft.com/en-us/library/bb679969.aspx</a> </td>
</tr>
<tr>
<td width="191" valign="top"><strong>OCS WMI Class Reference</strong><br />
<address>A complete reference to all the available classes and their respective details.</address>
</td>
<td width="229" valign="top"><a href="http://msdn.microsoft.com/en-us/library/dd146501(office.13).aspx">http://msdn.microsoft.com/en-us/library/dd146501(office.13).aspx</a> </td>
<td width="192" valign="top"><a href="http://msdn.microsoft.com/en-us/library/bb680173.aspx">http://msdn.microsoft.com/en-us/library/bb680173.aspx</a></td>
</tr>
<tr>
<td width="191" valign="top"><strong>WMI</strong><strong> Class Management Scopes and Roles (*)</strong><br />
<address>What classes are available on which server roles (or admin tools installation), and what scope a class has.</address>
</td>
<td width="229" valign="top"><a href="http://msdn.microsoft.com/en-us/library/dd130068(office.13).aspx">http://msdn.microsoft.com/en-us/library/dd130068(office.13).aspx</a> </td>
<td width="192" valign="top"><a href="http://msdn.microsoft.com/en-us/library/bb680173.aspx">http://msdn.microsoft.com/en-us/library/bb680173.aspx</a></td>
</tr>
<tr>
<td width="191" valign="top"><strong>WMI</strong><strong> Error Messages</strong><br />
<address> What specific error codes mean (which can be difficult because of the WMI provider architecture).</address>
</td>
<td colspan="2" width="421" valign="top">
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/bb680174.aspx">MSDN WMI Error codes returned by the Office Communications Server 2007 WMI provider</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/aa394559(VS.85).aspx">MSDN WMI Error Constants</a></li>
<li><a href="http://insideocs.wordpress.com/wp-admin/•%09http:/blogs.msdn.com/jcalev/archive/2008/01/09/how-to-track-down-the-wmi-error-in-ocs.aspx">How to track down the WMI error in OCS (from Joe Calev&#8217;s WebLog)</a></li>
</ul>
<p> </td>
</tr>
</tbody>
</table>
<p>* <strong>Note</strong>: Practically speaking, the class scope affects your ability to use the class in two ways:</p>
<ol>
<li>The WMI class might only be available on a particular machine (server role), meaning your script will need to remotely connect to that machine to get access to it. If there is a “*” in the Admin column, you need to connect remotely to the machine.</li>
<li>You need the appropriate access rights to a particular scope if it is a Singleton.  For example, if your script is running in a child domain, and a particular class is can only have one instance in the Global scope (AD), the user running your script needs permissions to access to the parent AD domain.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2009/07/07/ocs-wmi-reference/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Importing and Exporting OCS User Contacts</title>
		<link>http://blog.insideocs.com/2009/07/06/importing-and-exporting-ocs-user-contacts/</link>
		<comments>http://blog.insideocs.com/2009/07/06/importing-and-exporting-ocs-user-contacts/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 19:40:10 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[ocs contacts]]></category>
		<category><![CDATA[ocs exporting contacts]]></category>
		<category><![CDATA[ocs importing contacts]]></category>
		<category><![CDATA[office communications server contacts]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=381</guid>
		<description><![CDATA[<p>There are several administrative uses for manipulating user contacts – the two primary uses are backup &#38; restore, and inserting a standard set of contacts for an organization or department. There are two options available to import and export user contacts which I explain below.</p>
<p> 1) Command Line Tool (DBIMPEXP.EXE)</p>
<p>DBIMPEXP.EXE is a little-known tool which can [...]]]></description>
			<content:encoded><![CDATA[<p>There are several administrative uses for manipulating user contacts – the two primary uses are backup &amp; restore, and inserting a standard set of contacts for an organization or department. There are two options available to import and export user contacts which I explain below.</p>
<p> <strong>1) Command Line Tool (DBIMPEXP.EXE)</strong></p>
<p>DBIMPEXP.EXE is a little-known tool which can be used export or import a contact list for any user hosted in an OCS Enterprise Pool, or OCS Standard Edition server. The tool is available in one of three places:</p>
<ol>
<li>On an OCS 2007 Front-End in the <span style="text-decoration: underline;">C:\Program Files\Microsoft Office Communications Server 2007\Server\Support</span> directory.</li>
<li>On an OCS 2007 R2 Front-End in the <span style="text-decoration: underline;">C:\Program Files\Common Files\Microsoft Office Communications Server 2007 R2\Support</span> directory.</li>
<li>In the ‘Support’ directory on the OCS 2007 or OCS 2007 R2 installation media.</li>
</ol>
<p> In the same directory there is a DBIMPexp.exe Readme file that gives good information on usage and a FAQ.</p>
<p> With an Enterprise pool configuration, the big difference on the command line is the need to specify the backend SQL server with the /sqlserver switch. Here are 2 examples of how to use this tool:</p>
<ul>
<li>To export the contact list for all users in an Enterprise Pool:  <em><span style="text-decoration: underline;">dbimpexp.exe /hrxmlfile:contacts.xml /sqlserver:&lt;Pool SQL Hostname&gt;</span></em></li>
<li>To import a contact list for a specific user homed on a Standard Edition server:  <em><span style="text-decoration: underline;">dbimpexp.exe /hrxmlfile:contacts.xml /user:&lt;sip URL&gt;</span></em></li>
</ul>
<p> <strong>2) Using WMI (via a Custom Script or the LCSAddContacts.wsf Resource Kit Tool)</strong></p>
<p>Two WMI class expose user contact information. The <a href="http://msdn.microsoft.com/en-us/library/dd185919(office.13).aspx">MSFT_SIPESUserContactData class</a> specifies a single contact for an Office Communications Server user, and the settings for a contact group are represented by the <a href="http://msdn.microsoft.com/en-us/library/dd146647(office.13).aspx">MSFT_SIPESUserContactGroupData class</a>.</p>
<p>You can use your favorite scripting language (VBScript, Jscript, or Powershell) and write a custom solution, or you can use the Windows Script LCSAddContacts.wsf in the OCS Resource Kit. This resource kit script uses the above mentioned WMI classes and allows programmatic adding of contacts for OCS users.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2009/07/06/importing-and-exporting-ocs-user-contacts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cast Your Vote for the OCS 2007 Powerpack</title>
		<link>http://blog.insideocs.com/2009/02/09/cast-your-vote-for-the-ocs-2007-powerpack/</link>
		<comments>http://blog.insideocs.com/2009/02/09/cast-your-vote-for-the-ocs-2007-powerpack/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 16:45:04 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Management]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=224</guid>
		<description><![CDATA[<p>It was brought to my attention last week that the OCS 2007 PowerPack is in the running for SearchExchange.com&#8217;s best Exchange Unified Communication Product! If you’ve found this Powerpack useful and want to vote for it, you can by visiting SearchExchange.com&#8217;s web page: here.  The pack has been downloaded over 3400 times now!  Thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>It was brought to my attention last week that the <a title="OCS 2007 Powerpack" href="http://www.powergui.org/entry!default.jspa?categoryID=21&amp;externalID=1926" target="_blank">OCS 2007 PowerPack </a>is in the running for SearchExchange.com&#8217;s best Exchange Unified Communication Product! If you’ve found this Powerpack useful and want to vote for it, you can by visiting SearchExchange.com&#8217;s web page: <a href="http://searchexchange.techtarget.com/guide/newProductShowcase/category/0,296296,sid43_tax313080,00.html" target="_blank">here</a>.  The pack has been downloaded over 3400 times now!  Thanks to all those who have provided feedback and help evolve it into an effective OCS administrative management aid.</p>
<p>(Note: you&#8217;ll want to click on the “Vote here” hyperlink which can be a bit lost in all the other text)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2009/02/09/cast-your-vote-for-the-ocs-2007-powerpack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Provisioning OCS From the Command Line</title>
		<link>http://blog.insideocs.com/2009/01/16/189/</link>
		<comments>http://blog.insideocs.com/2009/01/16/189/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 01:09:39 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[OCS Command Line]]></category>
		<category><![CDATA[OCS Enable Users]]></category>
		<category><![CDATA[OCS Powershell]]></category>
		<category><![CDATA[OCS Scripting]]></category>

		<guid isPermaLink="false">http://blog.insideocs.com/?p=189</guid>
		<description><![CDATA[At the heart of OCS administration is enabling or disabling a particular user for OCS 2007 and setting various OCS features (a.k.a. provisioning a user).  This can be done through the OCS Administrative Console, but many administrators ask how to do it through the command line so that this functionality can be integrated with existing [...]]]></description>
			<content:encoded><![CDATA[<div>At the heart of OCS administration is enabling or disabling a particular user for OCS 2007 and setting various OCS features (a.k.a. provisioning a user).  This can be done through the OCS Administrative Console, but many administrators ask how to do it through the command line so that this functionality can be integrated with existing provisioning processes.</div>
<p>In a nutshell there are 4 options:</p>
<ol>
<li>Use a Windows Script (e.g. VBScript or JavaScript/JScript)</li>
<li>Use the OCS 2007 Resource Kit Script (LCSEnableConfigureUsers.wsf)</li>
<li>Use Microsoft Powershell</li>
<li>Use a Bulk Active Directory Import/Export Tool</li>
</ol>
<p>I explore these 4 options below. The first 3 options make use of WMI under the covers to set the &#8220;Enabled&#8221; property on the OCS user in Active Directory.</p>
<div><strong>Note</strong>: this post focuses on OCS <strong>user provisioning</strong> through the command line. OCS also has broader administrative capabilities through the command line.  The <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=E9F86F96-AA09-4DCA-9088-F64B4F01C703">OCS R2 Command Line Reference Document </a>and the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=84651696-1368-4700-AACF-DE9BD4456595">OCS 2007 Command Line Reference Document </a>covers more scope and details.</div>
<p><strong>Important notes for the first 3 (WMI-based) Options:<br />
</strong></p>
<div>
<ol>
<li>All options require the OCS WMI class <strong>MSFT_SIPESUserSetting</strong> to be available locally. The <strong>OCS Administrative Tools</strong> installs this WMI class and is an important pre-requisite.</li>
<li>You should run these solutions with the appropriate permissions to access the Active Directory user objects. The user you run as should be a member of the <strong>RTCUniversalUserAdmins </strong>group.</li>
<li>These options assume that the underlying AD user object has been created.  The VBScript example also assumes that the user has been OCS enabled &#8211; that is, the underlying AD object has been enabled at least once for OCS. See the blog entry <a href="http://blog.insideocs.com/2010/05/03/ad-attributes-required-to-enable-a-user-for-ocs/">AD Properties Required to Enable a User for OCS</a>  for what happens the first time an AD object has been enabled for OCS.</li>
<li>The WMI attribute the &#8220;EnabledForEnhancedPresence&#8221; property controls whether the user is enabled for Enhanced Presence and can sign-in with the new Communicator 2007 client (for the corresponding AD attribute, see the related blog post &#8220;<a href="http://blog.insideocs.com/2008/12/19/provisioning-ocs-users-and-the-ad-msrtcsip-optionflags-attribute/">Provisioning OCS Users (and the AD msRTCSIP-OptionFlags Attribute</a>&#8220;).</li>
</ol>
</div>
<h3>Option 1: Using a Script (e.g. VBScript or JavaScript/JScript)</h3>
<p>I&#8217;ve put together a sample VBScript to enable or disable a single OCS user.  Set the <strong>g_userURI</strong> and <strong>g_OCSEnableUser</strong> variables accordingly. You can use the guts of this script to easily do it for a batch of users (i.e. read a list of users from a file).</p>
<div style="margin-left:40px;"><em>WScript.Echo &#8220;Starting&#8221;</em><br />
<em></em><br />
<em>&#8216; SET THE USER WE WANT TO ENABLE or DISABLE</em><br />
<em>g_userURI = &#8220;sip:someTestUser@SIPDomain.com&#8221;</em><br />
<em></em><br />
<em>&#8216; TRUE TO ENABLE or FALSE TO DISABLE</em><br />
<em>g_OCSEnableUser = True</em><br />
<em></em><br />
<em>&#8216; Connect to a WMI object</em><br />
<em>Set wmiServer = CreateObject(&#8221;WbemScripting.SWbemLocator&#8221;).ConnectServer()</em><br />
<em></em><br />
<em>&#8216; Get the SIP User</em><br />
<em>Query = &#8220;SELECT * FROM MSFT_SIPESUserSetting where PrimaryURI = &#8216;&#8221; &amp; g_userURI &amp; &#8220;&#8216;&#8221;</em><br />
<em></em><br />
<em>Set OCSUsers = wmiServer.ExecQuery(Query)</em><br />
<em></em><br />
<em>If ( IsEmpty(OCSUsers) Or OCSUsers.Count = 0) Then</em><br />
<em>   WScript.Echo &#8220;No matching SIP user was found.&#8221;</em><br />
<em>Else</em><br />
<em>   For each OCSUser in OCSUsers            </em><br />
<em>    PrimaryURI = OCSUser.PrimaryURI</em><br />
<em>    HomeServerDN = OCSUser.HomeServerDN</em><br />
<em>    UserDN = OCSUser.UserDN</em><br />
<em></em><br />
<em>    &#8217; Wscript.Echo &#8220;URI: &#8221; &amp; PrimaryURI &amp; Chr(13) &amp; Chr(10) &amp; HomeServerDN &amp; Chr(13) &amp; Chr(10) &amp; UserDN</em><br />
<em></em><br />
<em>    OCSUser.Enabled = g_OCSEnableUser </em><br />
<em></em><br />
<em>    Err.Clear()</em><br />
<em>    </em><br />
<em>    OCSUser.Put_ 0     &#8216; 0 for create or update</em><br />
<em></em><br />
<em>    If Err = 0 Then</em><br />
<em>       WScript.Echo &#8220;Operation Successfull&#8221;</em><br />
<em>    Else</em><br />
<em>       WScript.Echo &#8220;Detected an error&#8221;</em><br />
<em>    End If</em><br />
<em>    Next</em><br />
<em>End If</em></div>
<h3>Option 2: Using an OCS 2007 Resource Kit Script</h3>
<div>Download the <a id="vek_" title="Microsoft Office Communications Server 2007 Resource Kit Tools" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b9bf4f71-fb0b-4de9-962f-c56b70a8aecd">Microsoft Office Communications Server 2007 Resource Kit Tools</a>.</div>
<div>The kit includes a windows script file called <strong>LCSEnableConfigureUsers.wsf</strong>, which contains VBScript that uses WMI to batch enable or disable users for OCS.</div>
<p>The script requires 2 input files: one file containing a list of users to enable or disable (specified with their SIP or distinguished names), and another file with the corresponding OCS user settings.</p>
<p>These files require some time and effort to set up, so this option is best for big batch operations. The Resource Kit ReadMe contains good information on prerequisities and permissions expected for this script.</p>
<h3>Option 3: Using Microsoft PowerShell</h3>
<p>Microsoft PowerShell is a powershell scripting environment that comes with a WMI provider that can be used to manage OCS. Powershell can be downloaded here.  Starting in Windows 2008, Powershell was included with part of the operating system. You can download Powershell 1.0 here: <a id="fnlk" title="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx" href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx">http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx</a> if you have Windows 2003. Once installed, you can easily script a solution to enable/disable OCS users.</p>
<p><strong>Option 1:  The underlying AD user object has been enabled for OCS (or LCS) at least once.</strong></p>
<p>If the AD user has never been enabled for OCS (or LCS), you will not be able to use this method to enable the user (they won&#8217;t show up in the MSFT_SIPESUSERSETTING class).  See <strong>Option 2 </strong>(below) .</p>
<p>To get a list of OCS Enabled users, you can simply issue the command:<br />
    &gt; get-wmiobject -class msft_sipesusersetting | ForEach-Object { $_.Enabled = true}</p>
<p>To enable a particular SIP user for OCS:<br />
    &gt;   get-wmiobject -class MSFT_SIPESUserSetting | where-object { $_.PrimaryURI -eq &#8220;sip:userid@SIPDomain&#8221; } | % { $_.Enabled = $True; $_.put() | out-null }</p>
<div>Note: the &#8220;%&#8221; is a Powershell shorthand alias for ForEach-Object.</div>
<div> </div>
<div><strong>Option 2: The underlying AD user object has never been enabled for OCS (or LCS).</strong></div>
<div> </div>
<div>Rather then take up a lot of space in this blog entry showing the Powershell script to do it, <a href="http://www.insideocs.com/Tools/EnabledOCSUser.ps1">I&#8217;ve made it available here: EnableOCSUser.ps1</a>.</div>
<div> </div>
<div>The heart of this script enables a user by:</div>
<div>1.  Creating a new instance of the WMI <a href="http://msdn.microsoft.com/en-us/library/bb632099(office.12).aspx">MSFT_SIPESUserSetting</a> class.</div>
<div>2. Setting the attributes Enabled, PrimaryURI, UserDN, HomeServerDN, and EnabledForEnhancedPresence.</div>
<div> </div>
<div>This function requires 3 input parameters, 2 of which are distinguished names from AD. <a href="http://www.insideocs.com/Tools/ADSearch.ps1">I&#8217;ve posted another script called ADSearch.ps1 </a>which will help you programmatically query for these attributes.</div>
<div> </div>
<div>If you get an exception which looks like this &#8220;<em>Exception calling &#8220;Put&#8221; with &#8220;0&#8243; argument(s): &#8220;Exception calling &#8220;Put&#8221; with &#8220;0&#8243; argument(s):</em>&#8220; on the WMI.Put() call to create the OCS user, usually it is:</div>
<ul>
<li>One or more of your parameters is not correct, or,</li>
<li>The OCS WMI object already exists for that user</li>
</ul>
<div>There is also a nifty GUI available to help create, manage and run Powershell scripts: PowerGUI (<a href="http://www.powergui.org/">www.powerGUI.org</a>). I created an OCS Powerpack last has this functionality and a whole lot more: <a href="http://www.powergui.org/entry!default.jspa?categoryID=21&amp;externalID=1926&amp;fromSearchPage=true">http://www.powergui.org/entry!default.jspa?categoryID=21&amp;externalID=1926&amp;fromSearchPage=true</a>.</div>
<h3>Option 4: Use a Bulk Active Directory Import/Export Tool</h3>
<p>Many OCS user features that can be set in the OCS management console GUI can be set or changed through underlying Active Directory (AD) attributes.  If you are attempting a bulk change, you&#8217;ll generally want to export the users, modify the data (to turn a feature on or off), and re-import the data.  The following two command line tools will allow you to do this:</p>
<ol>
<li><a href="http://support.microsoft.com/kb/555634">LDIFDE &#8211; Export / Import data from Active Directory</a>.  LDIFDE  Import/export information from/to Active Directory. It queries any available domain controller to retrieve/update AD information.</li>
<li><a href="http://technet.microsoft.com/en-us/library/cc772704(WS.10).aspx">CSVDE (Comma Separated Value Data Exchange)</a>.  CSVDE is a small command-line tool that can import and export data from AD in a CSV file. It is included in Windows 2003 installs by default (usually in the %windir%/system32 directory).</li>
</ol>
<p>Although not a command-line tool per se, <a href="http://www.codeplex.com/admodify">ADModify.NET </a>is an excellent GUI based tool for making batch changes to objects in AD.  It can record all changes that it made to an XML file which is handy.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2009/01/16/189/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OCS 2007 PowerGUI PowerPack Updated</title>
		<link>http://blog.insideocs.com/2008/08/25/ocs-2007-powergui-powerpack-updated/</link>
		<comments>http://blog.insideocs.com/2008/08/25/ocs-2007-powergui-powerpack-updated/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 02:51:10 +0000</pubDate>
		<dc:creator>Curtis Johnstone</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[microsoft ocs 2007 powershell]]></category>
		<category><![CDATA[microsoft ocs powershell management]]></category>
		<category><![CDATA[microsoft office communications server 2007 powershell]]></category>
		<category><![CDATA[microsoft office communications server 2007 wmi provider powershell]]></category>
		<category><![CDATA[ocs 2007 powershell]]></category>

		<guid isPermaLink="false">http://ocsbuzz.wordpress.com/?p=29</guid>
		<description><![CDATA[<p>In June I released an OCS 2007 PowerGUI powerpack.  PowerGUI is a free graphical interface to powershell, and I built the OCS powerpack which uses Powershell and the WMI provider to help the community use and manage Microsoft Office Communications Server 2007.  The powerpack has recently been updated (last week) to support the latest version [...]]]></description>
			<content:encoded><![CDATA[<p>In June I released an OCS 2007 PowerGUI powerpack.  PowerGUI is a free graphical interface to powershell, and I built the OCS powerpack which uses Powershell and the WMI provider to help the community use and manage Microsoft Office Communications Server 2007.  The powerpack has recently been updated (last week) to support the latest version of PowerGUI, and several bugs were fixed.</p>
<p>In a nutshell it exposes many of the available OCS Powershell cmdlet&#8217;s (actually a wrapper around the WMI provider) in an easy to use nice GUI that covers everything from OCS User Settings, Enterprise Voice, and Forest, Pool, and Server settings.</p>
<p>You can read about and download the OCS 2007 Powerpack here: <a href="http://www.powergui.org/entry!default.jspa?categoryID=21&amp;externalID=1926&amp;fromSearchPage=true">http://www.powergui.org/entry!default.jspa?categoryID=21&amp;externalID=1926&amp;fromSearchPage=true</a>.</p>
<p>MVP Dmitry Sotnikov has an excellent overview of the OCS pack on his blog at: <a href="http://dmitrysotnikov.wordpress.com/2008/06/20/ocs-management-console-on-steroids/">http://dmitrysotnikov.wordpress.com/2008/06/20/ocs-management-console-on-steroids/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.insideocs.com/2008/08/25/ocs-2007-powergui-powerpack-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

