<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Jimmie's Sharings</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jimmiet/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jimmiet/feed.xml</link>
    <description>SharePoint/MOSS information.</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:05:40 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to Get DB Server Information from the Command Line</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/how-to-get-db-server-information-from-the-command-line</link>
      <pubDate>Tue, 14 Aug 2012 11:52:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/08/14/how-to-get-db-server-information-from-the-command-line/</guid>
      <description><![CDATA[Life is simple in SharePoint development environments. You typically have administrative access to...]]></description>
      <content:encoded><![CDATA[<p>Life is simple in SharePoint development environments. You typically have administrative access to all servers. Need to check database permissions or grant access to another account? Want to create or drop a database? Want to do a backup or restore? No problem, logon the DB server and open up SQL Server Management Studio.</p>
<p>But what would it be like to develop in a SharePoint environment if you didn&rsquo;t have database server access? This is a typical situation at large enterprises. The database team is a separate group, possibly located in another time zone on the other side of the world. This team closely guards their turf, not allowing anyone outside their team to logon their database servers. You panic because you can&rsquo;t touch SQL Server!</p>
<p><span style="color: #ffffff;" color="#ffffff"><span style="background-color: #000000;"><strong>CAVEAT</strong>: Remember, directly accessing SharePoint databases is NOT supported. The following procedures illustrated what could be done in an emergency when a DBA is not available. This information is presented as a troubleshooting alternative in development and test environments only. These procedures should NOT be performed against a production farm.</span></span></p>
<p>But wait, you are not totally out of luck. First, let&rsquo;s analyze the situation. What do you know?</p>
<ol>
<li>You probably have an installation account (local server administrator) and password.</li>
<li>Similarly, you probably have the SharePoint farm account and password.</li>
<li>You know the farm account can connect to the SQL Server, after all, that is how the configuration database is accessed.</li>
</ol>
<p>With this information, you probably have a door to the SQL Server. It may not be as easy as the point-and-click SQL Server Management Studio UI, but it is all you need. So what do you do?</p>
<ol>
<li><a href="https://www.microsoft.com/downloads/details.aspx?familyid=228de03f-3b5a-428a-923f-58a033d316e1&amp;displaylang=en&amp;tm" target="_blank">Download</a> the SQLCMD command line utility. This is a small (12 MB) msi package you can install on one of the SharePoint servers. Scroll down to the heading <strong>Microsoft SQL Server 2008 R2 Command Line Utilities</strong>. Quoting from that page: <br /><em>The SQLCMD utility allows users to connect to, send Transact-SQL batches from, and output rowset information from SQL Server 7.0, SQL Server 2000, SQL Server 2005, and SQL Server 2008 instances.</em> <br />Click the link <b><a href="https://go.microsoft.com/fwlink/?LinkId=123706&amp;clcid=0x409">X64 Package</a></b> (SqlCmdLnUtils.msi) to download. If you are downloading to your local machine because of proxy or firewall restrictions on the SharePoint server, map a drive to the SharePoint server and copy the installation package to the SharePoint server. </li>
<li>Logon the SharePoint server as the installation account. Install the package, taking all the default options. The installation only takes a few seconds. <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/3414.sqlcmd1_2273E95D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/3414.sqlcmd1_5F00_2273E95D.png"><img style="display: inline; background-image: none;" title="sqlcmd1" border="0" alt="sqlcmd1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/3404.sqlcmd1_thumb_2263C390.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/3404.sqlcmd1_5F00_thumb_5F00_2263C390.png" width="324" height="244" /></a> </li>
<li>Optionally, update the PATH environment variable to make it easier to use SQLCMD in command prompt. Open the <strong>Control Panel &gt; System &gt; Advanced system settings</strong>. Click the <strong>Advanced</strong> tab, and then the <strong>Environment Variables</strong> button. In the bottom pane, System variables, scroll down to the <strong>Path</strong> variable and then click the <strong>Edit</strong> button. <br />Go to the end of the path, and then add a <strong>semicolon</strong> and <strong>C:\Program Files\Microsoft SQL Server\100\Tools\Binn</strong> or whatever path where you installed SQLCMD. Click <strong>OK</strong> to close all the dialog windows. <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/6523.sqlcmd2_3781A36B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/6523.sqlcmd2_5F00_3781A36B.png"><img style="display: inline; background-image: none;" title="sqlcmd2" border="0" alt="sqlcmd2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/1325.sqlcmd2_thumb_6F9FCEE9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/1325.sqlcmd2_5F00_thumb_5F00_6F9FCEE9.png" width="294" height="323" /></a> </li>
<li>Logoff off as the installation account and logon as the farm administrator account so you are running in the security context of the farm account, or alternatively, open a command prompt and <strong>Run as</strong> the farm account. </li>
<li>If you don&rsquo;t know the SQL Server instance name from memory, open <strong>Central Administration &gt; System Settings &gt; Manage servers in this farm</strong>, and find the database server under <strong>Farm Information</strong> at the top of the page. </li>
<li>Open a command prompt and begin entering Transact-SQL commands.</li>
</ol>
<p>The farm administrator has <strong>securityadmin</strong> and <strong>dbcreator</strong> roles already (else the farm wouldn&rsquo;t work), so you can submit T-SQL commands.</p>
<p>First, connect to the server by entering:</p>
<p><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">sqlcmd &ndash;S &lt;database-server-instance-name&gt;</span></p>
<p>To find what accounts have server roles, enter:</p>
<p><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">EXEC sp_helpsrvrolemember <br />GO</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/8666.sqlcmd3_785FB168.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/8666.sqlcmd3_5F00_785FB168.png"><img style="display: inline; background-image: none;" title="sqlcmd3" border="0" alt="sqlcmd3" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4137.sqlcmd3_thumb_46A49413.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4137.sqlcmd3_5F00_thumb_5F00_46A49413.png" width="356" height="297" /></a></p>
<p>To display all the database names, enter:</p>
<p><span style="background-color: #cccccc;">SELECT SUBSTRING(name,1, 64), database_id FROM sys.databases ORDER BY name <br />GO</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/3566.sqlcmd5_74158E09.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/3566.sqlcmd5_5F00_74158E09.png"><img style="display: inline; background-image: none;" title="sqlcmd5" border="0" alt="sqlcmd5" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/8838.sqlcmd5_thumb_438EE3C6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/8838.sqlcmd5_5F00_thumb_5F00_438EE3C6.png" width="360" height="226" /></a></p>
<p>To look at information for a specific database, you must switch context to that database with the USE command. The following switches context to the Secure Store Service database.</p>
<p><span style="background-color: #cccccc;">USE SecureStore2_DVPROD_shared <br />GO</span></p>
<p>To find the DBOs for the database, enter:</p>
<p><span style="background-color: #cccccc;">EXEC sp_helprolemember 'db_owner' <br />GO</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4048.sqlcmd4_1F29B3AA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4048.sqlcmd4_5F00_1F29B3AA.png"><img style="display: inline; background-image: none;" title="sqlcmd4" border="0" alt="sqlcmd4" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/0312.sqlcmd4_thumb_2E7D15B9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/0312.sqlcmd4_5F00_thumb_5F00_2E7D15B9.png" width="353" height="139" /></a></p>
<p>To get the database sizes, create a SQL batch file with notepad. Enter the following SQL statements and save the file as DatabaseFileSizes.sql.</p>
<blockquote>
<p><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">SELECT <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; databasename = DB_NAME(dbid), <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; name, <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; fileid, <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; drive = LEFT(filename,1), <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; filename, <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; filegroup = FILEGROUP_NAME(groupid), <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 'size KB' = CONVERT(nvarchar(15), CONVERT(bigint, size) * 8), <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 'maxsize KB' = (CASE maxsize WHEN-1 THEN <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N'Unlimited' <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ELSE <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONVERT(nvarchar(15), CONVERT(bigint, maxsize) * 8) END), <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 'growth' = (CASE status &amp; 0x100000 WHEN 0x100000 THEN <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONVERT(nvarchar(15), growth) + N'%' <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ELSE <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONVERT(nvarchar(15), CONVERT(bigint, growth) * 8) END), <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 'usage' = (CASE status &amp; 0x40 WHEN 0x40 THEN 'log only' ELSE 'data only' END) <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">FROM sys.sysaltfiles <br /></span><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">ORDER BY drive, size</span></p>
</blockquote>
<p>Next, exit the current SQLCMD session by entering <span style="background-color: #cccccc;">EXIT</span>.</p>
<p>Enter the following command which references the file just created batch file as the input file:</p>
<p><span style="font-family: Courier New; font-size: x-small; background-color: #cccccc;" face="Courier New" size="2">sqlcmd &ndash;S &lt;database-server-instance-name&gt; &ndash;I .\DatabaseFileSizes.sql &ndash;O .\DatabaseFileSizes.txt</span></p>
<p>The output file (DatabaseFileSizes.txt) can be imported into Excel for further analysis; such as, tracking trends from month-to-month.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/1817.sqlcmd6_3F04EADA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/1817.sqlcmd6_5F00_3F04EADA.png"><img style="display: inline; background-image: none;" title="sqlcmd6" border="0" alt="sqlcmd6" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/6663.sqlcmd6_thumb_12D7C81C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/6663.sqlcmd6_5F00_thumb_5F00_12D7C81C.png" width="619" height="286" />&nbsp;</a></p>
<p>These examples should give you a good taste of what is possible. You are limited only by the farm account permissions and your knowledge of T-SQL.</p>]]></content:encoded>
    </item>
    <item>
      <title>Schedule a Full User Profile Import</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/schedule-a-full-user-profile-import</link>
      <pubDate>Sat, 11 Aug 2012 06:45:40 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/08/11/schedule-a-full-user-profile-import/</guid>
      <description><![CDATA[It may be desirable to perform full profile imports on a regular schedule, possibly once a month or...]]></description>
      <content:encoded><![CDATA[<p>It may be desirable to perform full profile imports on a regular schedule, possibly once a month or once a quarter. This would ensure picking up changes in the import connection rules (included containers and filters for example), and changes to the profile property schema (new properties and changes in mapping to existing properties).</p>  <p>The Central Administration interface only provides a means to schedule incremental imports. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/0317.FullImport1_38239BFA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/0317.FullImport1_5F00_38239BFA.png"><img style="display: inline; background-image: none;" title="FullImport1" border="0" alt="FullImport1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4034.FullImport1_thumb_42088D65.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4034.FullImport1_5F00_thumb_5F00_42088D65.png" width="359" height="156" /></a></p>  <p>A full import can be started through Central Administration on-demand by using the <b>Start Profile Synchronization</b> link, but this link does not provide for scheduling.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/8233.FullImport2_21151ABE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/8233.FullImport2_5F00_21151ABE.png"><img style="display: inline; background-image: none;" title="FullImport2" border="0" alt="FullImport2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/3438.FullImport2_thumb_595391D6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/3438.FullImport2_5F00_thumb_5F00_595391D6.png" width="244" height="58" /></a></p>  <p>It is possible to schedule full imports using the Windows Server Task Scheduler and a Windows PowerShell script.</p>  <ol>   <li>Create the Windows PowerShell script <b>ExecuteFullImport.ps1 </b>and associated configuration file<b> ExecuteFullImport.xml</b>. Place in the standard scripts folder of the server.&#160;&#160; (Source code below. Special credit goes to Brian Lalancette and the AutoSPInstaller project for foundational code included in this script, reference <a title="https://autospinstaller.codeplex.com/" href="https://autospinstaller.codeplex.com.&nbsp;">https://autospinstaller.codeplex.com. </a> AutoSPInstaller is a fantastic script to build multi-server SharePoint 2010 farms.)      <br /></li>    <li>Create a schedule task. <b>Start</b> Menu <b>&gt; Administrative Tools</b> &gt; <b>Task Scheduler</b>;       <br />or <b>Run</b> &gt; <b>taskschd.msc</b>.       <br /></li>    <li>Right click the <b>Task Scheduler Library</b> node in the left pane, and select <b>Create Task</b>.       <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/5584.FullImport3_469E981F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/5584.FullImport3_5F00_469E981F.png"><img style="display: inline; background-image: none;" title="FullImport3" border="0" alt="FullImport3" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/8540.FullImport3_thumb_0CAF5533.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/8540.FullImport3_5F00_thumb_5F00_0CAF5533.png" width="244" height="107" /></a>      <br /></li>    <li>On the <b>General Tab</b>, enter the <b>Name</b> and <b>Description</b>.       <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4118.FullImport4_76E56CD5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4118.FullImport4_5F00_76E56CD5.png"><img style="display: inline; background-image: none;" title="FullImport4" border="0" alt="FullImport4" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/7651.FullImport4_thumb_63C44029.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/7651.FullImport4_5F00_thumb_5F00_63C44029.png" width="244" height="185" /></a>      <br /></li>    <li>On the <b>Triggers Tab</b>, click the <b>New</b> button, and then enter the desired schedule.       <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/2376.FullImport5_49F009FA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/2376.FullImport5_5F00_49F009FA.png"><img style="display: inline; background-image: none;" title="FullImport5" border="0" alt="FullImport5" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/6175.FullImport5_thumb_5AF437DD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/6175.FullImport5_5F00_thumb_5F00_5AF437DD.png" width="244" height="210" /></a>      <br /></li>    <li>On the <b>Actions Tab</b>, select <i>Start a program</i>, enter <b>PowerShell</b> as the program/script, enter the script name <b>ExecuteFullImport.ps1</b>, and Start in put the directory containing the script and associated xml configuration file.       <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/1362.FullImport6_7317A238.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/1362.FullImport6_5F00_7317A238.png"><img style="display: inline; background-image: none;" title="FullImport6" border="0" alt="FullImport6" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/6562.FullImport6_thumb_11EE1617.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/6562.FullImport6_5F00_thumb_5F00_11EE1617.png" width="244" height="173" /></a>      <br /></li>    <li>Optionally, modify the <b>Conditions</b> and <b>Settings</b> tabs’ configuration.       <br /></li>    <li>The script will run at the scheduled time. The PowerShell window remains open by default. Press any key to close the window.      <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/0211.FullImport7_0D0B625B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/0211.FullImport7_5F00_0D0B625B.png"><img style="display: inline; background-image: none;" title="FullImport7" border="0" alt="FullImport7" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/2451.FullImport7_thumb_16F053C6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/2451.FullImport7_5F00_thumb_5F00_16F053C6.png" width="244" height="185" /></a></li>  </ol>  <p>&#160;</p>    <hr />  <p><b>ExecuteFullImport.ps1 </b></p>  <p>############################################################   <br />### Powershell commands to execute a User Profile full import    <br />############################################################</p>  <p>param    <br />(    <br />&#160;&#160;&#160; [string]$InputFile = &quot;ExecuteFullImport.xml&quot;     <br />)</p>  <p>###############################################################   <br />### ExecutionPloicy Note: errors/warnings expected    <br />###############################################################</p>  <p>Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -confirm:$false   <br />write-host &quot;Displaying execution policy&quot; -foregroundcolor yellow    <br />Get-ExecutionPolicy -List</p>  <p>$0 = $myInvocation.MyCommand.Definition   <br />$dp0 = [System.IO.Path]::GetDirectoryName($0)</p>  <p># Get the configuration file contents   <br />$configPath = Join-Path -Path $dp0 -ChildPath $InputFile    <br />[xml]$xmlinput = (Get-Content $configPath)</p>  <p>#region functions   <br />###############################################################    <br /># Note: Following functions borrowed from AutoSPInstallerFunctions.ps1     <br />Function StartTracing    <br />{    <br />&#160;&#160;&#160; $LogTime = Get-Date -Format yyyy-MM-dd_h-mm    <br />&#160;&#160;&#160; $script:LogFile = &quot;$env:USERPROFILE\Desktop\ExecuteFullImport-$LogTime.rtf&quot;    <br />&#160;&#160;&#160; Start-Transcript -Path $LogFile -Force    <br />}    <br />&#160; <br />Function WriteLine    <br />{    <br />&#160;&#160;&#160; Write-Host -ForegroundColor White &quot;--------------------------------------------------------------&quot;    <br />}</p>  <p>Function Pause   <br />{    <br />&#160;&#160;&#160; #From <a href="https://www.microsoft.com/technet/scriptcenter/resources/pstips/jan08/pstip0118.mspx">https://www.microsoft.com/technet/scriptcenter/resources/pstips/jan08/pstip0118.mspx</a>    <br />&#160;&#160;&#160; Write-Host &quot;Press any key to exit...&quot;    <br />&#160;&#160;&#160; $null = $host.UI.RawUI.ReadKey(&quot;NoEcho,IncludeKeyDown&quot;)    <br />}    <br />###############################################################    <br />#endregion functions</p>  <p>StartTracing   <br />If (!$env:StartDate) {$env:StartDate = Get-Date}    <br />Write-Host -ForegroundColor White &quot;-----------------------------------&quot;    <br />Write-Host -ForegroundColor White &quot;| ExecuteFullImport script&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&quot;    <br />Write-Host -ForegroundColor White &quot;| Started on: $env:StartDate |&quot;    <br />Write-Host -ForegroundColor White &quot;-----------------------------------&quot;</p>  <p>Try    <br />{    <br />&#160;&#160;&#160; # The SharePoint PowerShell snap-in is required    <br />&#160;&#160;&#160; If ((Get-PSSnapin |?{$_.Name -eq &quot;Microsoft.SharePoint.PowerShell&quot;})-eq $null)    <br />&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WriteLine    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor White &quot; - Loading SharePoint Powershell Snapin&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WriteLine    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; $stopTimerJob = $xmlinput.Configuration.Farm.FullImport.StopCleanUpTimerJob    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; if ($stopTimerJob)    <br />&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $timerJob = Get-SPTimerJob &quot;mysitecleanup&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Disable-SPTimerJob $timerJob    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WriteLine    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor White &quot; - IMPORTANT: My Site Clean Up time job has been disabled.&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor White &quot; - Remember to enable the timer job after the import completes.&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WriteLine    <br />&#160;&#160;&#160; }</p>  <p>&#160;&#160;&#160; # Get the Profile Service Application   <br />&#160;&#160;&#160; $upa = (Get-SPServiceApplication | ? {$_.GetType().ToString() -eq &quot;Microsoft.Office.Server.Administration.UserProfileApplication&quot;})    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; # Start the full profile import job    <br />&#160;&#160;&#160; # NOTE: This method call appears to &quot;eat&quot; exceptions, so it &quot;fails silently&quot;. Check the application event log for error details.    <br />&#160;&#160;&#160; $upa.StartImport($true)    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; Write-Host -ForegroundColor White &quot; - Full Import request submitted, monitor progress with the Central Administration User Profile Service Application page&quot;</p>  <p>}   <br />Catch     <br />{    <br />&#160;&#160;&#160; WriteLine    <br />&#160;&#160;&#160; Write-Host -ForegroundColor Yellow &quot; - Script aborted!&quot;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; If ($_.FullyQualifiedErrorId -ne $null -and $_.FullyQualifiedErrorId.StartsWith(&quot; - &quot;))     <br />&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; # Error messages starting with &quot; - &quot; are thrown directly from this script    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor Red $_.FullyQualifiedErrorId    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; # Lately, loading the snapin throws an error: &quot;System.TypeInitializationException: The type initializer for 'Microsoft.SharePoint.Utilities.SPUtility' threw an exception. ---&gt; System.IO.FileNotFoundException:&quot;...    <br />&#160;&#160;&#160; ElseIf ($_.Exception.Message -like &quot;*Microsoft.SharePoint.Utilities.SPUtility*&quot;)    <br />&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor Yellow &quot; - A known (annoying) issue occurred loading the SharePoint Powershell snapin.&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor Yellow &quot; - We need to re-launch the script to clear this condition.&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $ScriptCommandLine = $($MyInvocation.Line)    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor White &quot; - Re-Launching:&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Write-Host -ForegroundColor White &quot; - $ScriptCommandLine&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Start-Process -WorkingDirectory $PSHOME -FilePath &quot;powershell.exe&quot; -ArgumentList &quot;$ScriptCommandLine&quot; -Verb RunAs    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Start-Sleep 10    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; Exit    <br />&#160;&#160;&#160; }    <br />&#160;&#160;&#160; Else    <br />&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; #Other error messages are exceptions. Can't find a way to make this Red    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $_ | Format-List -Force    <br />&#160;&#160;&#160; }</p>  <p>&#160;&#160;&#160; $env:EndDate = Get-Date   <br />&#160;&#160;&#160; Write-Host -ForegroundColor White &quot;-----------------------------------&quot;    <br />&#160;&#160;&#160; Write-Host -ForegroundColor White &quot;| ExecuteFullImport script&#160;&#160;&#160;&#160;&#160;&#160;&#160; |&quot;    <br />&#160;&#160;&#160; Write-Host -ForegroundColor White &quot;| Started on: $env:StartDate |&quot;    <br />&#160;&#160;&#160; Write-Host -ForegroundColor White &quot;| Aborted:&#160;&#160;&#160; $env:EndDate |&quot;    <br />&#160;&#160;&#160; Write-Host -ForegroundColor White &quot;-----------------------------------&quot;    <br />}    <br />Finally     <br />{    <br />&#160;&#160;&#160; Stop-Transcript    <br />&#160;&#160;&#160; If ($ScriptCommandLine) {Exit}    <br />&#160;&#160;&#160; Else {Pause}    <br />&#160;&#160;&#160; Invoke-Item $LogFile    <br />}    <br /></p>  <p>   <hr /><strong>ExecuteFullImport.xml</strong></p>  <p>&lt;?xml version=&quot;1.0&quot; ?&gt;   <br />&lt;Configuration&gt;    <br />&#160; &lt;Farm&gt;    <br />&#160;&#160;&#160; &lt;FullImport     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StopCleanUpTimerJob=&quot;true&quot;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; /&gt;    <br />&#160; &lt;/Farm&gt;    <br />&lt;/Configuration&gt;    </p>]]></content:encoded>
    </item>
    <item>
      <title>Kerberos Access Denied for Domain Local Groups</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/kerberos-access-denied-for-domain-local-groups</link>
      <pubDate>Sat, 04 Aug 2012 09:01:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/08/04/kerberos-access-denied-for-domain-local-groups/</guid>
      <description><![CDATA[We recently encountered a situation where users were denied access to site collections in SharePoint...]]></description>
      <content:encoded><![CDATA[<p>We recently encountered a situation where users were denied access to site collections in SharePoint 2010 web applications using Kerberos authentication. The users should have been granted access because they were members of domain local security groups, and those domain&nbsp; local groups were added to the visitors SharePoint group for the site collections. The same users were able to access site collections in a separate WSS farm using the same domain local group for granting access. The only difference between the SharePoint Server farm and the WSS farm was Kerberos verses NTLM authentication for the web applications.</p>
<p>OK, so start checking Kerberos configuration:</p>
<ol>
<li>SPNs created correctly for the service accounts and web applications? Check!</li>
<li>Users successfully authenticated by Kerberos when directly added to the SharePoint group? Check!</li>
<li>The domain local group is in the same domain as the SharePoint farm? Check!</li>
<li>Can the user access a new web application in the SharePoint farm using NTLM and the local domain group? Check!</li>
</ol>
<p>Everything checks out, so why is access denied when the domain local group is used for a web application configured with Kerberos authentication????</p>
<p>OK, let&rsquo;s take a step back and think about this. What is the definition of a domain local group? Looking at <a title="https://technet.microsoft.com/en-us/library/dd861330.aspx" href="https://technet.microsoft.com/en-us/library/dd861330.aspx">https://technet.microsoft.com/en-us/library/dd861330.aspx</a> we find:</p>
<blockquote>
<h5><span style="color: #a5a5a5;" color="#a5a5a5">Domain local groups</span></h5>
<p><span style="color: #a5a5a5;" color="#a5a5a5">Members of domain local groups can include other groups and accounts from Windows NT, Windows 2000, Windows Server 2003, Windows Server 2008, and Windows Server 2008 R2 domains. Members of these groups can be assigned permissions only within a domain.</span></p>
<p><span style="color: #a5a5a5;" color="#a5a5a5">Groups with domain local scope help you define and manage access to resources within a single domain. These groups can have the following as their members: </span></p>
<ul>
<li><span style="color: #a5a5a5;" color="#a5a5a5">Accounts from any domain</span></li>
<li><span style="color: #a5a5a5;" color="#a5a5a5">Global groups from any domain</span></li>
<li><span style="color: #a5a5a5;" color="#a5a5a5">Universal groups from any domain</span></li>
<li><span style="color: #a5a5a5;" color="#a5a5a5">Domain local groups, but only from the same domain as the parent domain local group</span></li>
<li><span style="color: #a5a5a5;" color="#a5a5a5">A mixture of any of the above</span></li>
</ul>
</blockquote>
<p>Our domain local group complies with this definition, the members are domain accounts, the SharePoint farm is in the same domain, etc.; so again, why is access denied using Kerberos but not NTLM? It&rsquo;s time for some deeper investigation.</p>
<p>SharePoint 2010 in Windows Classic mode keeps an internal token with the security identifiers (SIDs) of the user, and all the groups the user is a member of. This token is matched against the secured object&rsquo;s ACL to determine if the user has access either by the user SID directly, or by membership in a group. This seems to imply our user&rsquo;s token must be missing the domain local groups SID &ndash; but why?</p>
<p>How does SharePoint populate the list of SIDs in the token? SharePoint pulls the SID list from the Kerberos ticket. Looking at <a href="https://blogs.msdn.com/b/openspecification/archive/2009/04/24/understanding-microsoft-kerberos-pac-validation.aspx">https://blogs.msdn.com/b/openspecification/archive/2009/04/24/understanding-microsoft-kerberos-pac-validation.aspx</a> we find this high level description of the Kerberos ticket contents.</p>
<blockquote>
<p><span style="color: #a5a5a5;" color="#a5a5a5">The Privilege Account Certificate (<b>PAC</b>) is an extension element of the <b>authorization-data field</b> contained in the client's Kerberos ticket. The PAC structure is defined in [MS-PAC] and conveys authorization data provided by domain controllers (DCs) in an Active Directory-enabled domain. <b>It contains information such as </b><b>security identifiers</b><b>, group membership</b>, user profile information, and password credentials. The illustration below shows the relationship between a Kerberos ticket and PAC.</span></p>
</blockquote>
<blockquote>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/8508.KerberosTicket1_406DD181.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/8508.KerberosTicket1_5F00_406DD181.png"><img style="display: inline; background-image: none;" title="KerberosTicket1" border="0" alt="KerberosTicket1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/1346.KerberosTicket1_thumb_7FCB8511.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/1346.KerberosTicket1_5F00_thumb_5F00_7FCB8511.png" width="244" height="116" /></a></p>
</blockquote>
<p>Noting the phrase <em><span style="color: #a5a5a5;" color="#a5a5a5">conveys authorization data provided by domain controllers (DCs)</span></em> , what DC is being used to generate the Kerberos ticket? To answer that, think through the ticket granting steps:</p>
<ol>
<li>What identity is used to request a ticket from the DC (remember the DC is also the KDC)? The SPN account.</li>
<li>What is the SPN account for a web application? The web app&rsquo;s application pool identity.</li>
<li>What is the application pool identity? <strong>admin</strong>\AppPool1.</li>
<li>What DC is contacted? The first DC in the <strong>admin</strong>.contoso.com domain that responds to the request.</li>
</ol>
<p>And now one final question:</p>
<ol>
<li>Which domain contains the domain local group and SharePoint farm? <strong>prod</strong>.contoso.com.</li>
</ol>
<p>The light bulb comes on! The service account (<strong>admin</strong>\AppPool1) is in a different domain from the users and SharePoint farm. The DC in the <strong>admin</strong> domain that generates the Kerberos ticket has no knowledge of domain local groups in the <strong>prod</strong> domain, since by definition, domain local groups are scoped to the local domain. The Kerberos ticket presented to SharePoint lacks the SIDs of the <strong>prod</strong> domain local groups, hence access is denied.</p>
<p>How can this be resolved? That depends upon the existing investment in domain local groups and the organization&rsquo;s security policies. Some possibilities are:</p>
<ol>
<li>Promote the domain local groups to universal groups. This may be painful if there are hundreds or thousands of domain local groups. Besides the logistics of group promotion, you have to consider the additional DC replication traffic, and the possibility of breaking other legacy applications depending upon domain local groups. </li>
<li>Move the SPN service accounts to the same domain as the SharePoint farm. This allows continued use of domain local groups, but may violate the organization&rsquo;s security model;&nbsp; that is, the <strong>admin</strong> domain may be used for service accounts due to other security considerations. This approach has side effects, like the need to get exceptions for the SharePoint service accounts, the need to delete and recreate the SPNs, and the need to modify GPOs that control password changes.</li>
</ol>
<h3>PS:</h3>
<p>Another interesting factor to consider. Testing access to a site needs to be done using the user account itself. The Effective Permissions feature in Site Settings does not acurately reflect permissions granted by group membership unless the user has actually visited the site since the last group membership change.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Where to Start Office Web Apps Related Services?</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/where-to-start-office-web-apps-related-services</link>
      <pubDate>Sat, 04 Aug 2012 05:49:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/08/04/where-to-start-office-web-apps-related-services/</guid>
      <description><![CDATA[This question was recently asked: Where do I start the Office Web Applications in a farm with...]]></description>
      <content:encoded><![CDATA[<p>This question was recently asked: Where do I start the Office Web Applications in a farm with multiple web front ends (WFEs) and application servers (APPs)?</p>
<p>There is a TechNet article that talks about this, <a href="https://technet.microsoft.com/en-us/library/ff431687.aspx#bkmk_ins_exis_farm">https://technet.microsoft.com/en-us/library/ff431687.aspx#bkmk_ins_exis_farm</a>. This rather long article includes this sentence: <em>Start the services on the Web front-end servers on which you want users to view and edit documents in the browser</em>. This brief guidance is understandable, since it probably covers many simple deployments, and a more complete answer lengthen the article and make it harder to consume, but for larger farms, this simple guidance may not be optimal.</p>
<p>First, let&rsquo;s establish some background on service instances and service applications in general. Service instances can run on any, or all, servers in a farm; both WFE and APP servers in any combination. The magic that allows this is the application topology service. The topology services makes service consumers (the WFE service proxies in this case) aware of the servers where the service instances are running. The service instances then load balance themselves through their built-in load balancer and proxies to spread the load evenly. The service consumer and the service instances DO NOT have to be on the same server. A common example is the managed metadata service, which might only have instances running on 2 APP servers. Requests for term sets are relayed from the WFEs to the appropriate APP server via the service proxies and load balancers. The key point is the service instance does not have to run on the WFE.</p>
<p>In the case of Office Web Apps, it is not necessary for the OWA services to run on the WFEs, although that may make sense in simple scenarios. For example, there could be just 2 WFEs running only the web application service, while there are 8 APP servers running the OWA service instances with the built-in load balancing spreading the load from the 2 WFEs across the 8 APP servers. (You will see this taken even further in SharePoint 2013 where OWA services run in an entirely separate farm from SharePoint)</p>
<p>Taking one example, what if Excel Services is rarely used? It does not make sense to run instances of Excel Services on all the WFEs? This just takes up WFE memory and CPU that might better be used to respond to normal page requests.</p>
<p>Taking another example, the other extreme is all users heavily hit Excel Services. In this case the WFEs may not be able to handle the Excel Service load, so it would be better to stand up APP servers dedicated to Excel Services, and scale out by adding additional APP servers so the WFEs are not bogged down doing Excel calculations.</p>
<p>So the long answer of where to put the OWA service instances is &ldquo;it all depends&rdquo;. Analyze the expected usage of each service (Word Viewer, PowerPoint Viewer, and Excel Services), and then start the necessary number of instances on the most appropriate servers.</p>]]></content:encoded>
    </item>
    <item>
      <title>My Site Default Quota Template</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/my-site-default-quota-template</link>
      <pubDate>Sun, 22 Jul 2012 13:21:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/07/22/my-site-default-quota-template/</guid>
      <description><![CDATA[We recently encountered a subtle issue setting the quota used when creating My Sites; that is, My...]]></description>
      <content:encoded><![CDATA[<p>We recently encountered a subtle issue setting the quota used when creating My Sites; that is, My Content personal sites. The default quota template MUST be named &ldquo;personal site&rdquo; or sites are created without a quota. Here is the whole story.</p>
<p>When you first open General Settings dialog for a new web application, it shows the selected quota template as &ldquo;No Quota&rdquo;. As we will see below, this is misleading.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/2185.image_63077D47.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/2185.image_5F00_63077D47.png"><img style="margin: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4670.image_thumb_266F7EAA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4670.image_5F00_thumb_5F00_266F7EAA.png" width="372" height="173" /></a></p>
<p>We created the My Site hosting web application using a PowerShell script. That script also created a default quota template per the customer maximum and warning size requirements, and then updated the web application&rsquo;s default template to that value. We named this quota template &ldquo;MySite Quota&rdquo;.</p>
<p>The problem is SharePoint doesn&rsquo;t use the web application default template when creating personal sites. A little digging shows that SharePoint creates its own default personal site quota template using the hard coded name &ldquo;personal site&rdquo; (or the equivalent installed language translation). When creating a personal site, this template is applied, not the web application default template.</p>
<p>I suspect SharePoint creates the default template for these reasons:</p>
<ol>
<li>To make sure the template is available; that is, to avoid configuration errors if the customer forgets to create a quota template.</li>
<li>To specify resource usage limits for Sandbox solutions. (I bet many customers don&rsquo;t realize Sandbox solutions can be deployed to personal sites.)</li>
</ol>
<p>If you later need to override the default quota for certain users, you can go to Central Administration &gt; Site Collection Quotas and Locks (or use PowerShell). You can change the template to another template you have created (like &ldquo;gold personal site&rdquo; in the following picture), or change the template to &ldquo;individual quota&rdquo; and manually enter values in the following fields.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4744.image_739F7835.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4744.image_5F00_739F7835.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4251.image_thumb_24BEB2D6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4251.image_5F00_thumb_5F00_24BEB2D6.png" width="503" height="378" /></a></p>
<p>More information regarding the personal site quote template can be found at <a href="https://technet.microsoft.com/en-us/library/cc262500.aspx#storage" target="_blank">Plan for My Sites</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Service Application Load Balancing Discoveries</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/service-application-load-balancing-discoveries</link>
      <pubDate>Sun, 15 Jul 2012 05:22:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/07/15/service-application-load-balancing-discoveries/</guid>
      <description><![CDATA[Most SharePoint administrators know that Service Applications; for example Managed Metadata Service...]]></description>
      <content:encoded><![CDATA[<p>Most SharePoint administrators know that Service Applications; for example Managed Metadata Service and Business Connectivity Services, have built-in load balancing. There are numerous blogs that explain how service application load balancing works. An excellent, in-depth blog is <a href="https://blogs.msdn.com/b/besidethepoint/archive/2011/02/19/how-i-learned-to-stop-worrying-and-love-the-sharepoint-topology-service.aspx" target="_blank">How I Learned to Stop Worrying and Love the SharePoint Topology Service</a>, followed by <a href="https://blogs.msdn.com/b/dtaylor/archive/2011/02/23/sharepoint-2010-service-application-load-balancer.aspx" target="_blank">What is the Service Application Load Balancer</a>?</p>
<p>Built-in load balancing simplifies deployment and administration, but has user impacts that might not be obvious. We discovered some of these impacts recently. A customer asked us to test Service Application load balancing in their environment. We had to test both shared services (services published from a publishing farm to a trusted consuming farm); as well as, local services.</p>
<h4>Discovery 1&mdash;Service Application Status Doesn&rsquo;t Change</h4>
<p>The Status column in <strong>Central Administration</strong> &gt; <strong>Manage Service Applications</strong> doesn&rsquo;t change when all instances of a service application are stopped. We tested stopping all instances of Managed Metadata, Business Connectivity, and PowerPoint. In each case, Central Administration continued to show the status as <em>Started</em> even though no service instances were running.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/8078.clip_image001_142BD59B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/8078.clip_5F00_image001_5F00_142BD59B.jpg"><img style="display: inline; background-image: none;" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/6013.clip_image001_thumb_39492007.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/6013.clip_5F00_image001_5F00_thumb_5F00_39492007.jpg" width="532" height="440" /></a></p>
<h4>Discovery 2&mdash;Consuming Farm May Not Know of Failures for Up to 15 Minutes</h4>
<p>The blog referenced above, <a href="https://blogs.msdn.com/b/dtaylor/archive/2011/02/23/sharepoint-2010-service-application-load-balancer.aspx" target="_blank">What is the Service Application Load Balancer</a>, explains that a publishing farm checks availability of a published service once every 15 minutes by running the <b>Application Addresses Refresh</b> job. This allows a 15 minute window during which the users in the consuming farm might see errors; for example, with the Managed Metadata Service management page. This might be confusing to the farm administrator, because Discovery 1 shows that Central Administration reports the status is <em>Started</em>.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/6825.image_231304B5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/6825.image_5F00_231304B5.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/2112.image_thumb_0FF1D809.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/2112.image_5F00_thumb_5F00_0FF1D809.png" width="511" height="150" /></a></p>
<p>What is more insidious is that other user facing pages depend upon the availability of the Managed Metadata Service to render correctly. An example is the User Profile update page. In this screen capture we can see the user is unable to update <strong>Ask Me About</strong>, with no direct mention of a Managed Metadata Service problem in the error text; when in fact, unavailability of the Managed Metadata Service was the root cause of this error in our testing.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/1205.image_67DF28E9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/1205.image_5F00_67DF28E9.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/6087.image_thumb_0DD4D940.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/6087.image_5F00_thumb_5F00_0DD4D940.png" width="382" height="270" /></a></p>
<p>A point to take away from this is if a service in a publishing farm fails; that is, all service instances have stopped, after starting one or more instances immediately, in the publishing farm go to <strong>Central Administration</strong> &gt; <strong>Monitoring</strong> &gt; <strong>Review Timer Job</strong> <b>Definitions</b>, click on <b>Application Addresses Refresh</b> job, and click the <b>Run Now</b> button to make consuming farms aware of the newly available service end points.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/1602.image_37D4D768.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/1602.image_5F00_37D4D768.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/2766.image_thumb_167531CC.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/2766.image_5F00_thumb_5F00_167531CC.png" width="464" height="280" /></a></p>
<h4>Discovery 3&mdash;Excel Calculation Service May Not Use Available Service Instances</h4>
<p>So far as I know, Excel Calculation Service is the only service application with multiple load balancing algorithms. The load balancing choices are:</p>
<ul>
<li>Workbook URL</li>
<li>Round Robin with Health Check</li>
<li>Local (only is the service is running on the WFE)</li>
</ul>
<blockquote>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/4722.image_5566B267.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/4722.image_5F00_5566B267.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/3821.image_thumb_3068F1EE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/3821.image_5F00_thumb_5F00_3068F1EE.png" width="318" height="109" /></a></p>
</blockquote>
<p>The default is <strong>Workbook URL</strong>. This default has an interesting implication. Our testing showed a browser with a spreadsheet open <span style="text-decoration: underline;">prior</span> to the service instance failure, continues to try to use the failed instance even though functioning service instances are available on other application servers. Apparently the <strong>Workbook URL</strong> creates a &ldquo;sticky session&rdquo; with the non-functioning application server. Users with the workbook already open get errors, but subsequent users of the same workbook are connected to a functioning service instance.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/2744.image_1A9F0991.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/2744.image_5F00_1A9F0991.png"><img style="margin: 0px; display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/7853.image_thumb_00CAD362.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/7853.image_5F00_thumb_5F00_00CAD362.png" width="244" height="124" /></a></p>
<p>This raises one of those consulting questions of what is the best load balancing algorithm. It all depends. Workbook URL load balancing improves caching, responsiveness, and resource usage; while at the same time, for this admittedly rare use case, causing an unintentional single point of failure.</p>
<h4>Discover 4&mdash;Cached Word and PowerPoint Documents Can Mask Service Failure</h4>
<p>While this discovery is not a problem itself, it can mask a service application failure.</p>
<p>In our testing, we &ldquo;viewed in browser&rdquo; several PowerPoint files. As you may know, Office Web Application caches rendered documents to improve performance on subsequent requests. These documents continued to rendered in the browser even after all service instances were stopped; however, uncached documents returned an error.</p>
<p>This inconsistent behavior of some documents rendering and some not could lead to end user confusion, and even farm administrator confusion, until the root cause (all service instances stopped) is identified.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/0268.image_39094A7A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/0268.image_5F00_39094A7A.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/metablogapi/3324.image_thumb_05CD1111.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43-metablogapi/3324.image_5F00_thumb_5F00_05CD1111.png" width="509" height="292" /></a></p>
<h4>Discover 5&mdash;User Profile Service Has Various Impacts</h4>
<p>As most administrators know, the user profile service application allows subscribing farms to make direct SQL calls to the user profile database in the publishing farm. As a consequence, only parts of the profile service application are dependent upon the functioning of service instances in the publishing farm. The user experience is therefore inconsistent in that some features continue to work, some features fail silently, and some features displays errors. Here is a quick list of what we saw when going to a My Site of a user who had previously created their My Site, added colleagues, and had site memberships.</p>
<ol>
<li><strong>My Site</strong> home page renders (<a href="https://my.contoso.com/default.aspx">https://my.contoso.com/default.aspx</a>), with these consequences:</li>
<ul>
<li><strong>My Colleagues</strong> list appears, but clicking a colleague name results in an error</li>
<li><strong>My Interests</strong> and <strong>Newsfeed Settings</strong> also result in errors</li>
<li><strong>Organization Browser</strong> fails to render, but doesn&rsquo;t display an error either; that is, silently fails</li>
</ul>
<li><strong>My Content</strong> displays the personal site home page (<a href="https://my.contoso.com/personal/user-name/default.aspx">https://my.contoso.com/personal/user-name/default.aspx</a>)</li>
<li><strong>My Profile</strong> (<a href="https://my.contoso.com/person.aspx">https://my.contoso.com/person.aspx</a>) results in an error</li>
<li>The enterprise search center page (<a href="https://search.contoso.com/pages/default.asp">https://search.contoso.com/pages/default.asp</a>) results in an error</li>
<li>A team site page (<a href="https://teams.contoso.com/default.aspx">https://teams.contoso.com/default.aspx</a>) renders, but any attempt to click on a user name results in an error</li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Publishing Service Applications with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/publishing-service-applications-with-powershell</link>
      <pubDate>Wed, 04 Jul 2012 08:12:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/07/04/publishing-service-applications-with-powershell/</guid>
      <description><![CDATA[Publishing Service Applications with PowerShell
While scripting the deployment of a multiple farm...]]></description>
      <content:encoded><![CDATA[<h1><span style="color: #365f91;" color="#365f91"><span style="font-family: Cambria;" face="Cambria">Publishing Service Applications with PowerShell</span></span></h1>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">While scripting the deployment of a multiple farm SharePoint 2010 environment with a Shared Services farm providing services to consuming farms, the question arose, is it possible to publish a service application with PowerShell? Without this scripted capability, many manual steps would be necessary to build the farm. There are no published PowerShell cmdlets to publish service applications, so investigation was needed. </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Using the <b>Get-Member</b> cmdlet to display all the properties of a service application object led to the discovery of these public properties and methods:</span></span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="187">
<p><b><span style="font-family: Calibri;" face="Calibri">Property/Method</span></b></p>
</td>
<td valign="top" width="360">
<p><b><span style="font-family: Calibri;" face="Calibri">Description</span></b></p>
</td>
</tr>
<tr>
<td valign="top" width="187">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Shared</span></span></p>
</td>
<td valign="top" width="360">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Set to $true to publish the service application</span></span></p>
</td>
</tr>
<tr>
<td valign="top" width="187">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Comments</span></span></p>
</td>
<td valign="top" width="360">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The comment, or description, the consuming farm will see when connecting to the service application</span></span></p>
</td>
</tr>
<tr>
<td valign="top" width="187">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">TermsOfServiceUri</span></span></p>
</td>
<td valign="top" width="360">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The URI of a custom page that displays the terms of service. Not used in our project, but might be useful if sharing a service to tenants</span></span></p>
</td>
</tr>
<tr>
<td valign="top" width="187">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Update()</span></span></p>
</td>
<td valign="top" width="360">
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Persist object changes to the configuration database</span></span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">&nbsp;</span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Armed with this knowledge, a service application can be published with the following PowerShell snippet:</span></span></p>
<p style="padding-left: 30px;"><span style="color: #993366; font-family: courier new,courier;">$serviceApp </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">Get-SPServiceApplication</span></span></b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> | ? {</span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$_</span></span><span style="font-family: Courier New;" face="Courier New">.GetType().ToString() </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">-eq</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">"Microsoft.Office.Server.Administration.UserProfileApplication"</span></span><span style="font-family: Courier New;" face="Courier New">}<br /></span><span style="color: #993366; font-family: courier new,courier;">$termsOfServiceUri </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$null<br /></span></span><span style="color: #993366; font-family: courier new,courier;">$name </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$serviceApp</span></span><span style="font-family: Courier New;" face="Courier New">.name</span></p>
<p style="padding-left: 30px;"><span style="color: #008080; font-family: courier new,courier;">Write-Host </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-ForegroundColor</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">White</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">" - Publishing Service Application $name ..."</span></span></p>
<p style="padding-left: 30px;"><span style="color: #800080; font-family: courier new,courier;">$serviceApp</span><span style="font-family: Courier New;" face="Courier New">.Shared&nbsp;&nbsp; </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$true<br /></span></span><span style="color: #993366; font-family: courier new,courier;">$serviceApp</span><span style="font-family: Courier New;" face="Courier New">.Comments </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">"Shared Services Farm User Profile Application"</span></span></p>
<p style="padding-left: 30px;"><span style="color: #0000ff;">if </span><span style="font-family: Courier New;" face="Courier New">((</span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$termsOfServiceUri</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">-ne</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$null</span></span><span style="font-family: Courier New;" face="Courier New">) </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">-and</span></span><span style="font-family: Courier New;" face="Courier New"> (</span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$termsOfServiceUri</span></span><span style="font-family: Courier New;" face="Courier New">.length </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">-gt</span></span><span style="font-family: Courier New;" face="Courier New"> 0))<br /></span>{ <br />&nbsp;&nbsp;&nbsp; <span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$serviceApp</span></span><span style="font-family: Courier New;" face="Courier New">.TermsOfServiceUri </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$termsOfServiceUri<br /></span></span>}</p>
<p style="padding-left: 30px;"><span style="color: #993366; font-family: courier new,courier;">$serviceApp</span><span style="font-family: Courier New;" face="Courier New">.Update()</span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The stretch goal then becomes, is it possible to grant a consuming farm permissions to the a published service application with PowerShell? </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Again, with some research, the answer is yes &ndash; assuming you know the consuming farm ID. This PowerShell snippet grants the consuming farm access.</span></span></p>
<p style="padding-left: 30px;"><span style="color: #993366; font-family: courier new,courier;">$ServiceAppSecurity </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">Get-SPServiceApplicationSecurity</span></span></b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$serviceApp</span></span><span style="font-family: Courier New;" face="Courier New">.Id</span><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"><span style="font-family: Courier New;" face="Courier New"><br /></span></span><span style="color: #993366; font-family: courier new,courier;">$claimProvider </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> (</span><b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">Get-SPClaimProvider</span></span></b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> | ?{</span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$_</span></span><span style="font-family: Courier New;" face="Courier New">.DisplayName </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">-eq</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">"System"</span></span><span style="font-family: Courier New;" face="Courier New">})<br /></span><span style="color: #993366; font-family: courier new,courier;">$principal </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New">&nbsp; </span><b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">New-SPClaimsPrincipal</span></span></b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">"&lt;CONSUMING-FARM-GUID&gt;"</span></span><span style="font-family: Courier New;" face="Courier New"> </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-ClaimType</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">"https://schemas.microsoft.com/sharepoint/2009/08/claims/farmid"</span></span><span style="font-family: Courier New;" face="Courier New"> </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-ClaimProvider</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$claimProvider</span></span><span style="font-family: Courier New;" face="Courier New">.ClaimProvider</span></p>
<p style="padding-left: 30px;"><span style="color: #0000ff;">if </span><span style="font-family: Courier New;" face="Courier New">(</span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$principal</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">-ne</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$null</span></span><span style="font-family: Courier New;" face="Courier New">)<br /></span>{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">Grant-SPObjectSecurity</span></span></b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$ServiceAppSecurity</span></span><span style="font-family: Courier New;" face="Courier New"> </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-Principal</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$principal</span></span><span style="font-family: Courier New;" face="Courier New"> </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-Rights</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">"Full Control"<br />&nbsp;&nbsp; </span></span><b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">Set-SPServiceApplicationSecurity</span></span></b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$serviceApp</span></span><span style="font-family: Courier New;" face="Courier New">.Id </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-objectSecurity</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$ServiceAppSecurity</span></span><span style="font-family: Courier New;" face="Courier New"> </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-ErrorAction</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">SilentlyContinue</span></span></p>
<p style="padding-left: 30px;"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">&nbsp;&nbsp; $value</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New"><span style="color: #ff0000; font-family: Courier New;" color="#ff0000" face="Courier New">=</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New"><span style="color: #800080; font-family: Courier New;" color="#800080" face="Courier New">$principal</span></span><span style="font-family: Courier New;" face="Courier New">.Value<br />&nbsp;&nbsp; </span><b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">Write-Host</span></span></b><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New">-ForegroundColor</span></span></i><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"><span style="color: #5f9ea0; font-family: Courier New;" color="#5f9ea0" face="Courier New"></span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">White</span></span><span style="font-family: Courier New;" face="Courier New"> </span><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New"><span style="color: #800000; font-family: Courier New;" color="#800000" face="Courier New">" - $value granted Full Control Permission to Service Application $name."<br /></span></span>}</p>]]></content:encoded>
    </item>
    <item>
      <title>Secure Store Service Access Denied</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/secure-store-service-access-denied</link>
      <pubDate>Wed, 04 Jul 2012 06:20:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/07/04/secure-store-service-access-denied/</guid>
      <description><![CDATA[Secure Store Service Access Denied
We recently ran into an Access Denied problem using the Secure...]]></description>
      <content:encoded><![CDATA[<h1><span style="color: #365f91;" color="#365f91"><span style="font-family: Cambria;" face="Cambria">Secure Store Service Access Denied</span></span></h1>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">We recently ran into an Access Denied problem using the Secure Store Service. The environment has a Shared Services Farm which publishes the Secure Store Service (along with BCS, Managed Metadata, User Profile, FAST Query SSA, and Web Analytics) to consuming farms (</span><a href="https://technet.microsoft.com/en-us/library/ff621100.aspx"><span style="color: #0000ff; font-family: Calibri; font-size: small;" color="#0000ff" face="Calibri" size="3">https://technet.microsoft.com/en-us/library/ff621100.aspx</span></a><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">). Each farm has unique Farm Administrator accounts; as well as, unique service accounts for application pools and service applications.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">After publishing the services, we set up a trust relationship between farms by exchanging certificates; and then in the consuming farm, we connected to the published shared services (</span><a href="https://technet.microsoft.com/en-us/library/ee704552.aspx"><span style="color: #0000ff; font-family: Calibri; font-size: small;" color="#0000ff" face="Calibri" size="3">https://technet.microsoft.com/en-us/library/ee704552.aspx</span></a><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">). The consuming Farm Administrator account was given <b>Full Control</b> permission to all shared services, including the <b>Secure Store Service</b>. So far everything was working as planned. Search worked, user profiles and My Sites worked, we were feeling good.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Trouble occurred when the consuming farm administrator tried to create the unattended accounts for the local Excel and Visio service applications. As you know, unattended accounts required you to create <strong>Target Applications</strong> in the <strong>Secure Store Service</strong>. Creating a Target Application ID walks you through a wizard of 3 pages. In one case, every other page submission resulted in an Access Denied error. In the other case, we couldn&rsquo;t get past the first page due to access denied. A look at the ULS logs of both the consuming and publishing farms didn&rsquo;t reveal any clues, other than an access denied exception was being thrown in the web service call from the consuming farm to the topology service of the publishing farm. We kept asking ourselves, why would an account with Full Control permission to the service application get access denied? We even tried to create the Target Applications directly in the publishing farm logged in as the consuming farm account, thereby eliminating inter-farm trust as a factor. Still got access denied. </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Searches of TechNet, the web, and Microsoft&rsquo;s KBs didn&rsquo;t provide any solution. We tried recreating the service application, recycling application pools, resetting IIS, even rebooting servers. The access denied error persisted. We must be missing something, but what?</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">We started looking at every aspect of the Secure Store Service configuration on the publishing farm, and then we found it! Even though there is a <b>Full Control</b> permissions displayed when you click the <b>Permissions</b> tool bar button, this permission apparently doesn&rsquo;t really give full control. We discovered by clicking the <b>Administrators</b> tool bar button there are granular administrator rights for <b>Create</b>, <b>Delete</b>, and <b>Manage</b> <b>Target Application</b>. I can&rsquo;t explain why these rights are administrative rights not covered by the Full Control permission; however, granting the consuming farm account these administrator rights solved the problem! Any other accounts needing these rights will also have to be added.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The step-by-step solution follows.</span></span></p>
<ol>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Open a browser and navigate to the <span style="text-decoration: underline;">Publishing</span> Farm Central Administration web site using the publishing <b>Farm Administrator</b> account. </span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Navigate to <b>Manage Service Applications</b>. </span></span></li>
<li><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Select the line containing Secure Store Service by clicking in a blank area. DO NOT click on the name itself.</span><br /><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/7380.SSS1.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/7380.SSS1.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/7380.SSS1.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/7380.SSS1.jpg" /></a></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Click the <b>Administrators</b> button in the task bar.</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Enter the&nbsp;<span style="text-decoration: underline;">consuming</span> Farm Administrator account (<b>SPFarm_Q</b> in this example) in the top text box, and then click the <b>Add</b> button.</span></span></li>
<li><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Check the <b>Create</b>, <b>Delete</b>, and <b>Maintain</b> <b>Target Application</b> check boxes as shown in the screen shot.</span><br /><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"></span><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/6708.SSS2.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/6708.SSS2.jpg"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/6708.SSS2.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/6708.SSS2.jpg" /></a><br /><br /></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Click the <b>OK</b> button.</span></span></li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint Developer Environment Security Primer</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/sharepoint-developer-environment-security-primer</link>
      <pubDate>Sun, 10 Jun 2012 14:15:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/06/10/sharepoint-developer-environment-security-primer/</guid>
      <description><![CDATA[SharePoint Developer Environment Security Primer
Confusion often surrounds what privileges must be...]]></description>
      <content:encoded><![CDATA[<h1><span style="color: #365f91;" color="#365f91"><span style="font-family: Cambria;" face="Cambria">SharePoint Developer Environment Security Primer</span></span></h1>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Confusion often surrounds what privileges must be granted to developers to build and deploy solutions on a development server. It would seem the developer can be added to both the local machine administrator and farm administrator groups; and then be able to do anything. Unfortunately, the first time the developer tries to deploy a solution to a web application there are access denied errors. What&rsquo;s going on here? Shouldn&rsquo;t local administrator group and farm administrator group membership allow the developer unlimited access? To answer this question we need to have a high level picture of the security model.</span></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria">Homework Assignment</span></span></span></h2>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">First, I strongly encourage reading the TechNet Article, </span><a href="https://technet.microsoft.com/en-us/library/gg552610.aspx"><span style="color: #0000ff; font-family: Calibri; font-size: small;" color="#0000ff" face="Calibri" size="3">SharePoint 2010 Architectures Overview</span></a>&nbsp;(<a href="https://technet.microsoft.com/en-us/library/gg552610.aspx">https://technet.microsoft.com/en-us/library/gg552610.aspx)</a><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">. If you don&rsquo;t have time to read the entire article, at least read the first 3 paragraphs of the section entitled <b>Worker Processes, Farm Solutions, and Sandboxed Solutions</b>; in fact, read it over-and-over until you have it memorized. This is time well spent. </span></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria">Parallel Universes (The Twilight Zone)</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Have you finished this homework assignment? OK, let&rsquo;s jump into some of the security complexities.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Think of security as <b>3 parallel universes</b> (remember the old Twilight Zone TV show?). A user in one universe may be blissfully unaware of the other universes; for example, a machine administrator can be denied access to the SharePoint universe and/or SQL universe, and vice versa. </span></span></p>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"><b>Universe One</b> is the local server itself.</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3"><b>Universe Two</b> is SharePoint farm, logically hosted on the local server. </span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><b>Universe Three</b> is the SQL Server, either a local or remote SQL instance.&nbsp; </span></span></li>
</ul>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">For a <b>Universe One</b> (local server) or <b>Universe Three</b> (SQL Server user) to cross into <b>Universe Two </b>(SharePoint farm), that user must be granted privileges within SharePoint; for example:</span></span></p>
<ul>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Added to the farm administrators group through Central Administration</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Added to a web application user policy through Central Administration</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Added to as a service application administrator through Central Administration</span></span></li>
<li><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Added to a Site Collection group by a Site Collection administrator</span></span></li>
<li><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Granted database access with the <b>Add-SPShellAdmin</b> cmdlet. </span></span></li>
</ul>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">For a <b>Universe One</b> (local server) or <b>Universe Two </b>(SharePoint farm) user to cross into <b>Universe Three </b>(SQL Server), that user must be granted a SQL Server login and made a database user for one or more databases. SQL access is normally granted as a side effect of granting a user access to the SharePoint farm. See the prior bullets for ways this can happen. If you feel you have to directly grant database access, then you probably have something else wrong in your security design.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">For a<b> Universe Two </b>(SharePoint farm) user to cross into <b>Universe One </b>(local server), the user must be added to local machine groups. This normally occurs automatically as part of SharePoint installation, or as a side effect of other actions such as executing the <b>Add-SPShellAdmin</b> cmdlet which implicitly makes the named user a local administrator (be sure this is what you intended). If you feel you have to directly add SharePoint users to local machine groups, with few exceptions you probably have something else wrong in your security design. An example of an exception where manual group addition is required is to add developers to the <b>Remote Desktop Users</b> group so the developers can RDP onto the server without having to be local administrators.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">These disjoint, parallel universes is why a local administrator who is added to the SharePoint farm administrators group after the original installation cannot deploy solutions -- the user account cannot get from the SharePoint universe to the SQL Server universe.</span></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria">Visual Studio 2010 Deployment</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Visual Studio 2010 has a great automatic deployment feature. The developer can right click a project to deploy to a designated web application and Site Collection. Unfortunately, in situations where the developer is not a local administrator, this fails. Why? </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">To answer that question, we need to understand what Visual Studio 2010 is doing during the deployment. With the Visual Studio 2010 solution open, display the project properties, select the SharePoint tab, and then click the <b>View</b> button in the <b>Edit Configurations</b> section. This lists the steps being executed on the right side under <b>Selected Deployment Steps</b>.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/3443.DevSecurity1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/3443.DevSecurity1.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/3443.DevSecurity1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/3443.DevSecurity1.png" /></a></span></span></p>
<p><span style="font-family: Calibri;" face="Calibri"><span style="font-size: small;" size="3">Let&rsquo;s take the default steps one-by-one.</span></span></p>
<ul>
<li><b><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Run Pre-Deployment Command</span></b><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">:<br />This is a non-issue. It will always work (barring pathological problems like running out of disk space or memory).<br /></span></span></li>
<li><b><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Recycle IIS Application Pool</span></b><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">:<br />Must be a machine administrator. This is why you need to start Visual Studio 2010 as an administrator. This also prevents Visual Studio 2010 deployment if you don&rsquo;t want the developer to be an administrator &ndash; unless you remove this step.<br />You must also be a member of the dbowner role for the content database(s) associated with the application pool which hosts the target web application; that is, the site you specified when setting up the project. A simple way to do this is to run the cmdlet:<br />&nbsp;&nbsp;&nbsp; <span style="font-family: courier new,courier;">Add-SPShellAdmin -user &lt;domain\account&gt; -database &lt;content-database-guid&gt;</span><br />See the following PowerShell topic for details.<br /></span></span></li>
<li><b><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Retract Solution</span></b><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">:<br />Member of the farm administrators group for farm solutions.<br />Site Collection administrator for Sandbox solutions.<br /></span></span></li>
<li><b><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Add Solution</span></b><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">:<br />Member of the farm administrators group for farm solutions.<br />Site Collection administrator for Sandbox solutions.<br /></span></span></li>
<li><b><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Activate Features</span></b><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">:<br />Depends upon the feature scope. <br />Global (farm): farm administrator group member<br />Web Application: farm administrator or member of Web Application full control user policy<br />Site Collection: Site Collection administrator or owner<br />Site: Site administrator or owner <br /></span></span></li>
<li><b><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">Run Post-Deployment Command</span></b><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">:<br />Again this is a non-issue. It will always work (barring pathological problems like running out of disk space or memory).<br /></span></span></li>
</ul>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">So we see Visual Studio 2010 deployment has stringent permission requirements. It is possible to work around some of these requirements by creating your own deployment steps, an exercise left for the reader.</span></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria">PowerShell</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Now we come to the often misunderstood cmdlet, <b>Add-SPShellAdmin</b>. Unfortunately, the Get-Help text does not clearly explain what this cmdlet does. It is not a general solution for SharePoint security permission issues. This cmdlet has a focused purpose; which is, to allow the designated user to run PowerShell commands that impact a particular database. Side effects are the user is also added to the database <b>db_owner</b> role and to the local machine WSS_ADMIN_WPG group, so again, be sure this is what you intend. This command does NOT add the user to either the local administrators groups or the Farm Administrators group; in other words, it grants least privileges.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">If you execute the command WITHOUT a database parameter, the user will be able execute PowerShell commands that affect the Config database, but NOT content databases.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">If you execute the command with a database parameter for a content database, the user will be able to execute PowerShell commands affecting that content database (and the config database).</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">To get the content database GUID to pass to the cmdlet, execute the <b>Get-SPDatabase</b> cmdlet. The following example shows UserNo115 granted permission to run PowerShell commands against the configuration database, and UserNo116 granted permission to run PowerShell commands against the WSS_Content_My content database.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/0726.DevSecurity2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/0726.DevSecurity2.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/0726.DevSecurity2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/0726.DevSecurity2.png" /></a></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">The following 2 screen shots show the result of these commands as view through the SQL Management Studio. Note both users are now members of the Config database db_owners role; but only UserNo116 has access to the My Site content database.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/5047.DevSecurity3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/5047.DevSecurity3.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/5047.DevSecurity3.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/5047.DevSecurity3.png" /></a></span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/0118.DevSecurity4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/0118.DevSecurity4.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/0118.DevSecurity4.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/0118.DevSecurity4.png" /></a></span></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria">What Can the User Do?</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">A useful troubleshooting tool is the command <b>whoami</b>. Logon to the server with the user&rsquo;s credentials (or start a command prompt as the user), then open a command prompt and enter <b>whoami /all</b>. This will show the user&rsquo;s group memberships and explicit privileges on the server. If the user is not in the expected groups, review the prior information to determine what went wrong. You should very rarely have to manually add users to groups except for Remote Desktop Users group.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3">The following output is for an administrative user, as seen by membership in the BUILTIN\Administrators group.</span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/2046.DevSecurity5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/2046.DevSecurity5.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/2046.DevSecurity5.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/2046.DevSecurity5.png" /></a></span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">This example is for a user added to the farm administrator group through Central Administration. Note the absence of membership in the local administrators group, which is by design.</span></span></p>
<p><span style="font-family: Calibri; font-size: small;" face="Calibri" size="3"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/4452.DevSecurity6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/4452.DevSecurity6.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/4452.DevSecurity6.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/4452.DevSecurity6.png" /></a></span></p>
<h2><span style="font-size: medium;" size="4"><span style="color: #4f81bd;" color="#4f81bd"><span style="font-family: Cambria;" face="Cambria">What about WSS Local Groups?</span></span></span></h2>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">You may have noticed this discussion has not mentioned local groups like <b>WSS_ADMIN_WPG</b>, <b>WSS_RESTRICTED_WPG_V4</b>, and <b>WSS-WPG</b>. This was intentional. Membership in these groups is maintained automatically by Central Administration pages and PowerShell commands. </span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">If you feel it necessary to modify these group memberships, my advice is STOP, take a deep breath, and review your overall approach to see what&rsquo;s wrong with your security design. Modifying these groups&rsquo; membership is like putting a Band-Aid on a gushing wound. You have bigger problems.</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>SPDiag Error Creating a Snapshot</title>
      <link>https://docs.microsoft.com/archive/blogs/jimmiet/spdiag-error-creating-a-snapshot</link>
      <pubDate>Sat, 19 May 2012 13:45:00 GMT</pubDate>
      <dc:creator><![CDATA[JIMMIE THOMPSON]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jimmiet/2012/05/19/spdiag-error-creating-a-snapshot/</guid>
      <description><![CDATA[SPDiag Error Creating a Snapshot
Many people see error messages when attempting to create an SPDiag...]]></description>
      <content:encoded><![CDATA[<p class="Heading2Numbered"><strong><span style="color: #4f81bd; font-size: large;" color="#4f81bd">SPDiag Error Creating a Snapshot</span></strong></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Many people see error messages when attempting to create an SPDiag snapshot. In my experience the root cause is either the PowerShell remoting configuration or the credential delegating group policy. Sometimes this is not obvious if you only see a vague, generic error.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">First, consider what happens during a snapshot. There are several steps, as implied by the TechNet description (h</span></span><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><a href="https://technet.microsoft.com/en-us/library/hh144782.aspx">ttp://technet.microsoft.com/en-us/library/hh144782.aspx</a>)</span></span></p>
<p style="padding-left: 30px;"><span style="font-size: small; background-color: #f5f5f5;" size="3"><span style="font-family: Calibri;" face="Calibri">You can take snapshots of your farm that aggregate </span></span></p>
<ul style="padding-left: 30px;">
<li><span style="font-size: small; background-color: #f5f5f5;" size="3"><span style="font-family: Calibri;" face="Calibri">report images</span></span></li>
<li><span style="font-size: small; background-color: #f5f5f5;" size="3"><span style="font-family: Calibri;" face="Calibri">farm topology information</span></span></li>
<li><span style="font-size: small; background-color: #f5f5f5;" size="3"><span style="font-family: Calibri;" face="Calibri">Unified Logging Service (ULS) logs</span></span></li>
<li><span style="font-size: small; background-color: #f5f5f5;" size="3"><span style="font-family: Calibri;" face="Calibri">usage database data. </span></span></li>
</ul>
<p style="padding-left: 30px;"><span style="font-size: small; background-color: #f5f5f5;" size="3"><span style="font-family: Calibri;" face="Calibri">This makes it easy to consolidate key troubleshooting information about a SharePoint farm and share it with other users or preserve it for comparison and trend analysis.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri">Errors can arise at any of these steps. As far as I know, you cannot select which steps you want executed other than selecting <strong>Light</strong> or <strong>Full</strong> in the Snapshot diaglog.</span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/3007.snapshot1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/3007.snapshot1.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/3007.snapshot1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/3007.snapshot1.png" width="302" height="302" /></a></span></span></p>
<p><span style="font-size: small;" size="3"><span style="font-family: Calibri;" face="Calibri"><strong>Report images</strong> seem a safe operation. SPDiag is merely turning the report into a picture and storing it in the Export Directory.</span></span></p>
<p>The <strong>farm topology</strong> step is where I see the most errors. To gather the farm topology, SPDiag establishes a remote PowerShell session to each server in the farm, including the database server. If either the PowerShell remoting configuration or the credential delegating group policy is not configured correctly, the snapshot will abort at the first error. You can still find what was collected up to that point in time in the export directory, but no further information is collected. In this scenario you will see the following dialog.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/8400.snapshot2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/8400.snapshot2.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/8400.snapshot2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/8400.snapshot2.png" width="432" height="123" /></a></p>
<p>The first question is, where is the error.log file? It is in the export directory. Sometimes you will find a very explicit error description like the following:</p>
<p style="padding-left: 30px;"><span style="color: #808080; background-color: #ffffff;">05/19/2012 10:39:20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connecting to remote server failed</span><br /><span style="color: #808080; background-color: #ffffff;">with the following error message : The WinRM client cannot process the request.</span><br /><span style="color: #808080; background-color: #ffffff;">A computer policy does not allow the delegation of the user credentials to the</span><br /><span style="color: #808080; background-color: #ffffff;">target computer. Use gpedit.msc and look at the following policy: Computer</span><br /><span style="color: #808080; background-color: #ffffff;">Configuration -&gt; Administrative Templates -&gt; System -&gt; Credentials</span><br /><span style="color: #808080; background-color: #ffffff;">Delegation -&gt; Allow Delegating Fresh Credentials.&nbsp; Verify that it is</span><br /><span style="color: #808080; background-color: #ffffff;">enabled and configured with an SPN appropriate for the target computer. For</span><br /><span style="color: #808080; background-color: #ffffff;">example, for a target computer name "myserver.domain.com", the SPN</span><br /><span style="color: #808080; background-color: #ffffff;">can be one of the following: WSMAN/myserver.domain.com or WSMAN/*.domain.com.</span><br /><span style="color: #808080; background-color: #ffffff;">For more information, see the about_Remote_Troubleshooting Help topic.</span></p>
<p>The first step is to verify the PowerShell configuration on the SharePoint farm servers.&nbsp;Open up this page, <a title="https://technet.microsoft.com/en-us/library/hh144782.aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/SharePoint Diagnostic Studio 2010 (SPDiag 3.0)">SharePoint Diagnostic Studio 2010 (SPDiag 3.0)</a>. It has the installation requirements and instructions.</p>
<p>We are interested in<strong> target server</strong> configuration. On each server in the farm,<span style="text-decoration: underline;"> including the database server</span>, Open a PowerShell window as administrator, and run the commands listed in the TechNet article, repeated here:</p>
<ul>
<li><strong>Enable-PSRemoting -force</strong></li>
<li><strong>Enable-WSManCredSSP -role Server -force</strong></li>
<li><strong>Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000</strong></li>
<li><strong>Set-ExecutionPolicy RemoteSigned</strong></li>
</ul>
<p>Now we need to set the PowerShell configuration on the <strong>client server</strong>. While the TechNet article doesn't mention this, I have found by experience the client server is where you are running SPDiag, even if it is one of the SharePoint farm servers. In my case, SPDiag is installed on the Central Administration server, so I have to execute these PowerShell commands as administrator.</p>
<ul>
<li><strong>Enable-PSRemoting -force</strong></li>
<li><strong>Enable-WSManCredSSP -role Client -DelegateComputer &ldquo;<span style="background-color: #ffff00;">&lt;target_computer&gt;</span>&rdquo; -force</strong></li>
</ul>
<p>The question is, What is the correct <strong>target_computer</strong> value? For a true remote client, it is one or more&nbsp;of the SharePoint servers, like the Central Administration server; but what if you are running SPDiag on farm server? I used the farm server name where SPDiag is installed. In my case, I had to use the Central Administration server FQDN name, even though logically it is not <em>remote </em>from the farm (however, it is remote from the other servers in the farm).&nbsp;</p>
<p>Please see <a title="https://technet.microsoft.com/en-us/library/dd819517.aspx" href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/Enable-WSManCredSSP">Enable-WSManCredSSP</a> for details of the command syntax and how to specify multiple target servers. Notice the command expects the FQDN server name(s).</p>
<p>Now that PowerShell is configured for remote execution; that is, SPDiag can now execute PowerShell scripts remotely on the other farm servers from the Central Administration server, we need to address the error message above which refers to credential delegation. What is this all about?</p>
<p>When PowerShell executes a script remotely, it has to execute on the remote machine within a user security context. SPDiag uses the security credentials&nbsp;you enter in the <strong>Credential Request</strong> prompt to&nbsp;establish the security context on the remote server.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/1440.snapshot5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/1440.snapshot5.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/1440.snapshot5.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/1440.snapshot5.png" width="336" height="231" /></a></p>
<p>If you enter the Farm Administrator credentials, then the Farm Administrator account has be explicitly configured for remote delegation to be able to execute the remote PowerShell scripts on the other farm servers. This is what the above sample error message is about. It is telling us PowerShell cannot run remote scripts because it has not been authorized to delegate the credentials to the target server(s). The fix is simple. Just follow the step in the error message.</p>
<p>Run the <strong>gpedit.msc</strong> management console by entering <strong>gpedit.msc</strong> in the <strong>Run</strong> box of the Start Menu.</p>
<p>When the console opens, navigate the tree structure to <strong><span style="color: #000000;">Computer <span style="background-color: #ffffff;">Configuration -&gt; Administrative Templates -&gt; System -&gt; Credentials </span><span style="background-color: #ffffff;">Delegation -&gt; Allow Delegating Fresh Credentials.</span></span></strong></p>
<p><span style="color: #000000;"><span style="background-color: #ffffff;">Select the <strong>Enable</strong> option, and then click the <strong>Show</strong> button to see the list of servers that can be delegated to.</span></span></p>
<p><span style="color: #000000;"><span style="background-color: #ffffff;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/8206.snapshot3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/8206.snapshot3.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/8206.snapshot3.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/8206.snapshot3.png" /></a></span></span></p>
<p><span style="color: #000000;"><span style="background-color: #ffffff;">When the <strong>Show Contents</strong> window opens, use the <strong>Add</strong> button to add SharePoint farm servers and the database server. Use the format shown; that is, <strong>wsman/</strong> prefixed to the server's NetBIOS name.</span></span></p>
<p><span style="color: #000000;"><span style="background-color: #ffffff;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/1832.snapshot4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/1832.snapshot4.png"></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/8358.snapshot4.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/8358.snapshot4.png"><img border="0" alt="" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/43/8358.snapshot4.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-43/8358.snapshot4.png" width="469" height="165" /></a></span></span></p>
<p><span style="color: #000000;"><span style="background-color: #ffffff;"><strong>Note</strong>: It appears SPDiag expects the database server to be a single machine; or the currently active mirror. SPDiag (in my experience) is unable to resolve the logical name of clustered servers. In other words, SPDiag expects the name entered to be an individual&nbsp;server machine, not a cluster name. Hopefully future versions of SPDiag will be able to gracefully handle SQL clusters.</span></span></p>
<p><span style="color: #000000;"><span style="background-color: #ffffff;">That's it. You should now be able to generate snapshots.</span></span></p>
<p></p>]]></content:encoded>
    </item>
  </channel>
</rss>