<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mark Arend : STSADM</title><link>http://blogs.msdn.com/markarend/archive/tags/STSADM/default.aspx</link><description>Tags: STSADM</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Master Page stsadm commands</title><link>http://blogs.msdn.com/markarend/archive/2008/01/24/master-page-stsadm-commands.aspx</link><pubDate>Fri, 25 Jan 2008 06:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7232962</guid><dc:creator>markarend</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/markarend/comments/7232962.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markarend/commentrss.aspx?PostID=7232962</wfw:commentRss><description>&lt;P&gt;Have you ever wanted to use stsadm to view or manipulate a site's master page?&amp;nbsp; Unfortunately there are no default commands to do so.&amp;nbsp; But stsadm is easy--and fun, some might even argue--to extend.&lt;/P&gt;
&lt;P&gt;I wrote a sample project that you can use to perform the following functions:&lt;/P&gt;
&lt;LI&gt;stsadm -o &lt;B&gt;ShowMasterPage&lt;/B&gt; -url &amp;lt;site url&amp;gt; 
&lt;LI&gt;stsadm -o &lt;B&gt;SetMasterPage&lt;/B&gt; -url &amp;lt;site url&amp;gt; -masterpageurl [&amp;lt;page url&amp;gt; | Parent] 
&lt;P&gt;This can come in very handy for troubleshooting and fixing problems with some master page deployments.&amp;nbsp; The code is on MSDN's new "Code Gallery" which is very much like CodePlex, but designed for the smaller, quicker samples that don't need to be full-blown collaborative projects.&amp;nbsp; I thought I'd try it out.&lt;/P&gt;&lt;/LI&gt;
&lt;P&gt;&lt;EM&gt;Download: &lt;/EM&gt;&lt;A title=http://code.msdn.microsoft.com/masterpagecommands href="http://code.msdn.microsoft.com/masterpagecommands" mce_href="http://code.msdn.microsoft.com/masterpagecommands"&gt;http://code.msdn.microsoft.com/masterpagecommands&lt;/A&gt;.&lt;/P&gt;
&lt;LI&gt;
&lt;P&gt;Related links:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;TechNet has the best reference of the out-of-box &lt;A href="http://technet2.microsoft.com/Office/en-us/library/e5134b97-b629-4fc0-8733-f2a49126daee1033.mspx?mfr=true" mce_href="http://technet2.microsoft.com/Office/en-us/library/e5134b97-b629-4fc0-8733-f2a49126daee1033.mspx?mfr=true"&gt;Stsadm operations and properties&lt;/A&gt;. 
&lt;LI&gt;MSDN has the official discussion of &lt;A href="http://msdn2.microsoft.com/en-us/library/bb417382.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb417382.aspx"&gt;how to extend stsadm&lt;/A&gt;. 
&lt;LI&gt;Gary Lapointe has created, as of this writing, &lt;A href="http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html" mce_href="http://stsadm.blogspot.com/2007/08/stsadm-commands_09.html"&gt;88 stsadm extensions&lt;/A&gt;!&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7232962" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markarend/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/markarend/archive/tags/STSADM/default.aspx">STSADM</category><category domain="http://blogs.msdn.com/markarend/archive/tags/Master+Pages/default.aspx">Master Pages</category></item><item><title>Scripting STSADM commands</title><link>http://blogs.msdn.com/markarend/archive/2007/11/08/scripting-stsadm-commands.aspx</link><pubDate>Thu, 08 Nov 2007 18:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5988377</guid><dc:creator>markarend</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/markarend/comments/5988377.aspx</comments><wfw:commentRss>http://blogs.msdn.com/markarend/commentrss.aspx?PostID=5988377</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;EM&gt;This posting contains tips 'n tricks for using STSADM commands within batch files.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;Note, the primary Microsoft reference&amp;nbsp;for STSADM: TechNet article &lt;/FONT&gt;&lt;A href="http://technet2.microsoft.com/Office/en-us/library/188f006d-aa66-4784-a65b-a31822aa13f71033.mspx?mfr=true"&gt;&lt;FONT face="Times New Roman" color=#0000ff size=3&gt;Stsadm command-line tool (Office SharePoint Server)&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;Testing results&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;STSADM returns 0 as ERRORLEVEL in DOS when it succeeds, or -1 when it fails.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;To test for success, &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;IF %ERRORLEVEL% EQU 0&lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; can be used.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;Redirecting output&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;When scripting stsadm, sometimes it’s desired to redirect output to a file, using the “&amp;gt;” operator.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This works as expected, but if stsadm displays error messages from executing its requested operation, the messages still go to the screen and not into the file.&amp;nbsp; This is because DOS has two standard output devices, stdout and stderr.&amp;nbsp; The&amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;&amp;nbsp; operator redirects stdout only.&amp;nbsp; Fortunately, we can add another operator that will redirect stderr to stdout so that all messages go into the output file:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 15.6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 15.6pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"&gt;stsadm -o addsolution -filename MySoln.wsp &amp;gt;output.txt 2&amp;gt;&amp;amp;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&lt;FONT size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;amp;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt; is a command redirection operator.&amp;nbsp; Stderr is handle 2, and stdout is handle 1.&amp;nbsp; Therefore, &lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;2&amp;gt;&amp;amp;1&lt;/SPAN&gt;&lt;FONT face=Calibri&gt; means redirect stderr to stdout.&amp;nbsp; Since we've already redirected stdout to output.txt, then all messages will now go into this file.&lt;BR style="mso-special-character: line-break"&gt;&lt;BR style="mso-special-character: line-break"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Calibri size=3&gt;See Microsoft article &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true"&gt;&lt;FONT face="Times New Roman" color=#0000ff size=3&gt;Using command redirection operators&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;for further applications of this and related operators.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Finally, remember that&amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;&amp;nbsp; will&lt;I style="mso-bidi-font-style: normal"&gt; append&lt;/I&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;EM&gt;&lt;SPAN style="FONT-SIZE: 8.5pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'"&gt; &lt;/SPAN&gt;&lt;/EM&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;messages from stdout to the specified file instead of overwriting;&amp;nbsp; &lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&amp;gt;output.txt 2&amp;gt;&amp;amp;1&lt;/SPAN&gt;&lt;FONT face=Calibri&gt; works to append all messages and errors.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;Asynchronous commands&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Some stsadm commands create a timer job to execute the operation so that it may be executed on multiple farm servers.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Commands that use the following modifiers may behave this way:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 130.5pt; TEXT-INDENT: -94.5pt"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;-immediate&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Use a timer job to execute the operation on all applicable servers immediately… the job will start within one minute.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 130.5pt; TEXT-INDENT: -94.5pt"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;–time &amp;lt;time&amp;gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Use a timer job to execute the operation on all applicable servers at the specified&lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt; &amp;lt;time&amp;gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 130.5pt; TEXT-INDENT: -94.5pt"&gt;&lt;FONT size=3&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;-local&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;Execute the operation on the local server immediately; return only after operation completes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;When using &lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;-immediate&lt;/SPAN&gt;&lt;FONT face=Calibri&gt; or &lt;/FONT&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;-time&lt;/SPAN&gt;&lt;FONT face=Calibri&gt;, stsadm will return after creating the timer job.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;However, the operation itself will take a little while longer to finish its execution.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This can become a problem in scripts such as&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;stsadm -o retractsolution -name mysolution.wsp -immediate&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;stsadm -o deletesolution -name mysolution.wsp&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Here, the second command will fail because the retractsolution operation will not have been completed on all servers yet.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;The simplest fix that can be recommended is to ask for human intervention:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;stsadm -o retractsolution -name mysolution.wsp -immediate&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;echo Wait for mysolution.wsp to be retracted across farm&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;pause&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;&lt;FONT size=3&gt;stsadm -o deletesolution -name mysolution.wsp&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Note that the stsadm command &lt;B&gt;execadmsvcjobs&lt;/B&gt; might seem to offer a clever solution, because it will cause outstanding deployments to complete synchronously.&amp;nbsp; However, this command affects &lt;I&gt;the local server only&lt;/I&gt;, so the same situation still exists on a multi-server farm.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT size=4&gt;&lt;FONT color=#4f81bd&gt;&lt;FONT face=Cambria&gt;Customer stsadm scenario… with a challenge&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Many customers have requirements to deploy required configurations to their farm; this typically means they must deploy to several environments such as Dev, UAT and Production.&amp;nbsp; They want to script these configurations whenever possible so that the process can be automated.&amp;nbsp; Stsadm supplies operations to set some configurations, but not all.&amp;nbsp; In addition, some of the ones that it does not cover can be very tedious to configure manually, such as search scopes, profile properties and audience definitions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;In these situations, creating an stsadm extension is a great approach to setting these configurations in an automated way.&amp;nbsp; It matches the approach of scripting default stsadm commands to execute in different environments.&amp;nbsp; Also, stsadm extensions can be deployed as other customizations are deployed, using SharePoint Solution files.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;A flexible way to design these extensions to supply an import/export pair of operations.&amp;nbsp; This way, a developer can configure their SharePoint instance to have the appropriate configurations, then use the stsadm extension to export the configuration settings as an xml file.&amp;nbsp; On the UAT and Production farms, the stsadm extension can then be used to import from the xml file to make the appropriate configuration settings.&amp;nbsp; This approach allows the process to be maintained throughout production, usually without requiring the developer’s involvement for further changes.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;One challenge with this is deploying and executing the stsadm extension.&amp;nbsp; These two operations should be performed as separate steps, because the deployment must be fully completed before attempting to execute.&amp;nbsp; On a local server, a script can ensure the deployment step is complete by using the -local argument, but on a farm with multiple servers, the deployment must use -immediate, which executes as soon as possible, but asynchronously.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;To do both operations in a script, it is necessary to wait for deployment explicitly, as shown in the following example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;stsadm -o addsolution -filename ImportProfileProperties.wsp&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;stsadm -o deploysolution -name ImportProfileProperties.wsp -immediate -allowgacdeployment&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;echo Wait for ImportProfileProperties.wsp to be deployed across farm&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;pause&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;stsadm -o importprofileproperties -filename RequiredProperties.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Note that the stsadm command &lt;B&gt;execadmsvcjobs&lt;/B&gt; might seem to offer a clever solution, because it will cause outstanding deployments to complete synchronously.&amp;nbsp; However, this command affects &lt;I&gt;the local server only&lt;/I&gt;, so the same situation still exists on a multi-server farm.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5988377" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/markarend/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/markarend/archive/tags/STSADM/default.aspx">STSADM</category><category domain="http://blogs.msdn.com/markarend/archive/tags/Development/default.aspx">Development</category></item></channel></rss>