<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1496718626530818953</id><updated>2024-09-14T04:26:11.778-07:00</updated><category term="PowerShell"/><category term=".NET"/><category term="ASP.NET"/><category term="General Help"/><category term="General Help - Windows"/><category term="SharePoint 2013"/><category term="Web Parts"/><title type='text'>Sharepoint and .NET</title><subtitle type='html'>Sharepoint and .NET technical blogs..</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-4097807535396984282</id><published>2014-11-19T00:06:00.000-08:00</published><updated>2014-11-19T00:06:27.255-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2013"/><title type='text'>Search Using JSOM – SharePoint 2013</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
We can use JSOM for Keyword query search in SharePoint 2013. I’ll explain basics of this using a CEWP and jquery.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Prerequisites&lt;/b&gt;: Search should be configured and working in the system.&lt;br /&gt;
&lt;b&gt;Solution&lt;/b&gt;:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create a web part page in your SharePoint 2013 or Office 365 SharePoint Site.&lt;/li&gt;
&lt;li&gt;Add Content Editor web part on the page.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgqlaq-nJ1_3Koyjyo6L0hr3vQ9mV00e6HFB-zkFdDGOEE-w7C39qT6jU2W7IsB8LdcHtxPLtI9FlsVBRnyrZKAxCdujOFiwjXYXKbS88wce2tthBopST9ieHUisJfIrdwPH5T-xczQZ8/s1600/jsr1.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgqlaq-nJ1_3Koyjyo6L0hr3vQ9mV00e6HFB-zkFdDGOEE-w7C39qT6jU2W7IsB8LdcHtxPLtI9FlsVBRnyrZKAxCdujOFiwjXYXKbS88wce2tthBopST9ieHUisJfIrdwPH5T-xczQZ8/s1600/jsr1.JPG&quot; height=&quot;358&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
3. Open any text editor/visual studio and write JS file ‘Search_JSOM.js’, code is copied below:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&amp;lt;script src=”//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js”&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=”text/javascript” src=”/_layouts/15/sp.runtime.debug.js”&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=”text/javascript” src=”/_layouts/15/sp.js”&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=”text/javascript” src=”/_layouts/15/SP.RequestExecutor.js”&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=”text/javascript” src=”/_layouts/15/SP.search.js”&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
table.sresult, th.sresult , td.sresult {&lt;br /&gt;
border: 1px solid grey;&lt;br /&gt;
border-collapse: collapse;&lt;br /&gt;
padding: 5px;&lt;br /&gt;
}&lt;br /&gt;
table.sresult tr:nth-child(odd) {&lt;br /&gt;
background-color: #f1f1f1;&lt;br /&gt;
}&lt;br /&gt;
table.sresult tr:nth-child(even) {&lt;br /&gt;
background-color: #ffffff;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;script type=”text/javascript”&amp;gt;&lt;br /&gt;
&lt;br /&gt;
$(function () {&lt;br /&gt;
var results;&lt;br /&gt;
$(“#btnSearch”).click(executeSearch);&lt;br /&gt;
$(“#btnSearch”).button();&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
//SERCH FUNCTION&lt;br /&gt;
&lt;br /&gt;
function executeSearch(event) {&lt;br /&gt;
var appweburl = _spPageContextInfo.siteAbsoluteUrl;&lt;br /&gt;
var clientContext = new SP.ClientContext(appweburl);&lt;br /&gt;
var keywordQuery = new Microsoft.SharePoint.Client.Search.Query.KeywordQuery(clientContext);&lt;br /&gt;
keywordQuery.set_queryText($(“#searchTextBox”).val());&lt;br /&gt;
var searchExecutor = new Microsoft.SharePoint.Client.Search.Query.SearchExecutor(clientContext);&lt;br /&gt;
results = searchExecutor.executeQuery(keywordQuery);&lt;br /&gt;
clientContext.executeQueryAsync(onQuerySuccess, onQueryFailed);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onQuerySuccess(sender, args) {&lt;br /&gt;
$(“#result_box”).empty();&lt;br /&gt;
var table = $(“&amp;lt;table class=’sresult’&amp;gt;”, { ID: “resultsTable” });&lt;br /&gt;
table.append($(“&amp;lt;thead&amp;gt;”)&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).text(“Title”))&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).text(“Path”))&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).text(“Owner”))&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).text(“Modified”)));&lt;br /&gt;
&lt;br /&gt;
$.each(results.m_value.ResultTables[0].ResultRows, function () {&lt;br /&gt;
table.append($(“&amp;lt;tr&amp;gt;”)&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).append(this.Title))&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).append(this.Path))&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).append(this.Author))&lt;br /&gt;
.append($(“&amp;lt;td&amp;gt;”).append(this.Write)));&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
$(“#result_box”).append(table);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function onQueryFailed(sender, args) {&lt;br /&gt;
$(“#result_box”).empty();&lt;br /&gt;
$(“#result_box”).text(“Error: ” + ‘Request failed. ‘ + args.get_message() + ‘\n’ + args.get_stackTrace());&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
&amp;lt;label for=”searchTextBox”&amp;gt;Search: &amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input id=”searchTextBox” type=’text’ style=”width: 200px”&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;input id=”btnSearch” type=’button’ style=”width: 100px” value=”Search”&amp;gt;&amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div id=”result_box”&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;strong&gt;JS explained:&lt;/strong&gt;&lt;br /&gt;
JS starts with required script references (jquery, sp.js, sp.search.js etc.) and style for search results table. Followed by java script function ‘executeSearch’ to get client context, read ‘keyword’ and then execute search query on keyword. ‘onQuerySuccess’ function will handle success case and create a table with search results that will be displayed on the page. ‘onQueryFailed’ will display error message if ‘executeQueryAsync’ fails. Finally a text box to provide ‘keyword’, button to search and div for search results are added as html.&lt;br /&gt;
&lt;br /&gt;
4. Now upload this ‘Search_JSOM.js’ to site assets or any other library of SharePoint site.&lt;br /&gt;
5. Edit Content Editor Web part on page and provide URL of ‘Search_JSOM.js’ file as Content Link. Save the page, it will look like:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWaLm2gZgvvRS3WVOfNi-m5h526ZrxGul3XggO8IkXtPJWNQd4c7_mkXIPwPZdvIGIrg_oSyGv-lsiSC2go6mZLlbm64wEiwiXp-YAkMSs-_1w4UhWVlFAinegyeqr1XcybFx2_10RGdU/s1600/jsr2.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWaLm2gZgvvRS3WVOfNi-m5h526ZrxGul3XggO8IkXtPJWNQd4c7_mkXIPwPZdvIGIrg_oSyGv-lsiSC2go6mZLlbm64wEiwiXp-YAkMSs-_1w4UhWVlFAinegyeqr1XcybFx2_10RGdU/s1600/jsr2.JPG&quot; height=&quot;186&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Enter a valid text which exists in SharePoint and already crawled, and click on search button; relevant results will be displayed as a table.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlC5SexvyNzEVTGq_dzT4lBwpcpdajWevxzKIFBOa-cfkgMThuIsCTmxX3mDIN1uz_egmA2FKNpfJuxOrFIOwUxF2bZiv4DVPyv7Uoo06JSJJnX75UD-9Ygo_DbH3FyYMffmfY2qxasZs/s1600/jsr3.JPG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlC5SexvyNzEVTGq_dzT4lBwpcpdajWevxzKIFBOa-cfkgMThuIsCTmxX3mDIN1uz_egmA2FKNpfJuxOrFIOwUxF2bZiv4DVPyv7Uoo06JSJJnX75UD-9Ygo_DbH3FyYMffmfY2qxasZs/s1600/jsr3.JPG&quot; height=&quot;244&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thank you...&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/4097807535396984282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2014/11/search-using-jsom-sharepoint-2013.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/4097807535396984282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/4097807535396984282'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2014/11/search-using-jsom-sharepoint-2013.html' title='Search Using JSOM – SharePoint 2013'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgqlaq-nJ1_3Koyjyo6L0hr3vQ9mV00e6HFB-zkFdDGOEE-w7C39qT6jU2W7IsB8LdcHtxPLtI9FlsVBRnyrZKAxCdujOFiwjXYXKbS88wce2tthBopST9ieHUisJfIrdwPH5T-xczQZ8/s72-c/jsr1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-8698419182338568215</id><published>2014-11-17T20:35:00.002-08:00</published><updated>2014-11-17T20:35:47.641-08:00</updated><title type='text'>Customize Display templates – SharePoint 2013 &amp; SharePoint Online</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In SharePoint 2013 we have display templates to handle the display of search results in web parts. I would recommend to read this &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/office/jj945138(v=office.15).aspx&quot; target=&quot;_blank&quot;&gt;msdn article&lt;/a&gt; to understand display templates first.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
I will give a&amp;nbsp;walk through&amp;nbsp;on how do we customize a display template for a&amp;nbsp;particular&amp;nbsp;requirement (in this&amp;nbsp;case to display e-mail address of person).&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;Prerequisites&lt;/b&gt;: Search should be configured and working in the
system.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;u&gt;Solution&lt;/u&gt;&lt;/b&gt;&lt;u&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot; style=&quot;mso-list: l1 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;1.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Create a web part page “MySearch.aspx”, and
added “Search Box” &amp;amp; “Search Results” web parts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l1 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;2.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Configure both the web parts that search box
query goes to search result.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj213cVHn8FgGzMr09Lh5d4IJYQGY9NDnKCwUajPXomv3n8t1-fSvRvK-1D5ax7k3_ThfFeO6-fLujH_9DyKylUHGpy29ejG8ilvmtmVxuItHqfVuc1aXpt-BhpZRqGQ2CGo1V6bIuKaAc/s1600/sr1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj213cVHn8FgGzMr09Lh5d4IJYQGY9NDnKCwUajPXomv3n8t1-fSvRvK-1D5ax7k3_ThfFeO6-fLujH_9DyKylUHGpy29ejG8ilvmtmVxuItHqfVuc1aXpt-BhpZRqGQ2CGo1V6bIuKaAc/s1600/sr1.png&quot; height=&quot;488&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l1 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l1 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;3.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Go &lt;!--[if gte vml 1]&gt;&lt;v:shapetype id=&quot;_x0000_t75&quot;
 coordsize=&quot;21600,21600&quot; o:spt=&quot;75&quot; o:preferrelative=&quot;t&quot; path=&quot;m@4@5l@4@11@9@11@9@5xe&quot;
 filled=&quot;f&quot; stroked=&quot;f&quot;&gt;
 &lt;v:stroke joinstyle=&quot;miter&quot;/&gt;
 &lt;v:formulas&gt;
  &lt;v:f eqn=&quot;if lineDrawn pixelLineWidth 0&quot;/&gt;
  &lt;v:f eqn=&quot;sum @0 1 0&quot;/&gt;
  &lt;v:f eqn=&quot;sum 0 0 @1&quot;/&gt;
  &lt;v:f eqn=&quot;prod @2 1 2&quot;/&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelWidth&quot;/&gt;
  &lt;v:f eqn=&quot;prod @3 21600 pixelHeight&quot;/&gt;
  &lt;v:f eqn=&quot;sum @0 0 1&quot;/&gt;
  &lt;v:f eqn=&quot;prod @6 1 2&quot;/&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelWidth&quot;/&gt;
  &lt;v:f eqn=&quot;sum @8 21600 0&quot;/&gt;
  &lt;v:f eqn=&quot;prod @7 21600 pixelHeight&quot;/&gt;
  &lt;v:f eqn=&quot;sum @10 21600 0&quot;/&gt;
 &lt;/v:formulas&gt;
 &lt;v:path o:extrusionok=&quot;f&quot; gradientshapeok=&quot;t&quot; o:connecttype=&quot;rect&quot;/&gt;
 &lt;o:lock v:ext=&quot;edit&quot; aspectratio=&quot;t&quot;/&gt;
&lt;/v:shapetype&gt;&lt;v:shape id=&quot;Picture_x0020_1&quot; o:spid=&quot;_x0000_s1026&quot; type=&quot;#_x0000_t75&quot;
 style=&#39;position:absolute;left:0;text-align:left;margin-left:0;margin-top:0;
 width:403.75pt;height:308.85pt;z-index:251658240;visibility:visible;
 mso-wrap-style:square;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;
 mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;
 mso-position-horizontal:left;mso-position-horizontal-relative:text;
 mso-position-vertical:top;mso-position-vertical-relative:text&#39; stroked=&quot;t&quot;
 strokecolor=&quot;#4f81bd [3204]&quot;&gt;
 &lt;v:imagedata src=&quot;file:///C:\Users\DEEPAK~1.SOL\AppData\Local\Temp\OICE_F9EDF1FF-0C52-4057-902F-9A9C6E29C8AF.0\msohtmlclip1\01\clip_image001.png&quot;
  o:title=&quot;&quot;/&gt;
 &lt;w:wrap type=&quot;square&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;to Site Settings
-&amp;gt; Master Page Gallery -&amp;gt; Display Templates -&amp;gt; Search&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l1 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;4.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Download “Item_Person.html” file, the display
template for People Item.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;!--[if gte vml 1]&gt;&lt;v:shape
 id=&quot;Picture_x0020_4&quot; o:spid=&quot;_x0000_i1028&quot; type=&quot;#_x0000_t75&quot; style=&#39;width:407.25pt;
 height:270pt;visibility:visible;mso-wrap-style:square&#39; o:bordertopcolor=&quot;yellow pure&quot;
 o:borderleftcolor=&quot;yellow pure&quot; o:borderbottomcolor=&quot;yellow pure&quot;
 o:borderrightcolor=&quot;yellow pure&quot;&gt;
 &lt;v:imagedata src=&quot;file:///C:\Users\DEEPAK~1.SOL\AppData\Local\Temp\OICE_F9EDF1FF-0C52-4057-902F-9A9C6E29C8AF.0\msohtmlclip1\01\clip_image003.png&quot;
  o:title=&quot;&quot;/&gt;
 &lt;w:bordertop type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderleft type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderbottom type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderright type=&quot;single&quot; width=&quot;6&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnm0rkWNOTaK2EHDTsa-rBVUFkHp-HBIOb1K3j_uQ63cM_SjY1UMxWT8oMCxmIg-QdW2ytvFsGQFnlMt_uziBz7KgxNxblfi9ickZeIG35wp1mcPgciMyHKPZ6HwZtAdphJbRvChaJEY/s1600/sr2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnm0rkWNOTaK2EHDTsa-rBVUFkHp-HBIOb1K3j_uQ63cM_SjY1UMxWT8oMCxmIg-QdW2ytvFsGQFnlMt_uziBz7KgxNxblfi9ickZeIG35wp1mcPgciMyHKPZ6HwZtAdphJbRvChaJEY/s1600/sr2.png&quot; height=&quot;424&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br clear=&quot;all&quot; /&gt;
5. Change html to display Email – add the highlighted code as below:&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8EMg2oj8R4S2gwOuLQsxatfjzfBVAwO7EcN9QuyVsLq9OXfbXP1KVINpudsLRwlBR8kTv_ktpxupQ4EICpdJ_2QaFGYq-oPuSTDQL2Fv-d21UYPk4m2OpyHHnsn1saFNPsVbyxgifXqw/s1600/sr3.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8EMg2oj8R4S2gwOuLQsxatfjzfBVAwO7EcN9QuyVsLq9OXfbXP1KVINpudsLRwlBR8kTv_ktpxupQ4EICpdJ_2QaFGYq-oPuSTDQL2Fv-d21UYPk4m2OpyHHnsn1saFNPsVbyxgifXqw/s1600/sr3.png&quot; height=&quot;416&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;!--[if gte vml 1]&gt;&lt;v:shape
 id=&quot;Picture_x0020_7&quot; o:spid=&quot;_x0000_i1027&quot; type=&quot;#_x0000_t75&quot; style=&#39;width:415.5pt;
 height:271.5pt;visibility:visible;mso-wrap-style:square&#39; o:bordertopcolor=&quot;yellow pure&quot;
 o:borderleftcolor=&quot;yellow pure&quot; o:borderbottomcolor=&quot;yellow pure&quot;
 o:borderrightcolor=&quot;yellow pure&quot;&gt;
 &lt;v:imagedata src=&quot;file:///C:\Users\DEEPAK~1.SOL\AppData\Local\Temp\OICE_F9EDF1FF-0C52-4057-902F-9A9C6E29C8AF.0\msohtmlclip1\01\clip_image005.png&quot;
  o:title=&quot;&quot;/&gt;
 &lt;w:bordertop type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderleft type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderbottom type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderright type=&quot;single&quot; width=&quot;6&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo2; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;6.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Upload the updated file to display template
library and publish the file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo2; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;7.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Go to the MySearch page -&amp;gt; Edit Page-&amp;gt;
Edit ‘Search Results’ Web part&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo2; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;8.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Under ‘Display Templates’, chose ‘Use a single
template to display items’ and select ‘People Item’.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;!--[if gte vml 1]&gt;&lt;v:shape id=&quot;Picture_x0020_13&quot;
 o:spid=&quot;_x0000_i1026&quot; type=&quot;#_x0000_t75&quot; style=&#39;width:189.75pt;height:333pt;
 visibility:visible;mso-wrap-style:square&#39;&gt;
 &lt;v:imagedata src=&quot;file:///C:\Users\DEEPAK~1.SOL\AppData\Local\Temp\OICE_F9EDF1FF-0C52-4057-902F-9A9C6E29C8AF.0\msohtmlclip1\01\clip_image007.png&quot;
  o:title=&quot;&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIWg0efrKPZA3lJkTIY1HjYcGMvhT1s0C8TL9X9ts2m8xCwus7WPqYqBysZnThK6GdK6FhozMU7Kg5LUN5CUuIgPYbtryk-Dj38LukNODbIWAomP_Xvb-gBID3Zc5b8x31bNMqkrp7MJE/s1600/sr4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIWg0efrKPZA3lJkTIY1HjYcGMvhT1s0C8TL9X9ts2m8xCwus7WPqYqBysZnThK6GdK6FhozMU7Kg5LUN5CUuIgPYbtryk-Dj38LukNODbIWAomP_Xvb-gBID3Zc5b8x31bNMqkrp7MJE/s1600/sr4.png&quot; height=&quot;640&quot; width=&quot;224&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo2; tab-stops: 126.35pt; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;9.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;!--[endif]--&gt;Save
and exit the Page.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo2; tab-stops: 126.35pt; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;10.&lt;span style=&quot;font-size: 7pt; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;!--[endif]--&gt;Search
name in search box, it should return email id with People data.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDWQ_TFamp4GypFjXM9CWF-Kb16EKF9aaEERTudKORC3culwd9yL1rL2eNyENN2DzNYlyutQh1frd05T648ri64v__cO7_CBU4PAVhbqcN6lofp8eNdVnTe4KQShrTby-SFYkxkVKYsk8/s1600/sr5.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDWQ_TFamp4GypFjXM9CWF-Kb16EKF9aaEERTudKORC3culwd9yL1rL2eNyENN2DzNYlyutQh1frd05T648ri64v__cO7_CBU4PAVhbqcN6lofp8eNdVnTe4KQShrTby-SFYkxkVKYsk8/s1600/sr5.png&quot; height=&quot;430&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;mso-list: l0 level1 lfo2; tab-stops: 126.35pt; text-indent: -.25in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;
&lt;!--[if gte vml 1]&gt;&lt;v:shape id=&quot;Picture_x0020_19&quot;
 o:spid=&quot;_x0000_i1025&quot; type=&quot;#_x0000_t75&quot; style=&#39;width:395.25pt;height:265.5pt;
 visibility:visible;mso-wrap-style:square&#39; o:bordertopcolor=&quot;yellow pure&quot;
 o:borderleftcolor=&quot;yellow pure&quot; o:borderbottomcolor=&quot;yellow pure&quot;
 o:borderrightcolor=&quot;yellow pure&quot;&gt;
 &lt;v:imagedata src=&quot;file:///C:\Users\DEEPAK~1.SOL\AppData\Local\Temp\OICE_F9EDF1FF-0C52-4057-902F-9A9C6E29C8AF.0\msohtmlclip1\01\clip_image009.png&quot;
  o:title=&quot;&quot;/&gt;
 &lt;w:bordertop type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderleft type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderbottom type=&quot;single&quot; width=&quot;6&quot;/&gt;
 &lt;w:borderright type=&quot;single&quot; width=&quot;6&quot;/&gt;
&lt;/v:shape&gt;&lt;![endif]--&gt;&lt;!--[if !vml]--&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/8698419182338568215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2014/11/customize-display-templates-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8698419182338568215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8698419182338568215'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2014/11/customize-display-templates-sharepoint.html' title='Customize Display templates – SharePoint 2013 &amp; SharePoint Online'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj213cVHn8FgGzMr09Lh5d4IJYQGY9NDnKCwUajPXomv3n8t1-fSvRvK-1D5ax7k3_ThfFeO6-fLujH_9DyKylUHGpy29ejG8ilvmtmVxuItHqfVuc1aXpt-BhpZRqGQ2CGo1V6bIuKaAc/s72-c/sr1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-7045268364947381005</id><published>2014-07-06T00:37:00.000-07:00</published><updated>2014-07-06T00:37:21.919-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><title type='text'>PowerShell: Script to update solution</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot;&gt;
Solution deployment is one important task
for SharePoint developer/admin, being it in local environment or any other
Production/non-production farm.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
Here is a script
to automate this job and avoid errors. Only manual task here is to provide
“Variable Values”, i.e. – name of WSP, path, web application URL etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
In this
case&amp;nbsp;WSP is already added to farm solution store and deployed. We did some
changes in existing code and need to update the solution. The Update-SPSolution
cmdlet upgrades a deployed SharePoint solution in the farm. Use this cmdlet
only if a new solution contains the same set of files and features as the
deployed solution. If files and features are different, the solution must be
retracted and redeployed.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;1.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Copy the script below, save it as PS file, i.e.
– UpdateSolution.ps1&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;2.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Edit it in any compatible editor; change&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; mso-bidi-font-family: Mangal; mso-bidi-theme-font: minor-bidi; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Declaration
of the Variables&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;section
as per your requirement.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;3.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Open PS prompt/SharePoint management Shell with
admin rights.&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;4.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Navigate to the folder where PS file is saved&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot; style=&quot;margin-left: .75in; mso-add-space: auto; mso-list: l0 level1 lfo1; text-indent: -.25in;&quot;&gt;
&lt;!--[if !supportLists]--&gt;5.&lt;span style=&quot;font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;!--[endif]--&gt;Execute the PS file as&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; mso-bidi-font-family: Mangal; mso-bidi-theme-font: minor-bidi; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;.\UpdateSolution.ps1&lt;/span&gt;&lt;/strong&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#
***********Script Start*********************************************&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Function –
Solution Update&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Author –
Deepak Solanki (&lt;span style=&quot;border: none windowtext 1.0pt; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&lt;a href=&quot;mailto:deepaksinghsolanki@gmail.com&quot;&gt;deepaksinghsolanki@gmail.com&lt;/a&gt;&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Version – 1.0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;##&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Checks to
ensure that Microsoft.SharePoint.Powershell is loaded, if not, adding pssnapin&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Checks if
solution is already exists or deployed in Farm and give appropriate message&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## The Update-SPSolution cmdlet upgrades a
deployed SharePoint solution in the farm. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Use this cmdlet only if a new solution
contains the same set of files and features as the deployed solution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## If files and
features are different, the solution must be retracted and redeployed. &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#
********************************************************************&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;#########################Declaration
of the Variables###############################&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#Solution Name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$SolutionName =
“MySolution.wsp”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#Literal Path&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$SolutionPath =
“C:\Deployment\MySolution.wsp”; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;############################ Declaration of
the (helper) function&amp;nbsp;&amp;nbsp; # ####################&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Function
UpdateSolution([string] $SolutionName, [string] $SolutionPath)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{ &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if($SolutionName.ToLower().EndsWith(“.wsp”)
-and $SolutionPath.ToLower().EndsWith(“.wsp”)) &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$count = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;##check to ensure
that Microsoft.SharePoint.Powershell is loaded &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$snapin =
get-pssnapin | where-object{$_.Name -eq
“Microsoft.SharePoint.Powershell”}&amp;nbsp;&amp;nbsp;&amp;nbsp; if($snapin -eq
$null)&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;write-host
“Loading SharePoint snapin” &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;add-pssnapin
“Microsoft.SharePoint.Powershell” &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
##check if WSP already exists in Farm &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$WSPExist =
Get-SPSolution | Where { &amp;nbsp;($SolutionName -eq $_.Name)}&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if($WSPExist -eq $null) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Write-Host
“$SolutionName Solution does not exist in solution store, can not be updated.”
-ForegroundColor Red &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;elseif ((Get-SPSolution
$SolutionName).Deployed) &amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Write-Host
“$SolutionName Solution already exists in solution store and has been deployed.
Starting update…” -ForegroundColor Green &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$SolutionTocheck
= Get-SPSolution -identity $SolutionName &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if ($SolutionToCheck.ContainsGlobalAssembly)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Update-SPSolution
-Identity $SolutionTocheck -LiteralPath $SolutionPath -GACDeployment
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Update-SPSolution
-Identity $SolutionTocheck -LiteralPath $SolutionPath &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Write-Host “Operation
completed.” &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Write-Host
“$SolutionName Solution exists in solution store but has not been deployed, can
not be updated” -ForegroundColor Red&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;} &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;} &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;else &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{
&amp;nbsp;Write-Host “Please provide a valid parameter” -ForegroundColor Red
&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;############################Actual
Function Call&amp;nbsp; # ###########################&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;UpdateSolution
$SolutionName $SolutionPath;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#
***********Script&amp;nbsp;End here*****************************&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/7045268364947381005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2014/07/powershell-script-to-update-solution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7045268364947381005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7045268364947381005'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2014/07/powershell-script-to-update-solution.html' title='PowerShell: Script to update solution'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-4549402951835156044</id><published>2014-07-06T00:25:00.002-07:00</published><updated>2014-07-06T00:25:33.479-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><title type='text'>PowerShell – Reading from CSV file</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoListParagraphCxSpFirst&quot;&gt;
Reading from a csv, and doing some operation
on the records returned by csv is one of the most common tasks in PowerShell.
I’ll try to explain different cases here with sample code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
Below is the
sample csv file “Sourcedata.csv” we’ll be using as example&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: green; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;TaskID, AssignTo, Duration&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: green; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;001, Tom, 55&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: green; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;002, Rand, 230&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: green; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;003, Mat, 86&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
##Script Starts
here&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;##First declare a variable to store
full path of &amp;nbsp;csv file&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$SourceFile =
“C:\Sourcedata.csv”;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;##Use Test-Path
to ensure that given file exists&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if(Test-Path
$SourceFile)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Case 1 – Read
the full CSV file and store result in a variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$allRecords =
Import-csv -path $SourceFile&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;##Case 2 – If csv
has huge data and you want selected rows only, you can filter data with where
condition&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$selectedRecords
= Import-csv -path $SourceFile|Where-Object {$_.AssignTo.Contains(“Rand”)}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;##Case 3- If csv
has data but no column headers and you want to put headers in order to
manipulate data later, you can add headers while importing csv&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$allRecordswithHeader
= Import-csv -Header TaskID, AssignTo, Duration -path $SourceFile&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;#Now you have
data with you and want to start operations on each of the row, simple- iterate
through records&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;foreach($record
in $allRecords)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;$assignTo =
$record.AssignTo;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Write-Host
$assignTo&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;## Do your
operation here..&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;
##Script Ends
here&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoListParagraphCxSpLast&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Mangal; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;Happy scripting&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-font-family: Mangal; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/4549402951835156044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2014/07/powershell-reading-from-csv-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/4549402951835156044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/4549402951835156044'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2014/07/powershell-reading-from-csv-file.html' title='PowerShell – Reading from CSV file'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-3830356673646777214</id><published>2014-07-06T00:13:00.002-07:00</published><updated>2014-07-06T00:32:24.257-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><title type='text'>PowerShell : Create Managed Properties in SharePoint Search Service Application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin-bottom: 16.3pt; margin-left: 0in; margin-right: 0in; margin-top: 0in; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;A common
requirement in SharePoint search is to create Managed Properties and map it to
crawled properties so that it can be used in search query.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;Below is
the approach to write a PS script that can be used to create one or more
managed properties using an input XML file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;1. Create
an xml file ‘ManagedProperties.xml’ as below and provide details.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5HUQCa52HOkDbNqWA-MU1XqMhoaBBSw_Stx31CtmQkhI7bfY5SxD2UIyetFKrNH5TFa3uAyJ-bLsO1KRk-zPFczdrAkhxtPG8sUmdDRIjLd_7bMA0drxbLVyxgIVi-tTQfbriJ6q2x6E/s1600/PS.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5HUQCa52HOkDbNqWA-MU1XqMhoaBBSw_Stx31CtmQkhI7bfY5SxD2UIyetFKrNH5TFa3uAyJ-bLsO1KRk-zPFczdrAkhxtPG8sUmdDRIjLd_7bMA0drxbLVyxgIVi-tTQfbriJ6q2x6E/s1600/PS.JPG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;2. Write
the script in any suitable editor and save it as ”ManagedProperties.ps1′&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;#
*******************************************************************&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;# Function – ManagedProperty Creation&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;# Author – Deepak Solanki [deepaksinghsolanki@gmail.com]&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;# ********************************************************************&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;######################################################&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;# make sure to load SharePoint snapin if not defined
#######################################################[System.reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$snapin=”Microsoft.SharePoint.PowerShell”&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;if (get-pssnapin $snapin -ea “silentlycontinue”)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;write-host -f Green “PSsnapin $snapin is loaded”&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;elseif (get-pssnapin $snapin -registered -ea “silentlycontinue”)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;write-host -f Green “PSsnapin $snapin is registered”&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Add-PSSnapin $snapin&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; write-host -f Green “PSsnapin $snapin is
loaded”&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;else&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;write-host
-f orange “PSSnapin $snapin not found” -foregroundcolor Red&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;#################################################################&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;# Function definition #&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;function createManagedProperty($xmlFile,$searchApplicationName)&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$configXml = [xml]( get-content $xmlFile)&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$searchapp = Get-SPEnterpriseSearchServiceApplication
$searchApplicationName&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$category = Get-SPEnterpriseSearchMetadataCategory -Identity
SharePoint -SearchApplication $searchapp&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;foreach($metaProp in&amp;nbsp;
$configXml.managedproperties.managedproperty)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Write-Host -ForegroundColor Green “Creating property: ”
$metaProp.Name&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
$crawledPropName = $metaProp.crawlproperty&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;##Check if Managed property already exist&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$ManagedProp = Get-SPEnterpriseSearchMetadataManagedProperty
-SearchApplication&amp;nbsp; $searchapp -Identity $metaProp.name -ErrorAction
SilentlyContinue&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;##Delete existing managed property&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;if($ManagedProp -ne $null)&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$ManagedProp.DeleteAllMappings()&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Remove-SPEnterpriseSearchMetadataManagedProperty
-SearchApplication $searchapp -Identity $metaProp.name -Confirm:$false&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;##Create Managed property&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;New-SPEnterpriseSearchMetadataManagedProperty -SearchApplication
$searchapp -Name $metaProp.name -Type $metaProp.type -Queryable $true
-Retrievable $true&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$ManagedProp = Get-SPEnterpriseSearchMetadataManagedProperty
-SearchApplication&amp;nbsp; $searchapp -Identity $metaProp.name&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;##Check if Crawled Property is available&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$crawledproperty = Get-SPEnterpriseSearchMetadataCrawledProperty
-SearchApplication $searchapp -Name $crawledPropName -ErrorAction
SilentlyContinue&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;##Map managed property to crawl property&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;if($crawledproperty -ne $null)&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;New-SPEnterpriseSearchMetadataMapping -SearchApplication
$searchapp -ManagedProperty $ManagedProp -CrawledProperty $crawledproperty&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Write-Host -ForegroundColor Red “Crawled
property does not exist: ” $crawledPropName&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;###########################################&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;# Declaration of the
constants&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;###########################################&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$SearchApplicationName = “Search Service Application”&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$configfile = “ManagedProperties.xml”&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$executingScriptDirectory = Split-Path -Path
$MyInvocation.MyCommand.Definition -Parent&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;$file = “$executingScriptDirectory/$configfile”&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;###Actual execution starts here###&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Write-Host -foregroundcolor Green “***Script Started***”&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;createManagedProperty -searchApplicationName
$SearchApplicationName -xmlFile $file&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;Write-Host -foregroundcolor Green “***Script Completed***”&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 0.0001pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;border: none windowtext 1.0pt; color: blue; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt; mso-border-alt: none windowtext 0in; padding: 0in;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;3. Make
sure that PS script and XML file are in same directory.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia, serif; font-size: 11pt; line-height: 16.3pt;&quot;&gt;4. Ensure
that you have provided correct “$SearchApplicationName” in PS script.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;5. Open
the PowerShell/SharePoint PowerShell console and run the PS script.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;6. While
Copying XML and script from this blog, verify if special characters (“-$ etc)
are correct.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; line-height: 16.3pt; margin: 0in 0in 16.3pt; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: &amp;quot;Georgia&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;Happy
Scripting!!!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/3830356673646777214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2014/07/powershell-create-managed-properties-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/3830356673646777214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/3830356673646777214'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2014/07/powershell-create-managed-properties-in.html' title='PowerShell : Create Managed Properties in SharePoint Search Service Application'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5HUQCa52HOkDbNqWA-MU1XqMhoaBBSw_Stx31CtmQkhI7bfY5SxD2UIyetFKrNH5TFa3uAyJ-bLsO1KRk-zPFczdrAkhxtPG8sUmdDRIjLd_7bMA0drxbLVyxgIVi-tTQfbriJ6q2x6E/s72-c/PS.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-8638985425597730834</id><published>2012-10-07T04:37:00.001-07:00</published><updated>2012-10-07T04:41:26.421-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><title type='text'>PowerShell - Solution deployment simplified</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
As a SharePoint developer or Admin, what we do
most frequently in our day-to-day activities; is to play around with SharePoint
solutions (WSPs) and Features..&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
And since we cannot memorize all the available
operations, here are simplified PowerShell commands:&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;&lt;u&gt;SPSolution Operations:&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Add Solution to SharePoint Farm&lt;/strong&gt;-
You are ready with solution package (WSP) for deployment and this is a fresh
deployment; first time deployment to the farm. SharePoint can consume a
solution only if it is uploaded in SP solution store, and the operation to
upload a solution is Add-SPSolution&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Command:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Add-SPSolution
-LiteralPath &lt;full of=&quot;of&quot; path=&quot;path&quot; wsp=&quot;wsp&quot;&gt; -Confirm &lt;switchparameter&gt;&lt;/switchparameter&gt;&lt;/full&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;LiteralPath: Mandatory, Takes full path of
WSP as string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Add-Spsolution
-Literalpath &quot;C:\Solutions\MySolution.wsp&quot; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Install Solution &lt;/strong&gt;- Now solution
is available in farm, next step is to use it. Installing a WSP comes with many
options based on scope (for specific web application or all) and content
(DLL(s) for GAC or files).&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Command:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Install-SPSolution
-Identity &lt;name of=&quot;of&quot; solution=&quot;solution&quot;&gt; -GACDeployment&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Install-SPSolution
-Identity &lt;name of=&quot;of&quot; solution=&quot;solution&quot;&gt; -AllWebApplication -GACDeployment&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Install-SPSolution
-Identity &lt;name of=&quot;of&quot; solution=&quot;solution&quot;&gt; -WebApplication &lt;web application=&quot;application&quot; url=&quot;url&quot;&gt; -GACDeployment&lt;/web&gt;&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Identity: Required, Full name/GUID of WSP as
string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;AllWebapplications: Optional, If WSP to be
used by all webapplications in farm&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;WebApplication: Optional, If WSP is for
specific web application, URL as string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;GACDeployment: Optional, If WSP includes some
DLL to GAC&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Force: this parameter can be used if
installation is throwing some error due to feature activation or time job
issue.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Install-SPSolution
-Identity &quot;MySolution.wsp&quot; -GACDeployment&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Install-SPSolution
-Identity &quot;MySolution.wsp&quot; -AllWebApplication -GACDeployment&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Install-SPSolution
-Identity &quot;MySolution.wsp&quot; -WebApplication &quot;&lt;/span&gt;&lt;a href=&quot;http://apps-d207.moss.unilever.com/&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;http://mysite.mydomain.com/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot; -GACDeployment&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Upgrade a deployed Solution&lt;/strong&gt;-
Your solution package (WSP) is already deployed and installed; now you did some
changes in code and want to deploy the latest, here comes Update-SPSolution.
This command will upgrade the deployed solution with latest DLL(s) and files.&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Command:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Update-SPSolution
-Identity &lt;name of=&quot;of&quot; solution=&quot;solution&quot;&gt; -LiteralPath &lt;full of=&quot;of&quot; path=&quot;path&quot; wsp=&quot;wsp&quot;&gt;
-GACDeployment&lt;/full&gt;&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Identity: Required, Full name/GUID of WSP as
string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;LiteralPath: Mandatory, Takes full path of
WSP as string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;GACDeployment: Optional, If WSP includes some
DLL to GAC&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Force: this parameter can be used if
installation is throwing some error due to feature activation or time job
issue.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Update-SPSolution
-Identity MySolution.wsp -LiteralPath &quot;C:\Solutions\MySolution.wsp&quot;
-GACDeployment&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Deployment Rollback: &lt;/strong&gt;There are
scenarios where we may need to rollback the deployment; If the deployment
caused some major issue in farm/application or you added a big component
(i.e.-site/list definition) in you solution and want a fresh deployment. To
rollback a deployment, first retract/uninstall the WSP and then remove it from
farm. &lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Retract Solution &lt;/strong&gt;- Similar to
installation, uninstalling a WSP comes with many options based on scope (for
specific web application or all).&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Command:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Uninstall-SPSolution
-Identity &lt;name of=&quot;of&quot; solution=&quot;solution&quot;&gt; -Confirm &lt;switchparameter&gt;&lt;/switchparameter&gt;&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Uninstall-SPSolution
-Identity &lt;name of=&quot;of&quot; solution=&quot;solution&quot;&gt; -AllWebApplication -Confirm &lt;switchparameter&gt;&lt;/switchparameter&gt;&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Uninstall-SPSolution
-Identity &lt;name of=&quot;of&quot; solution=&quot;solution&quot;&gt; -WebApplication &lt;web application=&quot;application&quot; url=&quot;url&quot;&gt; -Confirm &lt;switchparameter&gt;&lt;/switchparameter&gt;&lt;/web&gt;&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Identity: Required, Full name/GUID of WSP as
string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;AllWebapplications: Required, If WSP to be
retracted from all webapplications in farm&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;WebApplication: Required, If WSP is for
specific web application, URL as string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Uninstall-SPSolution
-Identity &quot;MySolution.wsp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Uninstall-SPSolution
-Identity &quot;MySolution.wsp&quot; -AllWebApplication -Confirm:$false&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Uninstall-SPSolution
-Identity &quot;MySolution.wsp&quot; -Webapplication &quot;&lt;/span&gt;&lt;a href=&quot;http://apps-d207.moss.unilever.com/&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;http://mysite.mydomain.com/&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot; -Confirm:$false&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Remove Solution to SharePoint Farm&lt;/strong&gt;-
After retraction, solution can be removed from SharePoint farm solution store.&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Command:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Remove-SPSolution
-Identity &lt;wsp name=&quot;name&quot;&gt; -Confirm&lt;/wsp&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Identity: Required, Full name/GUID of WSP as
string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Remove-SPSolution
&quot;MySolution.wsp&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Remove-SPSolution
-Identity &quot;Unilever.Global.CDF.wsp&quot; -Confirm:$false&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;SPFeature Operations:&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Install/Uninstall Features in SharePoint
Farm&lt;/strong&gt;- Normally feature installation/un-installation are taken care
with SPSolution operations which contains the feature. But we come across
situations where features needs to be Installed/Uninstalled separately. Below
are the commands and examples.&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Install Feature Command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Install-SPFeature -Path
&lt;string path=&quot;path&quot;&gt; -Force &lt;switchparameter&gt; -Confirm
&lt;switchparameter&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/switchparameter&gt;&lt;/switchparameter&gt;&lt;/string&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Path: Mandatory, Takes relative path from the
folder “$env:ProgramFiles\Common Files\Microsoft Shared\Web Server
Extensions\14\TEMPLATE\FEATURES\” to the feature as string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation ($true/$false)&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Force: Optional, this parameter can be used for
force installation.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-bidi-language: HI; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Install-SPFeature -Path &quot;MyFeature&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-bidi-language: HI; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Un-Install Feature Command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Uninstall-SPFeature
-Path &lt;string path=&quot;path&quot;&gt; -Force &lt;switchparameter&gt; -Confirm
&lt;switchparameter&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/switchparameter&gt;&lt;/switchparameter&gt;&lt;/string&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Path: Mandatory, Takes relative path from the
folder “$env:ProgramFiles\Common Files\Microsoft Shared\Web Server
Extensions\14\TEMPLATE\FEATURES\” to the feature as string&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation ($true/$false)&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Force: Optional, this parameter can be used
for force operation.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-bidi-language: HI; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Uninstall-SPFeature -Path &quot;MyFeature&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-bidi-language: HI; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;strong&gt;Activate/Deactivate Feature&lt;/strong&gt;-
Below are the commands and examples.&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Activate Feature Command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Enable-SPFeature
–Identity &lt;name guid=&quot;guid&quot; or=&quot;or&quot;&gt; -URL &lt;site url=&quot;url&quot;&gt; Force
&lt;switchparameter&gt; -Confirm &lt;switchparameter&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/switchparameter&gt;&lt;/switchparameter&gt;&lt;/site&gt;&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Identity: Required, Name or GUID of feature
as string&lt;o:p&gt;&lt;/o:p&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;URL: Optional,Site/Web URL depending on
feature scope&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation ($true/$false)&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Force: Optional, this parameter can be used
for force installation.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-bidi-language: HI; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Enable-SPFeature –Identity &quot;MyFeature&quot; -URL &quot;http://mysite.mydomain.com&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-bidi-language: HI; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Deactivate Feature Command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Disable-SPFeature
–Identity &lt;name guid=&quot;guid&quot; or=&quot;or&quot;&gt; -URL &lt;site url=&quot;url&quot;&gt; Force
&lt;switchparameter&gt; -Confirm &lt;switchparameter&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/switchparameter&gt;&lt;/switchparameter&gt;&lt;/site&gt;&lt;/name&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Parameters:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Identity: Required, Name or GUID of feature
as string&lt;o:p&gt;&lt;/o:p&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;URL: Optional,Site/Web URL depending on
feature scope&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Confirm: Optional, Ask for confirmation
before operation ($true/$false)&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;em&gt;Force: Optional, this parameter can be used
for force operation.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 13.5pt;&quot;&gt;
&lt;u&gt;Example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%; mso-bidi-language: HI; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Disable-SPFeature –Identity &quot;MyFeature&quot; -URL &quot;http://mysite.mydomain.com&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/8638985425597730834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2012/10/powershell-solution-deployment.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8638985425597730834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8638985425597730834'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2012/10/powershell-solution-deployment.html' title='PowerShell - Solution deployment simplified'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-3403864963076478083</id><published>2012-09-21T18:43:00.002-07:00</published><updated>2012-09-21T19:20:12.365-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><title type='text'>PowerShell : Start up</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;entry-content&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Windows PowerShell (PS) is a shell scripting, provided by Microsoft. This is 
mainly used for Windows and Server administration. This is very powerful tool 
for administrators. Here we’ll cover basics of PowerShell. Refer &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/aa973757(v=vs.85).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/aa973757(v=vs.85).aspx&lt;/a&gt; for 
more details.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;In this post I would give a start-up that how PowerShell is used for 
SharePoint.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;Start: &lt;/strong&gt;Assuming PowerShell is installed on your machine. 
Open the PS (PowerShell) console. [Start-&amp;gt; All Programs-&amp;gt;Accessories -&amp;gt; 
Windows PowerShell]&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Type &lt;strong&gt;Dir&lt;/strong&gt; on blue console and enter-&amp;gt; Enter : It will show 
your directory information. Similarly we can do all kind of windows activities 
from this console. PS is packaged with large number of &lt;strong&gt;cmdlets&lt;/strong&gt;, 
which are light weight commands to perform different activities, check &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/ms714395(v=vs.85).aspx&lt;/a&gt;  
and &lt;a href=&quot;http://technet.microsoft.com/en-us/scriptcenter/dd772285.aspx&quot;&gt;http://technet.microsoft.com/en-us/scriptcenter/dd772285.aspx&lt;/a&gt;  
for details on PS cmdlets.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;So now we know what PowerShell is and how to use it. Now, how to use this for 
SharePoint? SharePoint cmdlets are available in a snap in which should be added 
to Windows PS first to use it.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Type below command on console and enter [on SharePoint server]:&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Add-PSSnapin Microsoft.SharePoint.PowerShell&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Now, we are all set..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Enter &lt;strong&gt;Get-SPSite&lt;/strong&gt; on console, hit Enter and you’ll get list 
of all the site collections available in your SP Farm.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Some important points:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;1. SharePoint 2010 Management Shell is a PS console for SP packaged and 
installed with SP2010 and can be used directly, no additional snap-in 
required.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;2. Login account need appropriate permissions on SP Server and SP Databases 
to execute cmdlets/scripts.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;It’s just a beginning..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #339966;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Happy scripting :)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;!-- .entry-content --&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/3403864963076478083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2012/09/powershell-start-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/3403864963076478083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/3403864963076478083'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2012/09/powershell-start-up.html' title='PowerShell : Start up'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-8204989943382717929</id><published>2012-05-12T09:49:00.000-07:00</published><updated>2012-05-12T09:59:00.716-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><title type='text'>SharePoint Incoming Email Configuration - PowerShell</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;PowerShell is a strong windows shell scripting, which is widely used in SharePoint 2010.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Here I am sharing small and useful scripts we use for SharePoint Farm administration.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Requirement:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;Configure Incoming Email settings in SharePoint farm&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&lt;b&gt;Script:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;# *******************************************************************&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;## Function - Configure Incoming Email settings in SharePoint farm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;## Author - Deepak Solanki&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;## Checks to ensure that Microsoft.SharePoint.Powershell is loaded, if not, adding pssnapin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;## Configure Incoming Email settings in SharePoint farm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;# ********************************************************************&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;#Add SharePoint Add-ins&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;# if snapin is not installed then use this method&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;[Void][System.Reflection.Assembly]::LoadWithPartialName(&quot;Microsoft.SharePoint&quot;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;Write-Host &quot;Script started to Configure Incoming Email.&quot;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; #Variables to get config values&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;[boolean]$Enabled = $true;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;[boolean]$UseAutomaticSettings = $false;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp;[boolean]$UseDirectoryManagementService = $true;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[boolean]$RemoteDirectoryManagementService = $false;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$ServerAddress = &quot;EXCHANGE.DOMAIN.COM&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[boolean]$DLsRequireAuthenticatedSenders = $true;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;[boolean]$DistributionGroupsEnabled = $true;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$ServerDisplayAddress = &quot;sharepoint.company.com&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$DropFolder = &quot;c:\inetpub\mailroot\drop&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#Test the drop folder location exists before proceeding with any changes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$dropLocationTest = Get-Item $DropFolder -ErrorAction SilentlyContinue&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if ($dropLocationTest -eq $null)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Throw &quot;The drop folder location $DropFolder does not exist - please create the path and try the script again.&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; #Configuring Incoming E-mail Settings&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; try&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$type = &quot;Microsoft SharePoint Foundation Incoming E-Mail&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$svcinstance = Get-SPServiceInstance | where { $_.TypeName -eq $type}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$inmail = $svcinstance.Service&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if ($inmail -ne $null)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Write-Log &quot;Configuring Incoming E-mail Settings.&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#Enable sites on this server to receive e-mail&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.Enabled = $Enabled&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#Automatic Settings mode&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.UseAutomaticSettings = $UseAutomaticSettings&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#Use the SharePoint Directory Management Service to create distribution groups&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.UseDirectoryManagementService = $UseDirectoryManagementService&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#Use remote: Directory Management Service&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.RemoteDirectoryManagementService = $RemoteDirectoryManagementService&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;#SMTP mail server for incoming mail&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.ServerAddress = $ServerAddress&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#Accept messages from authenticated users only&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.DLsRequireAuthenticatedSenders = $DLsRequireAuthenticatedSenders&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#Allow creation of distribution groups from SharePoint sites&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.DistributionGroupsEnabled = $DistributionGroupsEnabled&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#E-mail server display address&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.ServerDisplayAddress = $ServerDisplayAddress&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#E-mail drop folder&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $inmail.DropFolder = $DropFolder; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 19px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$inmail.Update();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Write-Host &quot;Incoming E-mail Settings completed.&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; #Report if there is a problem setting Incoming Email&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&amp;nbsp; &amp;nbsp; catch { Write-Host &quot;There was a problem setting Incoming Email: $_&quot; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/8204989943382717929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2012/05/sharepoint-incoming-email-configuration.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8204989943382717929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8204989943382717929'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2012/05/sharepoint-incoming-email-configuration.html' title='SharePoint Incoming Email Configuration - PowerShell'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-8413206060420072976</id><published>2012-05-12T07:14:00.000-07:00</published><updated>2012-05-12T07:33:20.452-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PowerShell"/><title type='text'>SharePoint Diagnostic Configuration - PowerShell</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;PowerShell is a strong windows shell scripting, which is widely used in SharePoint 2010.&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Here I am sharing small and useful scripts we use for SharePoint Farm administration.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Requirement:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Setting SharePoint Diagnostic and logging configuration.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Script:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;# *******************************************************************&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;## Function - Configure Diagnostic Setting in SharePoint Farm&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;## Author - Deepak Solanki&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;## Checks to ensure that Microsoft.SharePoint.Powershell is loaded, if not, adding pssnapin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;## Check log file location exists before proceeding with changes&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;## Reset all log levels to default&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;## Change Trace Log settings&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;# ********************************************************************&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#Add SharePoint Add-ins&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Add-PSSnapin Microsoft.SharePoint.PowerShell -erroraction SilentlyContinue&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;# if snapin is not installed then use this method&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;[Void][System.Reflection.Assembly]::LoadWithPartialName(&quot;Microsoft.SharePoint&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Write-Log &quot;Script started to Configure SharePoint Diagnostic settings.&quot; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#Reset all log levels to default&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Write-Host &quot;Resetting all log levels to default.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Clear-SPLogLevel&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Write-Host &quot;Reset Completed.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#Declare variable for config values&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$LogLocation = &quot;E:\Logs&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$DaysToKeepLogs =&quot;14&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;[boolean]$LogMaxDiskSpaceUsageEnabled = [Boolean]::Parse(&quot;true&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;$LogDiskSpaceUsageGB = &quot;10&quot;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#Test the log file location exists before proceeding with any changes&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$logLocationTest = Get-Item $LogLocation -ErrorAction SilentlyContinue&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if ($logLocationTest -eq $null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Throw &quot;The log file location $LogLocation does not exist - please create the path and try the script again.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#Trace Log settings&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Write-Host&amp;nbsp;&amp;nbsp;&quot;Starting SharePoint Diagnostic configuration.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; Set-SPDiagnosticConfig -LogLocation $LogLocation `&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -DaysToKeepLogs $DaysToKeepLogs `&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -LogMaxDiskSpaceUsageEnabled:$LogMaxDiskSpaceUsageEnabled `&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -LogDiskSpaceUsageGB $LogDiskSpaceUsageGB&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;#Report if there is a problem stopping the service instance&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;catch {&amp;nbsp;
Write-Host&amp;nbsp;&amp;nbsp;&quot;There was a problem in diagnostic setting: $_&quot; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Write-Host&amp;nbsp;&amp;nbsp;&quot;Diagnostic settings changed successfully.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/8413206060420072976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2012/05/sharepoint-diagnostic-configuration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8413206060420072976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8413206060420072976'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2012/05/sharepoint-diagnostic-configuration.html' title='SharePoint Diagnostic Configuration - PowerShell'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-8394230180302793597</id><published>2011-04-15T03:17:00.000-07:00</published><updated>2011-04-15T04:12:52.727-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><title type='text'>Access Active Directory in .NET</title><content type='html'>During one of my client requirements, I played a lot with active directory to display user data in a web application from active directory.&lt;br /&gt;&lt;br /&gt;Here goes a generic class with some functions to get get user information from active directory:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0011;&quot;&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.DirectoryServices;&lt;br /&gt;using System.Collections;&lt;br /&gt;&lt;br /&gt;namespace Common&lt;br /&gt;{&lt;br /&gt;   public class ActiveDirectory&lt;br /&gt;   {&lt;br /&gt;       string domainPath = &quot;GC://YourGC/DC=YourDomain,dc=YourOU,dc=com&quot;;&lt;br /&gt;&lt;br /&gt;       //Get Single user info&lt;br /&gt;       public DataTable GetUserInfo(string sLogonName)&lt;br /&gt;       {&lt;br /&gt;           /*Getting user data from active directory*/&lt;br /&gt;           DirectoryEntry entry = new DirectoryEntry(domainPath);&lt;br /&gt;           DirectorySearcher searcher = new DirectorySearcher(entry);&lt;br /&gt;           searcher.Filter = &quot;(&amp;amp;(objectClass=user)(sAMAccountName=&quot; + sLogonName + &quot;))&quot;;&lt;br /&gt;           SearchResult result = searcher.FindOne();           &lt;br /&gt;          &lt;br /&gt;           /*Creating a datatable to store user data*/&lt;br /&gt;           DataTable resultTable = new DataTable(&quot;UserData&quot;);           &lt;br /&gt;           resultTable.Columns.Add(&quot;givenname&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;sn&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;title&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;telephoneNumber&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;company&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;mail&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;department&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;manager&quot;);&lt;br /&gt;&lt;br /&gt;           DataRow resultRow = resultTable.NewRow();&lt;br /&gt;&lt;br /&gt;           if (result.Properties.Count &amp;gt; 0)&lt;br /&gt;           {&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;givenname&quot;] = result.Properties[&quot;givenname&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;givenname&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;sn&quot;] = result.Properties[&quot;sn&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;sn&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;title&quot;] = result.Properties[&quot;title&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;title&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;telephoneNumber&quot;] = result.Properties[&quot;telephoneNumber&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;telephoneNumber&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;company&quot;] = result.Properties[&quot;company&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;company&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;mail&quot;] = result.Properties[&quot;mail&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;mail&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;department&quot;] = result.Properties[&quot;department&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;department&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               try&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;manager&quot;] = result.Properties[&quot;manager&quot;][0].ToString();&lt;br /&gt;               }&lt;br /&gt;               catch (Exception)&lt;br /&gt;               {&lt;br /&gt;                   resultRow[&quot;manager&quot;] = string.Empty;&lt;br /&gt;               }&lt;br /&gt;               resultTable.Rows.Add(resultRow);&lt;br /&gt;           }&lt;br /&gt;           else&lt;br /&gt;           {&lt;br /&gt;&lt;br /&gt;           }&lt;br /&gt;           return resultTable;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       //Get all domain users multiple properties in data table&lt;br /&gt;       public DataTable GetAllUserInfo()&lt;br /&gt;       {&lt;br /&gt;           /*Getting user data from active directory*/&lt;br /&gt;           DirectoryEntry entry = new DirectoryEntry(domainPath);&lt;br /&gt;           DirectorySearcher searcher = new DirectorySearcher(entry);           &lt;br /&gt;           searcher.PageSize = 1000;&lt;br /&gt;          &lt;br /&gt;           searcher.Filter = &quot;(&amp;amp;(objectClass=user)(objectCategory=person))&quot;; //to get users only&lt;br /&gt;           SearchResultCollection resultCollection = searcher.FindAll();&lt;br /&gt;&lt;br /&gt;           /*Creating a datatable to store user data*/&lt;br /&gt;           DataTable resultTable = new DataTable(&quot;UserData&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;givenname&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;sn&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;title&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;telephoneNumber&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;company&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;mail&quot;);&lt;br /&gt;           resultTable.Columns.Add(&quot;department&quot;);           &lt;br /&gt;                      &lt;br /&gt;           SearchResult result;&lt;br /&gt;           if (resultCollection != null)&lt;br /&gt;           {&lt;br /&gt;               for (int counter = 0; counter &amp;lt; resultCollection.Count; counter++)&lt;br /&gt;               {&lt;br /&gt;                   DataRow resultRow = resultTable.NewRow();&lt;br /&gt;&lt;br /&gt;                   result = resultCollection[counter];&lt;br /&gt;                   if (result.Properties.Contains(&quot;givenname&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       resultRow[&quot;givenname&quot;] = result.Properties[&quot;givenname&quot;][0].ToString();&lt;br /&gt;                   }&lt;br /&gt;                   if (result.Properties.Contains(&quot;sn&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       resultRow[&quot;sn&quot;] = result.Properties[&quot;sn&quot;][0].ToString();&lt;br /&gt;                   }&lt;br /&gt;                   if (result.Properties.Contains(&quot;title&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       resultRow[&quot;title&quot;] = result.Properties[&quot;title&quot;][0].ToString();&lt;br /&gt;                   }&lt;br /&gt;                   if (result.Properties.Contains(&quot;telephoneNumber&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       resultRow[&quot;telephoneNumber&quot;] = result.Properties[&quot;telephoneNumber&quot;][0].ToString();&lt;br /&gt;                   }&lt;br /&gt;                   if (result.Properties.Contains(&quot;company&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       resultRow[&quot;company&quot;] = result.Properties[&quot;company&quot;][0].ToString();&lt;br /&gt;                   }&lt;br /&gt;                   if (result.Properties.Contains(&quot;mail&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       resultRow[&quot;mail&quot;] = result.Properties[&quot;mail&quot;][0].ToString();&lt;br /&gt;                   }&lt;br /&gt;                   if (result.Properties.Contains(&quot;department&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       resultRow[&quot;department&quot;] = result.Properties[&quot;department&quot;][0].ToString();&lt;br /&gt;                   }&lt;br /&gt;                   resultTable.Rows.Add(resultRow);&lt;br /&gt;               }&lt;br /&gt;           }        &lt;br /&gt;           return resultTable;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;       //Get all domain users single property in array list&lt;br /&gt;       public ArrayList GetAllADDomainUsers()&lt;br /&gt;       {&lt;br /&gt;           ArrayList allUsers = new ArrayList();&lt;br /&gt;&lt;br /&gt;           DirectoryEntry searchRoot = new DirectoryEntry(domainPath);&lt;br /&gt;           DirectorySearcher search = new DirectorySearcher(searchRoot);&lt;br /&gt;           search.Filter = &quot;(&amp;amp;(objectClass=user)(objectCategory=person))&quot;;&lt;br /&gt;        &lt;br /&gt;           SearchResult result;&lt;br /&gt;           SearchResultCollection resultCol = search.FindAll();&lt;br /&gt;           if (resultCol != null)&lt;br /&gt;           {&lt;br /&gt;               for (int counter = 0; counter &amp;lt; resultCol.Count; counter++)&lt;br /&gt;               {&lt;br /&gt;                   result = resultCol[counter];                &lt;br /&gt;                   if (result.Properties.Contains(&quot;samaccountname&quot;))&lt;br /&gt;                   {&lt;br /&gt;                       allUsers.Add((String)result.Properties[&quot;samaccountname&quot;][0]);                      &lt;br /&gt;                   }&lt;br /&gt;               }&lt;br /&gt;           }&lt;br /&gt;           return allUsers;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Coding!!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/8394230180302793597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/access-active-directory-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8394230180302793597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8394230180302793597'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/access-active-directory-in-net.html' title='Access Active Directory in .NET'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-996887657054094974</id><published>2011-04-13T04:54:00.000-07:00</published><updated>2011-04-13T04:58:30.793-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><title type='text'>Error &amp; information logging; event viewer or text file</title><content type='html'>We can log different errors or information while writing code for any .NET application, here is a generic class written for logging:&lt;br /&gt;&lt;br /&gt;Code:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Diagnostics;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Security.Permissions;&lt;br /&gt;&lt;br /&gt;namespace Common&lt;br /&gt;{&lt;br /&gt;    /*This Class is used for logging messages to either a custom EventViewer or in a plain text file located on web server.&lt;br /&gt;     * Owner : Deepak Solanki&lt;br /&gt;     * Year : 2011 */&lt;br /&gt;&lt;br /&gt;    public class Logging&lt;br /&gt;    {&lt;br /&gt;        #region &quot;Variables&quot;&lt;br /&gt;&lt;br /&gt;        private string sLogFormat;&lt;br /&gt;        private string sErrorTime;&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        #region &quot;Local methods&quot;        &lt;br /&gt;&lt;br /&gt;        /* Write to Txt Log File*/ &lt;br /&gt;        public void WriteToLogFile(string sErrMsg)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                //sLogFormat used to create log format :&lt;br /&gt;                // dd/mm/yyyy hh:mm:ss AM/PM ==&gt; Log Message&lt;br /&gt;                sLogFormat = DateTime.Now.ToShortDateString().ToString() + &quot; &quot; + DateTime.Now.ToLongTimeString().ToString() + &quot; ==&gt; &quot;;&lt;br /&gt;&lt;br /&gt;                //this variable used to create log filename format &quot;&lt;br /&gt;                //for example filename : ErrorLogYYYYMMDD&lt;br /&gt;                string sYear = DateTime.Now.Year.ToString();&lt;br /&gt;                string sMonth = DateTime.Now.Month.ToString();&lt;br /&gt;                string sDay = DateTime.Now.Day.ToString();&lt;br /&gt;                sErrorTime = sYear + sMonth + sDay;&lt;br /&gt;&lt;br /&gt;                //writing to log file&lt;br /&gt;                string sPathName = &quot;C:\\Logs\\ErrorLog&quot; + sErrorTime;&lt;br /&gt;                StreamWriter sw = new StreamWriter(sPathName + &quot;.txt&quot;, true);&lt;br /&gt;                sw.WriteLine(sLogFormat + sErrMsg);&lt;br /&gt;                sw.Flush();&lt;br /&gt;                sw.Close();&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                WriteToEventLog(&quot;MySite&quot;, &quot;Logging.WriteToLogFile&quot;, &quot;Error: &quot; + ex.ToString(), EventLogEntryType.Error);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        /* Write to Event Log*/&lt;br /&gt;        public void WriteToEventLog(string sLog, string sSource, string message, EventLogEntryType level)&lt;br /&gt;        {&lt;br /&gt;            //RegistryPermission regPermission = new RegistryPermission(PermissionState.Unrestricted);&lt;br /&gt;            //regPermission.Assert();&lt;br /&gt;&lt;br /&gt;            if (!EventLog.SourceExists(sSource))&lt;br /&gt;                EventLog.CreateEventSource(sSource, sLog);&lt;br /&gt;&lt;br /&gt;            EventLog.WriteEntry(sSource, message, level);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Happy Coding!!!</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/996887657054094974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/error-information-logging-event-viewer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/996887657054094974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/996887657054094974'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/error-information-logging-event-viewer.html' title='Error &amp; information logging; event viewer or text file'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-896568645873419633</id><published>2011-04-13T04:10:00.000-07:00</published><updated>2011-04-13T04:45:28.395-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Web Parts"/><title type='text'>Web part to show data from list</title><content type='html'>Requirement is to show news on web page, data saved in custom list . A webpart to get data from list and show on page:&lt;br /&gt;&lt;br /&gt;1. Open Visual Studio and create a class file or webpart (if sharepoint extension is there with VS.&lt;br /&gt;2. Code of ShowNews.cs file below:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Runtime.InteropServices;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Xml.Serialization;&lt;br /&gt;using System.Drawing;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;using Microsoft.SharePoint.WebPartPages;&lt;br /&gt;&lt;br /&gt;namespace MyWebParts&lt;br /&gt;{&lt;br /&gt; [Guid(&quot;6e1a7cf2-bf98-4926-81c9-0c0184ba6a60&quot;)]&lt;br /&gt; public class ShowNews : System.Web.UI.WebControls.WebParts.WebPart&lt;br /&gt; {&lt;br /&gt;&lt;br /&gt;     //Controls&lt;br /&gt;     private Label lblTitle;&lt;br /&gt;     private Label lblNews;     &lt;br /&gt;&lt;br /&gt;     // A table that is used to layout the controls&lt;br /&gt;     private Table tbMain;&lt;br /&gt;     private TableRow tRow;&lt;br /&gt;     private TableCell tCell;&lt;br /&gt;&lt;br /&gt;     #region &quot;Web Part Properties&quot;&lt;br /&gt;&lt;br /&gt;     private const string defaultSiteCollection = &quot;NewTeamSite&quot;;&lt;br /&gt;     private string _siteName = defaultSiteCollection;&lt;br /&gt;     [Personalizable(PersonalizationScope.Shared), WebBrowsable(true),&lt;br /&gt;     WebDisplayName(&quot;Site Name&quot;),&lt;br /&gt;     WebDescription(&quot;Site from where to fetch News&quot;)]&lt;br /&gt;&lt;br /&gt;     public string SiteName&lt;br /&gt;     {&lt;br /&gt;         get { return this._siteName; }&lt;br /&gt;         set { this._siteName = value; }&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     private const string defaultList = &quot;News&quot;;&lt;br /&gt;     private string _listName = defaultList;&lt;br /&gt;     [Personalizable(PersonalizationScope.Shared), WebBrowsable(true),&lt;br /&gt;     WebDisplayName(&quot;List Name&quot;),&lt;br /&gt;     WebDescription(&quot;List from where to fetch News&quot;)]&lt;br /&gt;&lt;br /&gt;     public string ListName&lt;br /&gt;     {&lt;br /&gt;         get { return this._listName; }&lt;br /&gt;         set { this._listName = value; }&lt;br /&gt;     }&lt;br /&gt;     #endregion&lt;br /&gt;&lt;br /&gt;     public ShowNews()&lt;br /&gt;     {&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     protected override void CreateChildControls()&lt;br /&gt;     {&lt;br /&gt;         base.CreateChildControls();&lt;br /&gt;&lt;br /&gt;         // TODO: add custom rendering code here.&lt;br /&gt;         tbMain = new Table();&lt;br /&gt;         tbMain.BorderStyle = BorderStyle.Double;&lt;br /&gt;         tbMain.BorderColor = Color.Silver;&lt;br /&gt;         tbMain.BackColor = Color.WhiteSmoke;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;         lblTitle = new Label();&lt;br /&gt;         lblTitle.Text = &quot;News&quot;;&lt;br /&gt;         lblTitle.Font.Bold = true;&lt;br /&gt;&lt;br /&gt;         tRow = new TableRow();&lt;br /&gt;         tCell = new TableCell();         &lt;br /&gt;         tCell.VerticalAlign = VerticalAlign.Top;&lt;br /&gt;         tCell.HorizontalAlign = HorizontalAlign.Center;&lt;br /&gt;         tCell.Controls.Add(lblTitle);&lt;br /&gt;         tRow.Controls.Add(tCell);&lt;br /&gt;         tbMain.Controls.Add(tRow);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;         lblNews = new Label();&lt;br /&gt;         lblNews.Text = &quot;Blank&quot;;      &lt;br /&gt;      &lt;br /&gt;         tRow = new TableRow();&lt;br /&gt;         tCell = new TableCell();&lt;br /&gt;         tCell.VerticalAlign = VerticalAlign.Top;&lt;br /&gt;         tCell.HorizontalAlign = HorizontalAlign.Left;&lt;br /&gt;         tCell.Controls.Add(lblNews);&lt;br /&gt;         tRow.Controls.Add(tCell);&lt;br /&gt;         tbMain.Controls.Add(tRow);&lt;br /&gt;&lt;br /&gt;         this.Controls.Add(tbMain);&lt;br /&gt;&lt;br /&gt;         CreateNewsHtml();&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     private void CreateNewsHtml()&lt;br /&gt;     {&lt;br /&gt;         SPList newsList;&lt;br /&gt;         SPListItemCollection listitemcoll;&lt;br /&gt;&lt;br /&gt;         try&lt;br /&gt;         {&lt;br /&gt;             using (SPSite site = new SPSite(this.Context.Request.Url.ToString()))&lt;br /&gt;             {                 &lt;br /&gt;                 using (SPWeb web = site.AllWebs[this._siteName])&lt;br /&gt;                 {&lt;br /&gt;                    newsList =web.Lists[this._listName];&lt;br /&gt;                    listitemcoll = newsList.Items;&lt;br /&gt;                    if (newsList.ItemCount &amp;gt; 0)&lt;br /&gt;                        foreach(SPListItem item in listitemcoll)&lt;br /&gt;                         {&lt;br /&gt;                             lblTitle.Text = item[&quot;Title&quot;].ToString();&lt;br /&gt;                             lblNews.Text = item[&quot;News&quot;].ToString();&lt;br /&gt;                         }&lt;br /&gt;                  &lt;br /&gt;                 }&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;         catch (Exception ex)&lt;br /&gt;         {&lt;br /&gt;        &lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3. Create ShowNews.webpart file (get created itself with Sharepoint extension)&lt;br /&gt;&lt;br /&gt;&lt;span tyle=&quot;color: #ff0000;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;br /&gt;&amp;lt;webParts&amp;gt;&lt;br /&gt;&amp;lt;webPart xmlns=&quot;http://schemas.microsoft.com/WebPart/v3&quot;&amp;gt;&lt;br /&gt; &amp;lt;metaData&amp;gt;  &lt;br /&gt;   &amp;lt;type name=&quot;MyWebparts.ShowNews, ShowNews, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXXXXX&quot; /&amp;gt;&lt;br /&gt;   &amp;lt;importErrorMessage&amp;gt;Cannot import ShowNews Web Part.&amp;lt;/importErrorMessage&amp;gt;&lt;br /&gt; &amp;lt;/metaData&amp;gt;&lt;br /&gt; &amp;lt;data&amp;gt;&lt;br /&gt;   &amp;lt;properties&amp;gt;&lt;br /&gt;     &amp;lt;property name=&quot;Title&quot; type=&quot;string&quot;&amp;gt;ShowNews Web Part&amp;lt;/property&amp;gt;&lt;br /&gt;     &amp;lt;property name=&quot;Description&quot; type=&quot;string&quot;&amp;gt;Show News from List on Page&amp;lt;/property&amp;gt;&lt;br /&gt;&amp;lt;property name=&quot;AllowZoneChange&quot; type=&quot;bool&quot;&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;     &amp;lt;property name=&quot;AllowHide&quot; type=&quot;bool&quot;&amp;gt;True&amp;lt;/property&amp;gt;&lt;br /&gt;   &amp;lt;/properties&amp;gt;&lt;br /&gt; &amp;lt;/data&amp;gt;&lt;br /&gt;&amp;lt;/webPart&amp;gt;&lt;br /&gt;&amp;lt;/webParts&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4. Now, your webpart is ready, deploy it either [1] manually; GAC the DLL, upload webpart file to webpart gallery and made safecontrol entry for webpart in web.config file. or [2] create a deployment package to deploy the webpart.&lt;br /&gt;&lt;br /&gt;Happy Coding!!!</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/896568645873419633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/web-part-to-show-data-from-list-news.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/896568645873419633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/896568645873419633'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/web-part-to-show-data-from-list-news.html' title='Web part to show data from list'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-8285815455717243940</id><published>2011-04-08T04:21:00.000-07:00</published><updated>2011-04-08T05:03:29.821-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><title type='text'>User Control for Tab Navigation</title><content type='html'>While developing a portal we came across a requirement where a tab navigation to be created and added in master page of the site. Here are the simple steps of how to create a tab navigation using ASP MENU control.&lt;br /&gt;&lt;br /&gt;1. Go to your site/project and add a user control as new item.&lt;br /&gt;2. There will be added one .ASCX file and one code file .ASCX.CS&lt;br /&gt;3. We are not using code file here so delete code file (.ascx.cs)&lt;br /&gt;4. Also delete code file reference from &lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;%@ Control&lt;/span&gt; ... directive line (first line in file).&lt;br /&gt;&lt;br /&gt;write the code to add asp menu and SiteMapDataSource&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;code below:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; %&amp;gt;&lt;br /&gt;&amp;lt;div id=&quot;TabDiv&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;    &amp;lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; class=&quot;TabMenuContainer&quot;&amp;gt;&lt;br /&gt;        &amp;lt;tr&amp;gt;&lt;br /&gt;            &amp;lt;td&amp;gt;&lt;br /&gt;                &amp;lt;asp:Menu CssClass=&quot;TabMenu&quot; DataSourceID=&quot;CampaignPortalSiteMap&quot; HideSelectElements=&quot;True&quot;&lt;br /&gt;                    ID=&quot;Menu2&quot; Orientation=&quot;Horizontal&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;                    &amp;lt;StaticSelectedStyle CssClass=&quot;TabMenuItemSelected&quot; /&amp;gt;&lt;br /&gt;                    &amp;lt;StaticMenuItemStyle CssClass=&quot;TabMenuItem&quot; /&amp;gt;&lt;br /&gt;                    &amp;lt;StaticMenuStyle CssClass=&quot;SiteStaticMenu&quot; /&amp;gt;&lt;br /&gt;                    &amp;lt;StaticHoverStyle CssClass=&quot;TabMenuItemHover&quot; /&amp;gt;&lt;br /&gt;                    &amp;lt;DataBindings&amp;gt;&lt;br /&gt;                        &amp;lt;asp:MenuItemBinding DataMember=&quot;SiteMapNode&quot; Depth=&quot;0&quot; NavigateUrlField=&quot;Url&quot; TextField=&quot;Title&quot;&lt;br /&gt;                            ToolTipField=&quot;Description&quot; /&amp;gt;&lt;br /&gt;                    &amp;lt;/DataBindings&amp;gt;&lt;br /&gt;                &amp;lt;/asp:Menu&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;            &amp;lt;td class=&quot;TabMenuSpacer&quot; width=&quot;100%&quot;&amp;gt;&lt;br /&gt;            &amp;lt;/td&amp;gt;&lt;br /&gt;        &amp;lt;/tr&amp;gt;&lt;br /&gt;    &amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;asp:SiteMapDataSource ID=&quot;CampaignPortalSiteMap&quot; runat=&quot;server&quot; ShowStartingNode=&quot;false&quot;&lt;br /&gt;    SiteMapProvider=&quot;PortalSiteMap&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the code above:&lt;br /&gt;ASP Menu control create navigation, it takes either a sitemap source as data source that can be bind to it, or menu items (statically or through code).&lt;br /&gt;&lt;br /&gt;SiteMapDataSource is the sitemap provider reference, sitemap provider will be specified in web.config file of application.&lt;br /&gt;&lt;br /&gt;There are many CSS classes for styling of tabs, that will be there in application&#39;s CSS file.&lt;br /&gt;&lt;br /&gt;5. Now add the CSS file to define style classes, style sheet below:&lt;br /&gt;&lt;br /&gt;body&lt;br /&gt;{&lt;br /&gt;  font-family: Tahoma;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#MasterContainer&lt;br /&gt;{&lt;br /&gt;  border: solid 1px black;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#BannerContainer&lt;br /&gt;{&lt;br /&gt;  padding: 5px 5px 5px 5px;&lt;br /&gt;  font-weight: bold;&lt;br /&gt;  font-size: large;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.TabMenuContainer&lt;br /&gt;{&lt;br /&gt;  border-top: solid 1px black;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.TabMenuItem&lt;br /&gt;{&lt;br /&gt;  background-color: #FFFFBC;&lt;br /&gt;  text-align:center;&lt;br /&gt;  font-size: xx-small;&lt;br /&gt;  border: solid 1px black;&lt;br /&gt;  border-left: none;&lt;br /&gt;  padding: 3px 3px 3px 3px;&lt;br /&gt;}&lt;br /&gt;.TabMenuItemSelected&lt;br /&gt;{&lt;br /&gt;background-color: White;&lt;br /&gt;text-align:center;&lt;br /&gt;font-size: xx-small;&lt;br /&gt;border-right: solid 1px black;&lt;br /&gt;border-bottom: none;&lt;br /&gt;border-top: none;&lt;br /&gt;border-left: none;&lt;br /&gt;padding: 5px 3px 5px 3px;&lt;br /&gt;}&lt;br /&gt;.TabMenuItemHover&lt;br /&gt;{&lt;br /&gt;  color:Black;&lt;br /&gt;  font-weight: bold;&lt;br /&gt;}&lt;br /&gt;.SiteStaticMenu&lt;br /&gt;{&lt;br /&gt;  margin: -1px 0px 0px 0px;&lt;br /&gt;  background-color: Black;&lt;br /&gt;}&lt;br /&gt;.TabMenuSpacer&lt;br /&gt;{&lt;br /&gt;  background-color: #222222;&lt;br /&gt;  padding: 5px 5px 5px 5px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;#SiteContent&lt;br /&gt;{&lt;br /&gt;  padding: 5px 5px 5px 5px;&lt;br /&gt;  margin: 10px 10px 10px 10px;&lt;br /&gt;  width: 100%; &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.SiteContentSpacer&lt;br /&gt;{&lt;br /&gt;  height: 200px;&lt;br /&gt;  visibility: hidden;&lt;br /&gt;}#FooterContainer&lt;br /&gt;{&lt;br /&gt;  font-size: xx-small;&lt;br /&gt;  border-top: solid 1px black;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Till now we are done with menu control and its look and feel, now we need to define the data source for that menu control.&lt;br /&gt;&lt;br /&gt;6. Open web.config file of web application, go to &lt;sitemap... &gt; section and add a provider that we had specified in used control.&lt;br /&gt;&lt;br /&gt;&amp;lt;providers&amp;gt;&lt;br /&gt; &amp;lt;add name=&quot;PortalSiteMap&quot; type=&quot;System.Web.XmlSiteMapProvider&quot; siteMapFile=&quot;portal.sitemap&quot; /&amp;gt;    &lt;br /&gt;&amp;lt;/providers&amp;gt;&lt;br /&gt;&lt;br /&gt;The last thing left now is to define sitemap file &quot;portal.sitemap&quot; from where asp menu would pick it&#39;s menu items.&lt;br /&gt;&lt;br /&gt;7. Add a new sitemap item in project, naming portal.sitemap and put links, titles... of pages in specified xml format, sitemap xml below:&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;&lt;br /&gt;&amp;lt;siteMap xmlns=&quot;http://schemas.microsoft.com/ AspNet/SiteMap-File-1.0&quot; &amp;gt;&lt;br /&gt; &amp;lt;siteMapNode url=&quot;&quot; title=&quot;&quot;  description=&quot;&quot; roles=&quot;*&quot;&amp;gt;&lt;br /&gt;  &amp;lt;siteMapNode url=&quot;~/Home.aspx&quot; title=&quot;Home&quot; description=&quot;The home page&quot; roles=&quot;*&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;siteMapNode url=&quot;~/default2.aspx&quot; title=&quot;Tab 1&quot;  description=&quot;The first tab&quot; roles=&quot;*&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;siteMapNode url=&quot;~/default.aspx&quot; title=&quot;Google&quot;  description=&quot;Google search&quot; roles=&quot;*&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;siteMapNode url=&quot;http://www.yahoo.com&quot; title=&quot;Yahoo&quot;  description=&quot;Yahoo search&quot; roles=&quot;*&quot; /&amp;gt;&lt;br /&gt; &amp;lt;/siteMapNode&amp;gt;&lt;br /&gt;&amp;lt;/siteMap&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All set now, put this user control on your master page or page, wherever required and navigate...Cheers :-)&lt;br /&gt;&lt;br /&gt;Happy Coding!!!</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/8285815455717243940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/user-control-for-tab-navigation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8285815455717243940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/8285815455717243940'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2011/04/user-control-for-tab-navigation.html' title='User Control for Tab Navigation'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-1422129124905615238</id><published>2011-02-16T23:05:00.000-08:00</published><updated>2011-02-17T01:00:14.350-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Receive repeated logon windows - loopback check in Windows Server 2003</title><content type='html'>It was something which took lots of time and I couldn&#39;t find a valid reason or solution for the problem, finally it turned out as a security feature with Windows Server 2003, that is &lt;span style=&quot;font-weight:bold;&quot;&gt;Loopback check&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;One of my old .NET web applications was hosted on Windows Server 2000, since Microsoft doesn&#39;t support 2000 servers anymore, I had to move my application to 2003 servers. It was a simple web site with windows integrated security. After creating site on new 2003 server, IIS 6, mapping home directory, putting DLLs, components etc in place, tried to browse site from IIS and received repeated logon window, finally ended up with &quot;You are not authorized....&quot;. Tried opening the site in browser (IE) on web server, again same problem. Then on other machine in same network, tried opening the site; no problem, site opened successfully with my windows credentials, it was a great relief. :)&lt;br /&gt;&lt;br /&gt;So, the problem was- i was not able to open the site from host machine but it was opening perfectly on any other machine. Tried many tricks; adding to trusted site, intranet zone..etc.. but nothing worked. Finally, after searching lots of article, reading many MSDN pages, found the MS KB for this.&lt;br /&gt;&lt;br /&gt;There is a security feature with Windows Server 2003 SP1, named loopback check functionality. By default, loopback check functionality is turned on in Windows Server. This cause repeated Login Windows receive. The solution is simple, go in system registry and disable it. &lt;br /&gt;&lt;br /&gt;The loopback check functionality is stored in the following registry subkey:&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\DisableLoopbackCheck&lt;br /&gt;&lt;br /&gt;Here is the KB link for details on reason and solution:&lt;br /&gt;&lt;a href=&quot;http://support.microsoft.com/kb/926642&quot; target = &quot;_blank&quot;&gt;http://support.microsoft.com/kb/926642&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope it works for you..&lt;br /&gt;Cheers!!!!</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/1422129124905615238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2011/02/receive-repeated-logon-windows-loopback.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/1422129124905615238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/1422129124905615238'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2011/02/receive-repeated-logon-windows-loopback.html' title='Receive repeated logon windows - loopback check in Windows Server 2003'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-190559609299078546</id><published>2011-01-22T03:28:00.000-08:00</published><updated>2011-01-22T03:29:46.895-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General Help - Windows"/><title type='text'>Enable Sharing &amp; Security Tab - Windows</title><content type='html'>Sometimes you want to share a folder or to implement\change some security settings or access rights but you wonder, in folder properties, where the Security tab is? It could happen to you even if you have administrator rights. Here are few simple steps to solve the problem.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;So to see and unhide the Security tab, just use the following steps:&lt;br /&gt;&lt;/strong&gt;1. Launch Windows Explorer or My Computer.&lt;br /&gt;2. Click on the Tools at the menu bar, and then click on Folder Options.&lt;br /&gt;3. Click on View tab.&lt;br /&gt;4. In the Advanced Settings section at the bottom of the list, uncheck and unselect (clear the tick) on the “Use simple file sharing (Recommended)” check box.&lt;br /&gt;5. Click OK.&lt;br /&gt;&lt;br /&gt;Security tab is available only to Administrator or users with administrative rights. So make sure you login as one. And security can only be set in an NTFS partition. If you’re still having problem to reveal or display the Security tab on files or folder properties, check out the following registry hack and set the value to 0 or simply delete the key:&lt;br /&gt;Hive: HKEY_CURRENT_USER&lt;br /&gt;Key: Software\Microsoft\windows\CurrentVersion\Policies\Explorer&lt;br /&gt;Name: Nosecuritytab&lt;br /&gt;Type: REG_DWORD&lt;br /&gt;Value: 1&lt;br /&gt;&lt;br /&gt;I hope it works for you..</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/190559609299078546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2011/01/enable-sharing-security-tab-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/190559609299078546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/190559609299078546'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2011/01/enable-sharing-security-tab-windows.html' title='Enable Sharing &amp; Security Tab - Windows'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-2553885128826566590</id><published>2011-01-22T03:26:00.000-08:00</published><updated>2011-01-22T03:28:00.961-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="General Help"/><title type='text'>To take ownership of a file or folder</title><content type='html'>&lt;strong&gt;Take Ownership:&lt;/strong&gt;&lt;br /&gt;Are you not able to access or delete a file\folder from your computer even you are administrator?&lt;br /&gt;Don’t worry; take ownership of that file or folder.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to take ownership of a file&lt;/strong&gt;&lt;br /&gt;You must have ownership of a protected file in order to access it. If another user has restricted access and you are the computer administrator, you can access the file by taking ownership.&lt;br /&gt;&lt;br /&gt;To take ownership of a file, follow these steps:&lt;br /&gt;1. Right-click the file that you want to take ownership of, and then click Properties.&lt;br /&gt;2. Click the Security tab, and then click OK on the Security message (if one appears).&lt;br /&gt;3. Click Advanced, and then click the Owner tab.&lt;br /&gt;4. In the Name list, click Administrator, or click the Administrators group, and then click OK.&lt;br /&gt;&lt;br /&gt;The administrator or the administrators group now owns the file.&lt;br /&gt;&lt;strong&gt;To take ownership of a folder, follow these steps:&lt;br /&gt;&lt;/strong&gt;1. Right-click the folder that you want to take ownership of, and then click Properties.&lt;br /&gt;2. Click the Security tab, and then click OK on the Security message (if one appears).&lt;br /&gt;3. Click Advanced, and then click the Owner tab.&lt;br /&gt;4. In the Name list, click your user name, or click Administrator if you are logged in as Administrator, or click the Administrators group. If you want to take ownership of the contents of the folder, select the Replace owner on subcontainers and objects check box.&lt;br /&gt;5. Click OK, and then click Yes when you receive the following message:&lt;br /&gt;&lt;em&gt;You do not have permission to read the contents of directory folder name. Do you want to replace the directory permissions with permissions granting you Full Control?&lt;br /&gt;&lt;/em&gt;All permissions will be replaced if you click Yes.&lt;br /&gt;&lt;br /&gt;Note folder name is the name of the folder that you want to take ownership of.&lt;br /&gt;Click OK, and then reapply the permissions and security settings that you want for the folder and its contents.</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/2553885128826566590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2011/01/to-take-ownership-of-file-or-folder.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/2553885128826566590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/2553885128826566590'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2011/01/to-take-ownership-of-file-or-folder.html' title='To take ownership of a file or folder'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-5679653770307972834</id><published>2010-02-08T21:31:00.000-08:00</published><updated>2010-02-08T21:48:06.077-08:00</updated><title type='text'>Error - Attempted to perform an unauthorized operation</title><content type='html'>&lt;p&gt;I’ve faced a problem while trying to deploy a webpart created in Visual Studio 2008 with Sharepoint webparts template. I did the coding and build the project without any problem, but when tried to deploy it using visual studio, &lt;strong&gt;Build -&gt; Deploy Solution&lt;/strong&gt;, it had thrown an error &lt;strong&gt;“Attempted to perform an unauthorized operation।”&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvkTd9DkonDuYHe7V_w6O9zRDtn9B4o8uV2iEHujsKqw1Ko4r3WBGnroogDkyol5XW2cfr_W9UedqXVBasPIVIMeTR2ukHtCTUKez5E5r-NrYolfgxMdUvqwkOnmExjVEE6_JpV_10TkY/s1600-h/er1.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5436113457278970018&quot; style=&quot;WIDTH: 320px; CURSOR: hand; HEIGHT: 206px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvkTd9DkonDuYHe7V_w6O9zRDtn9B4o8uV2iEHujsKqw1Ko4r3WBGnroogDkyol5XW2cfr_W9UedqXVBasPIVIMeTR2ukHtCTUKez5E5r-NrYolfgxMdUvqwkOnmExjVEE6_JpV_10TkY/s400/er1.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Reason:&lt;/strong&gt; The possible problem is that you are trying to deploy solution on a site to which you don&#39;t have authorization to deployment.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Check the URL to which you are deploying the solution, by default it is &lt;a href=&quot;http://localphost/&quot;&gt;http://localhost/&lt;/a&gt; , change it to your site where you actually want to deploy the webpart.&lt;br /&gt;Go to the &lt;strong&gt;project properties&lt;/strong&gt; and inside the &lt;strong&gt;debug tab&lt;/strong&gt; select the start action as &lt;strong&gt;&#39;start browser with url&#39; &lt;/strong&gt;and enter the valid site collection URL।&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUl8dE2hBCdGTVvA22eaJyNo08p4TFLqxdZnzZsYGxcDpFoEPMgp6C-RruR-iAJLevZdgu9e5NY_-8ewfp4rT6Tl-sMIBx1C09bkQbpkmLfwIbnxepXRpjDpwuhMxJ8_EFqpJ2bGa9eS4/s1600-h/er2.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5436113589999023058&quot; style=&quot;MARGIN: 0px 0px 10px 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 200px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUl8dE2hBCdGTVvA22eaJyNo08p4TFLqxdZnzZsYGxcDpFoEPMgp6C-RruR-iAJLevZdgu9e5NY_-8ewfp4rT6Tl-sMIBx1C09bkQbpkmLfwIbnxepXRpjDpwuhMxJ8_EFqpJ2bGa9eS4/s400/er2.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Though, there may be different reasons of this error because of any other authorization failure, this is also a main reason. Hope this fix might help.&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/5679653770307972834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/error-attempted-to-perform-unauthorized.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/5679653770307972834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/5679653770307972834'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/error-attempted-to-perform-unauthorized.html' title='Error - Attempted to perform an unauthorized operation'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvkTd9DkonDuYHe7V_w6O9zRDtn9B4o8uV2iEHujsKqw1Ko4r3WBGnroogDkyol5XW2cfr_W9UedqXVBasPIVIMeTR2ukHtCTUKez5E5r-NrYolfgxMdUvqwkOnmExjVEE6_JpV_10TkY/s72-c/er1.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-7120536430907523034</id><published>2010-02-02T23:13:00.000-08:00</published><updated>2010-02-02T23:21:53.884-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Play Media in ASP.NET Site</title><content type='html'>This is one of the basic requirements of a site; you may want to play a media file or a play list (group of media files).  Here are few simple steps to create a web page with media player on it.&lt;br /&gt;&lt;br /&gt;1. Open Visual Studio 2005\2008&lt;br /&gt;2. File -&gt; New -&gt;Website, Give this site a name, like &lt;strong&gt;MySite&lt;/strong&gt;&lt;br /&gt;3. Create a new folder under your site, Right Click on site -&gt; New Folder, name it &lt;strong&gt;Videos&lt;/strong&gt;.&lt;br /&gt;4. Copy all the media files you want to play on site.&lt;br /&gt;5. Create a playlist, Right click on Videos folder -&gt; Add New Item -&gt; Text File -&gt; Name it &lt;strong&gt;Playlist.m3u&lt;/strong&gt;&lt;br /&gt;6. Open the Playlist.m3u file and provide list of files with relative location in this, each file in new line. I.e. - &lt;br /&gt;/MySite/Videos/Evian.wmv&lt;br /&gt;/MySite/Videos/Too_Good.mpeg&lt;br /&gt;7. Now, open the Default.aspx page, and add following code in &amp;lt;div&amp;gt; or &amp;lt;table&amp;gt; as per you site layout:&lt;br /&gt;&lt;span style=&quot;color:#cc0000;&quot;&gt;&lt;strong&gt;&amp;lt;object id=&quot;MediaPlayer1&quot; width=&quot;360&quot; height=&quot;400&quot; classid=&quot;CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95&quot;&lt;br /&gt;codebase=&quot;http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701&quot;&lt;br /&gt;standby=&quot;Loading Microsoft® Windows® Media Player components...&quot; type=&quot;application/x-oleobject&quot;&lt;br /&gt;style=&quot;text-align: center;&quot;&amp;gt;&lt;br /&gt;&amp;lt;param name=&quot;FileName&quot; value=&quot;Videos/Playlist.m3u&quot; /&amp;gt;                   &lt;br /&gt;&amp;lt;param name=&quot;loop&quot; value=&quot;True&quot; /&amp;gt;&lt;br /&gt;&amp;lt;param name=&quot;ShowStatusBar&quot; value=&quot;True&quot; /&amp;gt;&lt;br /&gt;&amp;lt;param name=&quot;DefaultFrame&quot; value=&quot;mainFrame&quot; /&amp;gt;&lt;br /&gt;&amp;lt;param name=&quot;autostart&quot; value=&quot;true&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;8. Save the file and Run this site. It will play the playlist provided.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note-&lt;/strong&gt; if you want to play just a single file in Media Player, just replace the line&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#cc0000;&quot;&gt;&amp;lt;param name=&quot;FileName&quot; value=&quot;Videos/Playlist.m3u&quot; /&amp;gt;&lt;/span&gt;&lt;/strong&gt;                   &lt;br /&gt;With line&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#cc0000;&quot;&gt;&amp;lt;param name=&quot;src&quot; value=&quot;Videos/Too_Good.mpeg&quot; /&amp;gt;&lt;/span&gt;&lt;/strong&gt;                   &lt;br /&gt;&lt;br /&gt;Happy Coding!!!</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/7120536430907523034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/play-media-in-aspnet-site.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7120536430907523034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7120536430907523034'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/play-media-in-aspnet-site.html' title='Play Media in ASP.NET Site'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-5248023008463350611</id><published>2010-02-01T05:31:00.000-08:00</published><updated>2010-02-01T05:40:08.478-08:00</updated><title type='text'>MOSS - Configure E-mail</title><content type='html'>&lt;p&gt;In MOSS site there is built-in functionality for sending\receiving mails for alerts, workflows, events etc. Here are simple steps to configure e-mail on Sharepoint server through Sharepoint Central Administrator.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color:#990000;&quot;&gt;Configure incoming e-mail&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;You can configure incoming e-mail settings so that SharePoint sites accept and archive incoming e-mail. You can also configure incoming e-mail settings so that SharePoint sites can archive e-mail discussions as they happen, save e-mailed documents, and show e-mailed meetings on site calendars. In addition, you can configure the SharePoint Directory Management Service to provide support for e-mail distribution list creation and management.&lt;br /&gt;To enable incoming e-mail by using automatic mode, you must install the Internet Information Services (IIS) Simple Mail Transfer Protocol (SMTP) server.&lt;br /&gt;By specifying a drop folder, you can enable incoming e-mail by not using an SMTP server.&lt;br /&gt;1. On the top navigation bar, click Operations.&lt;br /&gt;2. On the Operations page, in the Topology and Services section, click Incoming e-mail settings.&lt;br /&gt;3. If you want to enable sites on this server to receive e-mail, on the Incoming E-mail Settings page, in the Enable Incoming E-Mail section, select Yes.&lt;br /&gt;4. Select either the Automatic or the Advanced settings mode.&lt;br /&gt;If you select Advanced, you can specify a drop folder instead of using an SMTP server.&lt;br /&gt;1. If you want to connect to the SharePoint Directory Management Service, in the Directory Management Service section, select Yes.&lt;br /&gt;You can connect to the SharePoint Directory Management Service for SharePoint sites to manage e-mail addresses in SharePoint lists.&lt;br /&gt;1. In the Directory Management Service URL box, type the URL of the SharePoint Directory Management Service.&lt;br /&gt;2. In the E-mail server display address box, type the e-mail server name (for example, mail.sharepoint.fabrikam.com).&lt;br /&gt;3. Answer the following two questions by selecting Yes or No:&lt;br /&gt;· Does the Directory Management Service manage distribution lists?&lt;br /&gt;· Should distribution lists accept mail only from authenticated senders?&lt;br /&gt;4. In the Incoming E-Mail Server Display Address section, type a display name for the e-mail server (for example, mail.fabrikam.com) in the E-mail server display address box.&lt;br /&gt;Tip You can specify the e-mail server address that is displayed when users create an incoming e-mail address for a list or group. Use this setting in conjunction with the SharePoint Directory Management Service to provide an e-mail server address that is more user-friendly.&lt;br /&gt;1. In the Safe E-Mail Servers section, select one of the following options:&lt;br /&gt;· Accept mail from all e-mail servers&lt;br /&gt;· Accept mail from these safe e-mail servers. If you select this option, type the IP addresses (one per line) of the e-mail servers that you want to specify as safe in the corresponding box.&lt;br /&gt;2. In the E-mail Drop Folder section, in the E-mail drop folder box, type the name of the folder in which Microsoft Windows SharePoint Services polls for incoming e-mail from the Windows SMTP Service.&lt;br /&gt;This option is available only if you selected advanced mode.&lt;br /&gt;Click OK.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#990000;&quot;&gt;&lt;u&gt;Configure outgoing e-mail settings&lt;/u&gt;&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;&lt;p&gt;You can configure outgoing e-mail settings so that your Simple Mail Transfer Protocol (SMTP) server sends e-mail alerts to site users and notifications to site administrators. You can configure both the &quot;From&quot; e-mail address and the &quot;Reply&quot; e-mail address that appear in outgoing alerts.&lt;br /&gt;Configure outgoing e-mail&lt;br /&gt;&lt;strong&gt;Configure default outgoing e-mail settings&lt;/strong&gt;&lt;br /&gt;Configuring the default outgoing e-mail settings configures the default outgoing e-mail settings for all Web applications.&lt;br /&gt;1. On the top navigation bar, click Operations.&lt;br /&gt;2. On the Operations page, click Outgoing e-mail settings in the Topology and Services section.&lt;br /&gt;3. On the Outgoing E-Mail Settings page, in the Mail Settings section, type the Simple Mail Transfer Protocol (SMTP) server name for outbound e-mail (for example, mail.example.com) in the Outbound SMTP server box.&lt;br /&gt;4. In the From address text box, type the from address as you want it to appear to e-mail recipients.&lt;br /&gt;5. In the Reply-to address box, type the e-mail address to which you want e-mail recipients to reply.&lt;br /&gt;6. In the Character set menu, select the character set appropriate for your language.&lt;br /&gt;7. Click OK. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Configure outgoing e-mail settings for a Web application&lt;/strong&gt;&lt;br /&gt;You can override a Web application&#39;s default settings for outgoing e-mail.&lt;br /&gt;1. On the top navigation bar, click Application Management.&lt;br /&gt;2. On the Application Management page, click Web application outgoing e-mail settings in the SharePoint Web Application Management section.&lt;br /&gt;3. On the Web Application E-Mail Settings page, select a Web application by using the Web Application menu in the Web Application section.&lt;br /&gt;4. In the Mail Settings section, type the SMTP server name for outbound e-mail (for example, type mail.fabrikam.com) in the Outbound SMTP server box.&lt;br /&gt;5. In the From address box, type the e-mail address as you want it to appear to e-mail recipients.&lt;br /&gt;6. In the Reply-to address box, type the e-mail address to which you want e-mail recipients to reply.&lt;br /&gt;7. On the Character set menu, click the character set that&#39;s appropriate for your language.&lt;br /&gt;8. Click OK.&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/5248023008463350611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/moss-configure-e-mail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/5248023008463350611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/5248023008463350611'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/moss-configure-e-mail.html' title='MOSS - Configure E-mail'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-1325087591013026335</id><published>2010-02-01T01:13:00.000-08:00</published><updated>2010-02-01T02:59:39.062-08:00</updated><title type='text'>Cute Editor - Customize Toolbar</title><content type='html'>&lt;p&gt;Cute Editor comes with some default set of toolbar configurations like - Simple, Full, Compact Minimal etc, which may full fill your requirements. But in case the entire vendor provided toolbars do not meet your needs and you want to have a certain set of tools\buttons on your editor, you can do it by simply creating your own configuration XML.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Tools are maintained in simple XML config files, loacted at ~\CuteSoft_Client\CuteEditor\Configuration\AutoConfigure folder.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;To create a new configuration file, copy an existing config file, i.e. Simple.config and re-name it &quot;MyTools.config&quot;. Save it to ~\CuteSoft_Client\CuteEditor\Configuration folder.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Code of the configuration file would be as per our tools requirements as below:&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#990000;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;lt;codeviewToolbars&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;g_start&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Save&quot; postback=&quot;True&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Print&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Find&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;ToFullPage&quot; command=&quot;FullPage&quot; imagename=&quot;fit&quot; hotkey=&quot;F12&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;FromFullPage&quot; command=&quot;FullPage&quot; imagename=&quot;restore&quot; hotkey=&quot;F12&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Cut&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Copy&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Paste&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;SelectAll&quot; hotkey=&quot;CTRL+A&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;SelectNone&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;g_end&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/codeviewToolbars&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;toolbars&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;g_start&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;ToFullPage&quot; command=&quot;FullPage&quot; imagename=&quot;fit&quot; hotkey=&quot;F12&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;FromFullPage&quot; command=&quot;FullPage&quot; imagename=&quot;restore&quot; hotkey=&quot;F12&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;CleanCode&quot; imagename=&quot;cleanup&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;NetSpell&quot; imagename=&quot;spell&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Cut&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Copy&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;dropmenu&quot; name=&quot;Paste&quot; group=&quot;PasteGroup&quot;/&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;separator&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Undo&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Redo&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Find&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Break&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;InsertParagraph&quot; imagename=&quot;Paragraph&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;InsertOrderedList&quot; imagename=&quot;numlist&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;InsertUnorderedList&quot; imagename=&quot;bullist&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Indent&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Outdent&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;forecolor&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;backcolor&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;g_end&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;item type=&quot;g_start&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Bold&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Italic&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Underline&quot; imagename=&quot;under&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;StrikeThrough&quot; imagename=&quot;strike&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Superscript&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Subscript&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;JustifyLeft&quot; imagename=&quot;left&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;JustifyCenter&quot; imagename=&quot;center&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;JustifyRight&quot; imagename=&quot;right&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;RemoveFormat&quot; imagename=&quot;unformat&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;item type=&quot;table&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;InsertHorizontalRule&quot; imagename=&quot;rule&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;InsertLink&quot; imagename=&quot;link&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Unlink&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;InsertAnchor&quot; imagename=&quot;anchor&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;SelectAll&quot; hotkey=&quot;CTRL+A&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;SelectNone&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;image&quot; name=&quot;Help&quot; /&amp;gt;&lt;br /&gt;&amp;lt;item type=&quot;g_end&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- groups are defined in Shared/Common.config --&amp;gt;&lt;br /&gt;&amp;lt;/toolbars&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Now you have created your own toolbar for Cute Editor, you can simply use it on .aspx page by changing following code line in cute editor definition on page:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#990000;&quot;&gt;&amp;lt;CE:Editor ConfigurationPath=&quot;~/CuteSoft_Client/CuteEditor/Configuration/mytools.config&quot;&lt;br /&gt;id=&quot;Editor1&quot;&lt;br /&gt;runat=&quot;server&quot; &amp;gt;&lt;br /&gt;&amp;lt;/CE:Editor&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Your Editor will render on your page like below :&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFCRN0-VNsNwk55KXtLhe4RkGBDQO9X0-lM7JhuXvVMaLOGvK38Cj7vvDQ3ooGWbx11x_eU7v4aQi-rEX5yuREnlCUnUs0r7UBOv23G5wzLgE-q3Xrb46gcc4XqIAodexEmES7JolajFw/s1600-h/CE.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5433227409421663138&quot; style=&quot;WIDTH: 400px; CURSOR: hand; HEIGHT: 270px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFCRN0-VNsNwk55KXtLhe4RkGBDQO9X0-lM7JhuXvVMaLOGvK38Cj7vvDQ3ooGWbx11x_eU7v4aQi-rEX5yuREnlCUnUs0r7UBOv23G5wzLgE-q3Xrb46gcc4XqIAodexEmES7JolajFw/s400/CE.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/1325087591013026335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/cute-editor-customize-toolbar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/1325087591013026335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/1325087591013026335'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2010/02/cute-editor-customize-toolbar.html' title='Cute Editor - Customize Toolbar'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFCRN0-VNsNwk55KXtLhe4RkGBDQO9X0-lM7JhuXvVMaLOGvK38Cj7vvDQ3ooGWbx11x_eU7v4aQi-rEX5yuREnlCUnUs0r7UBOv23G5wzLgE-q3Xrb46gcc4XqIAodexEmES7JolajFw/s72-c/CE.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-7134145584522797132</id><published>2009-09-15T06:42:00.000-07:00</published><updated>2009-09-15T06:57:22.798-07:00</updated><title type='text'>Cute Editor Version Upgrade problem - HTTPMODULE</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align=&quot;left&quot;&gt;Hi,&lt;br /&gt;&lt;br /&gt;Sometimes a small thing can break down a big application. It happened to me once.&lt;br /&gt;One of my big and critical applications running on .NET version 1.1 is using Cute Editor as users interface editor in its different pages. Once the next version came of the cute editor I tried to upgrade the version I am using with the latest one and all my pages which were using CE are distorted and editor was not working at all.&lt;br /&gt;&lt;br /&gt;After digging a lot into this and contacting to CE customer care also, I went nowhere. But it was quite visible that CE files are trying to render on page, but it could not succeed. I felt it may be a security or authorization problem that prevents few files to be uploaded on page, and finally found that the problem is because we were using HTTPMODULE for handling authorization. When I checked the authorization DLL code, there is a credential check for all the files, I just bypassed that check for CE client file and it workedJ.&lt;br /&gt;&lt;strong&gt;So next time you upgrade your Cute Editor, follow these steps.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Download CE client file from vendor’s site &lt;a href=&quot;http://cutesoft.net/&quot;&gt;http://cutesoft.net/&lt;/a&gt;.&lt;br /&gt;2. Get your .NET version client files.&lt;br /&gt;3. Upload new version Cute Editor client files in application:&lt;br /&gt;a) Need to delete all the client files from &quot;(project)/CuteSoft_Client&quot;.&lt;br /&gt;b) Upload all new client files (Downloaded from CE site) to project)/CuteSoft_Client&quot;.&lt;br /&gt;4. Add the Component reference (new version DLL of cute editor) to all the projects which are using Cute Editor.&lt;br /&gt;5. Make sure that license file cuteeditor.lic is added in bin folder of projects.&lt;br /&gt;6. Modify all the .aspx files which are using Cute Editor accordingly to support new version.&lt;br /&gt;7. Update the assembly reference with new version in all the .aspx files:&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic-syJ3EVooZjrmUBe9EQDHhOvXoKD3uvkkDx7PZmCBQvaETfiW8iDVt6PPaPiwqJoQ6oIc5rf1wagvcv-pQxCznUaL0zpxr-HfdOrl5LCda0-Zut1CNueWGJzW74jTVqmA7wW5cSO2Zg/s1600-h/ce.JPG&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG77as8I_HbHzDK28FWP1YiDG7j0h_uoqwu6bBUbGclFB_eduK3J4_dIK-5OWjuyWydNRBiuhNZ32bnZmHWdNKK-SqaAgUbNMtNN-Fc28IABtxK2zk8wydBcnu1RFOIzqW_rxvGfuNU9Q/s1600-h/ce.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5381692793247896274&quot; style=&quot;WIDTH: 498px; CURSOR: hand; HEIGHT: 36px&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG77as8I_HbHzDK28FWP1YiDG7j0h_uoqwu6bBUbGclFB_eduK3J4_dIK-5OWjuyWydNRBiuhNZ32bnZmHWdNKK-SqaAgUbNMtNN-Fc28IABtxK2zk8wydBcnu1RFOIzqW_rxvGfuNU9Q/s400/ce.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align=&quot;left&quot;&gt;For more details on deployment and implement of Cute editor, please visit:&lt;br /&gt;&lt;a href=&quot;http://cutesoft.net/developer+guide/index.html&quot;&gt;http://cutesoft.net/developer+guide/index.html&lt;/a&gt;&lt;br /&gt;Installation and Deployment -&gt; Deployment of CuteEditor for .NET&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Few Common problems:&lt;/strong&gt;&lt;br /&gt;1. Version difference of cute editor in .ASPX page and DLL added in project references.&lt;br /&gt;2. Client file path not found, if you are sharing client files from a common location, please add entry in web.config file of all the applications using CE.&lt;br /&gt;3. Tool bar customized Configuration file is missing (If toolbar is customized).&lt;br /&gt;4. HTTPMODULE is used for security and CE client files are not bypassed from authentication.&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/7134145584522797132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2009/09/cute-editor-version-upgrade-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7134145584522797132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7134145584522797132'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2009/09/cute-editor-version-upgrade-problem.html' title='Cute Editor Version Upgrade problem - HTTPMODULE'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG77as8I_HbHzDK28FWP1YiDG7j0h_uoqwu6bBUbGclFB_eduK3J4_dIK-5OWjuyWydNRBiuhNZ32bnZmHWdNKK-SqaAgUbNMtNN-Fc28IABtxK2zk8wydBcnu1RFOIzqW_rxvGfuNU9Q/s72-c/ce.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-7637171095486396801</id><published>2009-09-09T05:47:00.000-07:00</published><updated>2009-09-09T05:50:42.775-07:00</updated><title type='text'>Sharepoint - STSADM commands for FEATURE</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color:#336666;&quot;&gt;Features:&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;stsadm -o installfeature&lt;br /&gt;-filename &lt;relative&gt;&lt;br /&gt;-name &lt;feature&gt;&lt;br /&gt;[-force]&lt;br /&gt;stsadm -o activatefeature&lt;br /&gt;-filename &lt;relative&gt;&lt;br /&gt;-name &lt;feature&gt;&lt;br /&gt;-id &lt;feature&gt;&lt;br /&gt;[-url] &lt;url&gt;&lt;br /&gt;[-force]&lt;br /&gt;stsadm -o deactivatefeature&lt;br /&gt;-filename&lt;br /&gt;-name &lt;feature&gt;&lt;br /&gt;-id &lt;feature&gt;&lt;br /&gt;[-url] &lt;url&gt;&lt;br /&gt;[-force]&lt;br /&gt;stsadm -o uninstallfeature&lt;br /&gt;-filename &lt;file&gt;&lt;br /&gt;-name &lt;feature&gt;&lt;br /&gt;-id &lt;feature&gt;&lt;br /&gt;[-force]</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/7637171095486396801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2009/09/sharepoint-stsadm-commands-for-feature.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7637171095486396801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/7637171095486396801'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2009/09/sharepoint-stsadm-commands-for-feature.html' title='Sharepoint - STSADM commands for FEATURE'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1496718626530818953.post-4882087162322812185</id><published>2009-09-09T05:11:00.000-07:00</published><updated>2009-09-09T05:20:35.149-07:00</updated><title type='text'>STSADM Commands - Sharepoint</title><content type='html'>Microsoft Office SharePoint Server 2007 includes the Stsadm tool for command-line administration of Office SharePoint Server 2007 servers and sites. Stsadm is located at the following path on the drive where SharePoint Products and Technologies is installed: %COMMONPROGRAMFILES%\microsoft shared\web server extensions\12\bin. You must be an administrator on the local computer to use Stsadm.Stsadm provides a method for performing the Office SharePoint Server 2007 administration tasks at the command line or by using batch files or scripts.&lt;br /&gt;&lt;strong&gt;Content database Operations:&lt;/strong&gt;&lt;br /&gt;Add content db:&lt;br /&gt;stsadm.exe -o addcontentdb           -url &lt;url&gt;           -databasename &lt;database&gt;           [-databaseserver &lt;database&gt;]           [-databaseuser &lt;database&gt;]           [-databasepassword &lt;database&gt;]           [-sitewarning &lt;site&gt;]           [-sitemax &lt;site&gt;]&lt;br /&gt;&lt;br /&gt;Database repair:&lt;br /&gt;stsadm.exe -o databaserepair           -url &lt;url&gt;           -databasename &lt;database&gt;           [-deletecorruption]&lt;br /&gt;&lt;br /&gt;Delete content db:&lt;br /&gt;stsadm.exe -o deletecontentdb           -url &lt;url&gt;           -databasename &lt;database&gt;           [-databaseserver &lt;database&gt;]&lt;br /&gt;&lt;br /&gt;Set config db:&lt;br /&gt;stsadm.exe -o setconfigdb           [-connect]           -databaseserver &lt;database&gt;           [-databaseuser &lt;database&gt;]           [-databasepassword &lt;database&gt;]           [-databasename &lt;database&gt;]           [-exclusivelyusentlm]           [-farmuser]           [-farmpassword]           [-adcreation]           [-addomain &lt;active&gt;]           [-adou &lt;active&gt;]&lt;br /&gt;&lt;br /&gt;Delete config db:&lt;br /&gt;stsadm.exe -o deleteconfigdb&lt;br /&gt;&lt;br /&gt;Merge content dbs:&lt;br /&gt;stsadm.exe -o mergecontentdbs     -url &lt;url&gt;     -sourcedatabase &lt;source&gt;        destinationdatabasename &lt;destination&gt;    [-operation &lt;1,&gt;]     [-filename &lt;file&gt;] Where operation is:    1. Analyze (default)    2. Full database merge    3. Read from file&lt;br /&gt;Trim audit log:stsadm -o trimauditlog   -url &lt;url&gt;   -enddate &lt;yyyymmdd&gt;   -databasename &lt;database&gt;   [-databaseserver] &lt;database&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Stsadm operations for Webparts:&lt;/strong&gt;&lt;br /&gt;We creat customized web parts in .NET (sharepoint) for our pecific needs where out of box web parts do not meet our requirements. Microsoft Office SharePoint Server 2007 includes the Stsadm tool for command-line administration of Office SharePoint Server 2007 servers and sites. Once the web part is ready, we need to add and deploy this before use, here are the stsadm command line operations for Web Parts.&lt;br /&gt;Add Web part : addwppack&lt;br /&gt;stsadm.exe -o addwppack                   -filename &lt;web&gt;                   [-lcid &lt;language&gt;]                   [-url &lt;url&gt;]                   [-globalinstall]                   [-force]                   [-nodeploy]&lt;br /&gt;stsadm.exe -o addwppack                   -name &lt;name&gt;                   [-lcid &lt;language&gt;]                   [-url &lt;url&gt;]                   [-globalinstall]                   [-force]&lt;br /&gt;&lt;br /&gt;Delete Web part : deletewppack&lt;br /&gt;stsadm.exe -o deletewppack           -name &lt;name&gt;           [-lcid &lt;language&gt;]           [-url &lt;url&gt;]&lt;br /&gt;&lt;br /&gt;Deploy Web part : deploywppack:&lt;br /&gt;stsadm.exe -o deploywppack            -name &lt;web&gt;           [-url &lt;virtual&gt;]           [-time &lt;time&gt;]           [-immediate]           [-local]           [-lcid &lt;language&gt;]           [-globalinstall]           [-force]&lt;br /&gt;&lt;br /&gt;enumwppacks:&lt;br /&gt;stsadm.exe -o enumwppacks           [-name &lt;name&gt;]           [-url &lt;virtual&gt;]           [-farm]&lt;br /&gt;&lt;br /&gt;retractwppack:&lt;br /&gt;stsadm.exe -o retractwppack            -name &lt;web&gt;           [-url &lt;virtual&gt;]           [-time &lt;time&gt;]           [-immediate]           [-local]           [-lcid &lt;language&gt;]</content><link rel='replies' type='application/atom+xml' href='http://deepakssolanki.blogspot.com/feeds/4882087162322812185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deepakssolanki.blogspot.com/2009/09/stsadm-commands-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/4882087162322812185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1496718626530818953/posts/default/4882087162322812185'/><link rel='alternate' type='text/html' href='http://deepakssolanki.blogspot.com/2009/09/stsadm-commands-sharepoint.html' title='STSADM Commands - Sharepoint'/><author><name>Deepak Solanki</name><uri>http://www.blogger.com/profile/00513765944004278367</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivTAvMlMrVV56xRjz9mNIvIC9liDrIHJt61vGanNaNlPJfnSi89a5ZF8gsCUSAqeigKlINkh6iKDH8-OwMjyzMC6Mq0xjxb89Gdyyb7XXJVjG14AnrgfqFP0kdtGgMY8A/s150/IMG_0523+%28Large%29.JPG'/></author><thr:total>0</thr:total></entry></feed>