<?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>Tristan Watkins on IT Infrastructure &#187; PowerShell Archive</title>
	<atom:link href="http://tristanwatkins.com/index.php/tag/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://tristanwatkins.com</link>
	<description>Technical guidance for SharePoint, Cloud Services, Windows and more</description>
	<lastBuildDate>Fri, 21 Oct 2011 23:33:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Active Directory Account Creation Mode in SharePoint 2010</title>
		<link>http://tristanwatkins.com/index.php/active-directory-account-creation-mode-sharepoint-2010/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=active-directory-account-creation-mode-sharepoint-2010</link>
		<comments>http://tristanwatkins.com/index.php/active-directory-account-creation-mode-sharepoint-2010/#comments</comments>
		<pubDate>Thu, 02 Jun 2011 23:38:24 +0000</pubDate>
		<dc:creator>Tristan Watkins</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint Foundation]]></category>
		<category><![CDATA[WSSv2]]></category>
		<category><![CDATA[WSSv3]]></category>

		<guid isPermaLink="false">http://tristanwatkins.com/?p=1919</guid>
		<description><![CDATA[Earlier this week, I had the misfortune of generating an error I&#8217;d never seen before when building a new SharePoint Server 2010 farm. The error first emerged when the SharePoint installation process landed me at the Farm Configuration Wizard page. I wouldn&#8217;t have been running it (not advisable ever, really), but it&#8217;s the first page [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this week, I had the misfortune of generating an error I&#8217;d never seen before when building a new SharePoint Server 2010 farm. The error first emerged when the SharePoint installation process landed me at the Farm Configuration Wizard page. I wouldn&#8217;t have been running it (not advisable ever, really), but it&#8217;s the first page that loads after the Product Configuration Wizard completes, so my first Central Administration page was this error:</p>
<p style="margin-left: 36pt;"><em>The page cannot be displayed because your server&#8217;s current configuration does not support it. To perform this task, use the command line operations in Stsadm.exe. </em></p>
<p>How odd, given the emphasis on PowerShell in SharePoint 2010! After a bit of head scratching and examining application and ULS logs, I navigated to the Central Admin home page and everything appeared to be fine, but then when I got around to creating a new Site Collection a bit later, I got the same error, even though I was able to create web/service applications. I had the same error when logged on as farm admin, farm admin + local admin rights, farm admin + SQL SysAdmin and farm admin + domain admin rights, so I was pretty sure it wasn&#8217;t a permission issue (and I should note my temporary fiddlery here is only really suitable for non-production environments). This error also occurred on some other Site Collection-specific pages.</p>
<p><span id="more-1919"></span>After searching for a solution I found a number of suggestions that this was related to insufficient rights for <em>Active Directory Account Creation Mode</em>. So I played around with SQL permissions/accounts a bit more and was eventually able to loosen things to the point where I could create a new site using PowerShell (still no luck using Central Administration). I also (strangely), had to specify an outbound e-mail server first!?!?! ULS Viewer unveiled that mystery, as well as an error attempting to create an account for my logged on user (which obviously already exists) in Active Directory. This error didn&#8217;t prevent me from creating the site, but this behaviour confirmed that the site was definitely running in Active Directory Account Creation Mode.</p>
<h3>What is Active Directory Account Creation Mode?</h3>
<p>Unfortunately, current Microsoft documentation is non-existent as far as I can tell, so I&#8217;ll start with the <a href="http://technet.microsoft.com/en-us/library/cc288437%28office.12%29.aspx">TechNet description from WSS2</a>:</p>
<blockquote><p>A new feature of Microsoft Windows SharePoint Services is account creation mode for Active Directory directory service. This feature replaces the local account creation feature in SharePoint Team Services 1.0 from Microsoft. Use Active Directory account creation mode when it is necessary to create new user accounts rather than using existing domain accounts. For example, an Internet service provider (ISP) might need the ability to allow SharePoint site owners the capability to create user accounts or invite users to collaborate on a Web site where existing domain accounts for those users do not already exist.</p></blockquote>
<p>Basically it&#8217;s a hosting mode in which SharePoint creates <strong>new</strong> users in Active Directory and <strong>these are the only accounts that can be used in this mode</strong>. I can attribute my lack of experience with this mode to my lack of experience with the free versions of SharePoint. Nearly all of my work has been focused on SPS2003, MOSS 2007 and SPS2010. I can&#8217;t pin down for certain whether this mode ever existed in the full versions of the product, but <a href="http://dishasharepointworld.blogspot.com/2011/04/active-directory-account-creation-mode.html">according to this article it is now SharePoint Foundation-only</a> and greyed out for SharePoint Server 2010. This <a href="http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/b8987e56-200e-4cee-9b69-2ae8b492a93b">TechNet forum post</a> from published SharePoint author and MCC <a href="http://mycentraladmin.wordpress.com/">John Ferringer</a> seems to back up that assertion. This post describes the mode well and also appears to answer my next question (my italics, John&#8217;s bold):</p>
<blockquote><p>SharePoint Foundation 2010 (the &#8220;free&#8221; version of SharePoint that is the successor to Windows SharePoint Services, or WSS) does have something called &#8220;Active Directory Account Creation&#8221; mode available, which functions much like what you saw in WSS v2. Accounts are first created in SharePoint, and then added to an Organizational Unit in Active Directory. The problem is that <em>this mode is only available at the time you install SharePoint, (its an option off the Advanced Settings button) and you <strong>can&#8217;t </strong>change that configuration setting after the fact</em>. Additionally, you can&#8217;t use existing AD accounts in that SharePoint farm, you&#8217;ll only be able to use accounts that you create through the tool and you can&#8217;t give an account an email address that&#8217;s already used by another account in AD. So you need to be mindful of those limitations if you chose to use that mode.</p></blockquote>
<p>I wish I&#8217;d seen this post sooner. It would have saved me some time. For what it&#8217;s worth, my investigation backs up this description as follows:</p>
<ul>
<li>There is no facility to disable this mode through Central Administration.</li>
<li>The STSADM commands only support identifying whether <a href="http://support.microsoft.com/kb/823507">WSS is in Active Directory Account Creation Mode</a> using <em>stsadm.exe -o getproperty -pn createadaccounts</em>. There is no corresponding <em>setproperty</em> command.</li>
<li>The PSCONFIG commands only support creating the farm in this mode – there does not appear to be a means of reverting from it. I believe the configdb&#8217;s <em>addomain</em> and <em>adorgunit</em> parameters are responsible for enabling this mode (I could be wrong – the documentation is a bit scant), but I can&#8217;t find a facility for reverting it.</li>
<li>PowerShell is now the preferred means of creating the farm and would be the preferred means of enabling this mode using the <a href="http://technet.microsoft.com/en-us/library/ff607838.aspx">New-SPConfigurationDatabase</a> command. As far as I can tell the <em>DirectoryDomain</em> and <em>DirectoryOrganizationUnit</em> parameters are responsible for enabling this mode now, although again, the documentation is unclear to me.</li>
<li>I even tried to make the change through the API with the help of a friendly neighbourhood developer. Things have changed a bit from <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spglobaladmin.accountcreationmodeenabled.aspx">WSS2</a> to <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebservice.createactivedirectoryaccounts.aspx">WSS3/SharePoint Foundation</a>. At any rate, we found the attribute and set it to &#8220;false&#8221;, but unfortunately this did not rescue my nascent farm.</li>
</ul>
<p>In short, it looks like there&#8217;s no way back.</p>
<h3>How Could This Have Happened?</h3>
<p>Given that this mode is only supposed to be present in SharePoint Foundation, I&#8217;m really at a loss to explain how I activated it on SharePoint Server 2010. I may have fat-fingered one of the New-SPConfigurationDatabase <em>DirectoryDomain</em> or <em>DirectoryOrganizationUnit</em> parameters I suppose, but I would be really surprised if I did that in a way that allowed me to successfully run the command. In the end, I reverted to my pre-installation snapshots and rebuilt my farm. I don&#8217;t feel that was such a waste now that I&#8217;ve found John Ferringer&#8217;s description and realise there never would have been a way back, but if you find this post through similar folly, hopefully you won&#8217;t waste any time trying to revert the farm like I did.</p>
<p>Interestingly, while researching this topic, I stumbled across <a href="http://social.technet.microsoft.com/Forums/en/sharepoint2010setup/thread/9ac04d39-56e6-43cf-8b91-55d143d2067a">a TechNet forum post from Andrew Milsark of FPWeb</a> stating that they&#8217;ve, &#8220;moved away from using AD Account creation mode all together&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://tristanwatkins.com/index.php/active-directory-account-creation-mode-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Scheduled Sitemap Generation for SharePoint 2010 Websites</title>
		<link>http://tristanwatkins.com/index.php/scheduled-sitemap-generation-sharepoint-2010-websites/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=scheduled-sitemap-generation-sharepoint-2010-websites</link>
		<comments>http://tristanwatkins.com/index.php/scheduled-sitemap-generation-sharepoint-2010-websites/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 22:20:23 +0000</pubDate>
		<dc:creator>Tristan Watkins</dc:creator>
				<category><![CDATA[IT Management]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[robots.txt]]></category>
		<category><![CDATA[Scheduling]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[sitemap]]></category>

		<guid isPermaLink="false">http://tristanwatkins.com/?p=1087</guid>
		<description><![CDATA[As promised in my SharePoint 2010 SEO Analysis with the IIS SEO Toolkit post, while the IIS.NET SEO Toolkit does an excellent job of generating an initial sitemap and providing a nice GUI for ad hoc updates, it does not offer any obvious scheduling mechanism to ensure that your sitemap stays current with the changing [...]]]></description>
			<content:encoded><![CDATA[<p>As promised in my <a title="SharePoint 2010 SEO Analysis with the IIS SEO Toolkit" href="http://tristanwatkins.com/index.php/sharepoint-2010-seo-analysis-with-the-iis-seo-toolkit/" target="_blank">SharePoint 2010 SEO Analysis with the IIS SEO Toolkit</a> post, while the IIS.NET SEO Toolkit does an excellent job of generating an initial sitemap and providing a nice GUI for ad hoc updates, it does not offer any obvious scheduling mechanism to ensure that your sitemap stays current with the changing content in your CMS. Thankfully, my colleague Glyn Clough <a title="Generate A Sitemap For SharePoint 2010 Using PowerShell" href="http://www.glynblogs.com/2010/07/generate-a-sitemap-for-sharepoint-2010-using-powershell.html" target="_blank">whipped up some PowerShell</a> to produce a full sitemap for your web application based on <a title="Generate SharePoint 2010 Sitemap with Windows PowerShell" href="http://blogs.msdn.com/b/opal/archive/2010/04/13/generate-sharepoint-2010-sitemap-with-windows-powershell.aspx" target="_blank">Jie Li&#8217;s initial script</a>, which was scoped at the root web. Running this as a Windows scheduled task will get you a very up-to-date sitemap for all sites in your web application with very little on-going maintenance. Nice one Glyn!</p>
]]></content:encoded>
			<wfw:commentRss>http://tristanwatkins.com/index.php/scheduled-sitemap-generation-sharepoint-2010-websites/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixing the Usage and Health Data Collection Service Application Proxy</title>
		<link>http://tristanwatkins.com/index.php/fixing-the-usage-and-health-data-collection-sa/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fixing-the-usage-and-health-data-collection-sa</link>
		<comments>http://tristanwatkins.com/index.php/fixing-the-usage-and-health-data-collection-sa/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 00:19:33 +0000</pubDate>
		<dc:creator>Tristan Watkins</dc:creator>
				<category><![CDATA[IT Management]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Service Application]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Usage and Health Data Collection]]></category>
		<category><![CDATA[Web Analytics]]></category>

		<guid isPermaLink="false">http://tristanwatkins.com/?p=1020</guid>
		<description><![CDATA[You may notice that the Usage and Health Data Collection Proxy is Stopped after deploying it in your environment. This is not just a matter of starting the service like it is with some Service Applications. In this case the SA proxy itself appears to be stopped. ]]></description>
			<content:encoded><![CDATA[<p>Unfortunately I&#8217;ve found a problem with our development build, or rather, with SharePoint 2010. You may notice that the <em>Usage and Health Data Collection Proxy</em> is Stopped after deploying it in your environment. This is not just a matter of starting the service like it is with some Service Applications. In this case the SA proxy itself appears to be stopped. It appears that this is a known problem when provisioning this Service Application via the GUI. In fact, ours was created automatically as part of the Search Service Application creation process. At any rate, it doesn&#8217;t work in its current state in our environments, so it won&#8217;t actually collect any data.</p>
<p>To fix this just requires a couple of lines of PowerShell, courtesy of <a href="http://pacsharepoint.blogspot.com/2010/06/usage-and-health-data-collection-proxy.html">this article</a> (to which I&#8217;ve added some clarification here).</p>
<p><span id="more-1020"></span></p>
<p>If you go to the <em>Manage Service Applications</em> link you&#8217;ll see the problem:</p>
<p><a class="lightbox" href="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs1.png"><img class="alignnone size-full wp-image-1025" title="070810_1519_FixingtheUs1" src="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs1.png" alt="070810 1519 FixingtheUs1 Fixing the Usage and Health Data Collection Service Application Proxy" width="479" height="30" /></a><a href="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs1.png"></a></p>
<p>Open the SharePoint 2010 Management Shell and Run as Administrator.</p>
<p><a class="lightbox" href="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs2.png"><img class="alignnone size-full wp-image-1026" title="070810_1519_FixingtheUs2" src="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs2.png" alt="070810 1519 FixingtheUs2 Fixing the Usage and Health Data Collection Service Application Proxy" width="481" height="491" /></a></p>
<p><span style="text-decoration: underline;">Update, 10 January 2011</span><br />
Tom suggested an improvement in the comments here, which I agree is better!</p>
<blockquote><p>$sap = Get-SPServiceApplicationProxy | where-object {$_.TypeName -eq “Usage and Health Data Collection Proxy”}<br />
$sap.Provision()</p></blockquote>
<p><span style="text-decoration: underline;">Original approach</span></p>
<p style="padding-left: 30px;">Run <em>Get-SPServiceApplicationProxy</em> to enumerate the IDs of all the Service Application Proxies in your farm.</p>
<p style="padding-left: 30px;"><a class="lightbox" href="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs3.png"><img class="alignnone size-full wp-image-1027" title="070810_1519_FixingtheUs3" src="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs3.png" alt="070810 1519 FixingtheUs3 Fixing the Usage and Health Data Collection Service Application Proxy" width="468" height="97" /></a><br />
(note: you will probably have more Service Application Proxies than these)</p>
<p style="padding-left: 30px;">Copy the ID for the WSS_UsageApplication.</p>
<p style="padding-left: 30px;">Run the following two lines of PowerShell.</p>
<p style="padding-left: 30px;"><code>$UP = Get-SPServiceApplicationProxy | where {$_.ID -eq "<strong>&lt;PASTE COPIED ID HERE&gt;</strong>"}<br />
$UP.Provision()</code></p>
<p style="padding-left: 30px;"><a class="lightbox" href="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs4.png"><img class="alignnone size-full wp-image-1028" title="070810_1519_FixingtheUs4" src="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs4.png" alt="070810 1519 FixingtheUs4 Fixing the Usage and Health Data Collection Service Application Proxy" width="468" height="36" /></a></p>
<p>If you refresh the Manage Service Application page the proxy should be started now.</p>
<p><a class="lightbox" href="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs5.png"><img class="alignnone size-full wp-image-1029" title="070810_1519_FixingtheUs5" src="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs5.png" alt="070810 1519 FixingtheUs5 Fixing the Usage and Health Data Collection Service Application Proxy" width="479" height="30" /></a></p>
<p>Once that has been configured, the usage data will not appear immediately in all of the usage reports because the timer jobs to collect the data will not have run yet. The granularity of the data collection and processing is pretty fine if you want to reconfigure them for your needs, but keep in mind that none of the Web Analytics reports will appear for at least 24 hours after this fix is in place. They do not allow reporting on the current day. If you try to configure a Custom Date Range to include today&#8217;s date you will get the following message:</p>
<p><a class="lightbox" href="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs6.png"><img class="alignnone size-full wp-image-1030" title="070810_1519_FixingtheUs6" src="http://tristanwatkins.com/wp-content/uploads/070810_1519_FixingtheUs6.png" alt="070810 1519 FixingtheUs6 Fixing the Usage and Health Data Collection Service Application Proxy" width="414" height="146" /></a></p>
<p>I&#8217;ll try to track this issue as updates come out.</p>
]]></content:encoded>
			<wfw:commentRss>http://tristanwatkins.com/index.php/fixing-the-usage-and-health-data-collection-sa/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Recent links</title>
		<link>http://tristanwatkins.com/index.php/recent-links/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=recent-links</link>
		<comments>http://tristanwatkins.com/index.php/recent-links/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 00:41:37 +0000</pubDate>
		<dc:creator>Tristan Watkins</dc:creator>
				<category><![CDATA[Client applications]]></category>
		<category><![CDATA[Power]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharedView]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://tristanwatkins.com/?p=467</guid>
		<description><![CDATA[Power Management and Utility Companies Free web-hosted desktop sharing with a Live ID: Microsoft SharedView 10 cool free modules for PowerShell: PowerShellPack Loads of free scripts at the TechNet Script Center Gallery]]></description>
			<content:encoded><![CDATA[<ul>
<li><a title="System Center Team Blog" href="http://blogs.technet.com/systemcenter/archive/2009/10/05/power-management-and-utility-companies.aspx" target="_blank">Power Management and Utility Companies</a></li>
<li>Free web-hosted desktop sharing with a Live ID: <a title="Microsoft SharedView" href="http://www.microsoft.com/downloads/details.aspx?familyid=95af94ba-755e-4039-9038-63005ee9d33a&amp;displaylang=en" target="_blank">Microsoft SharedView</a></li>
<li>10 cool free modules for PowerShell: <a title="PowerShellPack" href="http://code.msdn.microsoft.com/PowerShellPack" target="_blank">PowerShellPack</a></li>
<li>Loads of free scripts at the <a title="TechNet Script Center Gallery" href="http://gallery.technet.microsoft.com/scriptcenter/en-us/" target="_blank">TechNet Script Center Gallery</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tristanwatkins.com/index.php/recent-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

