posts - 16 , comments - 4 , trackbacks - 0

Thursday, July 23, 2015

Email concept development and unit test

http://smtp4dev.codeplex.com/downloads/get/269147

Posted On Thursday, July 23, 2015 4:21 AM | Comments (0) | Filed Under [ Email ]

Document ID service

https://www.webucator.com/tutorial/advanced-microsoft-sharepoint/document-id-service.cfm

Home > Resources > Free Tutorials > Advanced SharePoint 2013 > Document ID Service

Document ID Service

SharePoint's Document ID service, available with the pay versions of SharePoint, creates unique IDs for documents that are prefixed with text the Site Collection Administrator defines. What's more is that the ID assigned to the document creates a fixed URL that can be used to link to the document even if it is moved to another library or site. The Document ID service can only be used on documents and cannot be used on list items.

The Document ID service is enabled at the Site Collection level by activating a feature. Once the service is activated the Site Collection Administrator can define the prefix string to be used. SharePoint uses a Timer Job, Document ID assignment job, to set the IDs on existing documents once the Document ID Service has been activated. The Timer Job runs every 24 hours by default so existing documents will not have the IDs until the job has run. A Farm administrator can manually run the job to have the IDs created sooner. New documents will have IDs created when the document is saved to the library.

Lesson Goals

  • Learn what the Document ID feature does.
  • Learn how to activate the Document ID feature in a Site Collection.
  • Learn how to configure the Document ID feature settings.
  • Learn how to force the Document ID feature timer jobs to run.
  • Learn how to link to a document using the Document ID URL.

Activating the Document ID Feature

The following walk-through will show you how to activate the Document ID Service feature on a site collection.

This walk-through is the same as the first steps performed in the exercise at the end of the lesson. You can activate a feature only once for a Site Collection, so if you plan to do the exercise you can skip this walk-through. This walk-through can only be done on the pay versions of SharePoint.

  1. Activate the Document ID feature for the site collection of your root site.
    1. Click Settings menu and then choose Site Settings from the options.
    2. Click the Site Collection Features link in the Site Collection Administration group of the Site Settings page.Activating Document ID
    3. Click the Activate button for the Document ID Service feature.Activating Document ID

Configuring Document ID Settings

The following walk-through will show you how to configure the Document ID settings for the Site Collection to use an ID prefix of "Contoso" and to reset all existing documents with the ID. Once the setting is in place the walk-through will show you how to use Central Administration to force the Timer Jobs to run so you can verify the service is working without having to wait 24 hours for the service to run naturally.

This walk-through is the same as the steps performed in the exercise at the end of the lesson. If you plan to do the exercise, you can skip this walk-through.

  1. Configure the Site Collection Document ID Settings to prefix document IDs with "CONTOSO".
    1. Click the Settings menu and then choose Site Settings from the options.
    2. Click the Document ID settings link in the Site Collection Administration group of the Site Settings page.Configuring Document ID
    3. Type "CONTOSO" in the text-box field labeled Begin IDs with the following characters and check the box labeled Reset all Document IDs in this site Collection to begin with these characters.Configuring Document ID
    4. Click the OK button to save the new Document ID prefix.
  2. Use Central Administration to force the Document ID service timer jobs to run.

    You can only perform these steps if you have access to your farm's Central Administration site. If you do not, you can skip these steps and wait 24 hours for it to naturally occur.

    1. Open a new browser tab and navigate to the Central Administration site for you SharePoint farm.

      The default setup for this class calls for the Central Administration site to be accessible through "http://spserver2013:5000".

    2. Click the Monitoring link in the Central Administration site's Quick Launch.Configuring Document ID
    3. Click the Review job definitions link under the Timer Jobs group.Configuring Document ID
    4. Scroll down the list of Timer Jobs and locate and click the Document ID enable/disable job link.Configuring Document ID
    5. Click the Run Now button at the bottom of the job definition form.
    6. Scroll down the list of Timer Jobs and locate and click the Document ID assignment job link.Configuring Document ID
    7. Click the Run Now button at the bottom of the job definition form.
    8. Close the browser tab for Central Administration.
  3. Verify that Document IDs have been generated for documents in the Contoso Home Site.
    1. Click the Documents link in the Contoso Home Site site's Quick Launch menu.
    2. Hover and click the arrow to the right of the EvaluateSharePointServer2010-ITPro link and choose the View Properties from the options menu.
    3. Verify the Document ID property exists for the document and it has a value that starts with "CONTOSO".Configuring Document ID

      If the document doesn't have an Document ID assigned to it yet, you will need to wait at least 30 minutes and then repeat the previous steps from Central Administration to force the timer jobs to run. Depending on the size of the Site Collection SharePoint uses an entry in the content database table calledScheduledWorkItems to delay the configuration of Document ID feature. If it's registered in this table running the timer jobs won't have any affect until the scheduled time elapses.

    4. Click the Close button to close the document's properties dialog.

Linking Documents Using Their Document ID

The main function of the Document ID service is to provide a hyperlink to the document that will work even if the document is moved to another library or even another site.

The Document ID service uses a redirect page, DocIdRedir.aspx, that takes the unique Document ID generated by the service as a parameter. The following is a screen capture of the fixed URL created by the Document ID service for the EvaluateSharePointServer2010-ITPro.docx document located in the Documents library from the previous demonstration:Linking Documents

The URL can be seen by hovering over the Document ID property of the document.

The following walk-through will show you how to create a hyperlink on the Home page of your team site to a document in the Shared Documents library. For the document's URL, we will use the Document ID service's path.

  1. Copy the Document ID link of the EvaluateSharePointServer2010-ITPro.docx document.
    1. Click the Shared Documents link in your site's Quick Launch menu.
    2. Click the ellipsis button to the right of the EvaluateSharePointServer2010-ITPro link than click the second ellipsis button on the balloon pop-up and choose the View Properties from the options menu.
    3. Right-click the Document ID property link and choose the Copy shortcut option.Linking Documents
  2. Create a hyperlink on the Home page of your site that uses the Document ID URL to the EvaluateSharePointServer2010-ITPro.docx document.
    1. Navigate back to the home page of your site.
    2. Click the Edit link at the top of the page to edit the page.
    3. Place our insertion point at the bottom of the main middle content area.
    4. Click the Link button drop-down in the INSERT tab toolbar and choose the From Address option.
    5. Type "SharePoint 2010 ITPro Doc" in the Text to display field.
    6. Paste the copied URL form the Document ID property into the Address field.Linking Documents
    7. Click the OK button to save the hyperlink.
    8. Click the SAVE icon in the upper right of the page to save the changes.
    9. Click the link and verify it prompts you to open the EvaluateSharePointServer2010-ITPro.docx document.
    10. Cancel opening the document.

Activating and Configuring the Document ID Service

Duration: 15 to 25 minutes.

This exercise can only be performed on a pay version of SharePoint Server 2010. It is not available with SharePoint Foundation 2010.

  1. Navigate to your team site.
  2. Activate the Document ID feature for the site collection of your root site.
    1. Click Settings menu then choose Site Settings from the options.Exercise - Document IDs
    2. Click the Site Collection Features link in the Site Collection Administration group of the Site Settings page.Exercise - Document IDs
    3. Click the Activate button for the Document ID Service feature.Exercise - Document IDs
  3. Configure the Site Collection Document ID Settings to prefix document IDs with "CONTOSO".
    1. Click Site Actions then choose Site Settings from the options menu.
    2. Click the Document ID settings link in the Site Collection Administration group of the Site Settings page.Exercise - Document IDs
    3. Type "CONTOSO" in the text box field labeled Begin IDs with the following characters and check the box labeled Reset all Document IDs in this site Collection to begin with these characters.Exercise - Document IDs
    4. Click the OK button to save the new Document ID prefix.
  4. Use Central Administration to force the Document ID service timer jobs to run.

    You can perform these steps only if you have access to your farm's Central Administration site. If you do not, you can wait 24 hours for it to naturally occur.

    1. Open a new browser tab and navigate to the Central Administration site for you SharePoint farm.

      The default setup for this class calls for the Central Administration site to be accessible through "http://spserver2013:5000".

    2. Click the Monitoring link in the Central Administration site's Quick Launch.Configuring Document ID
    3. Click the Review job definitions link under the Timer Jobs group.Configuring Document ID
    4. Scroll down the list of Timer Jobs and locate and click the Document ID enable/disable job link.Configuring Document ID
    5. Click the Run Now button at the bottom of the job definition form.
    6. Scroll down the list of Timer Jobs and locate and click the Document ID assignment job link.Configuring Document ID
    7. Click the Run Now button at the bottom of the job definition form.
    8. Close the browser tab for Central Administration.
  5. Verify that Document IDs have been generated for documents in your team site.
    1. Click the Documents link in your site's Quick Launch menu.
    2. Click the ellipsis button to the right of the Sample WF Doc link than click the second ellipsis button on the balloon pop-up and choose the View Propertiesfrom the options menu.Exercise - Document IDs
    3. Verify the Document ID property exists for the document and it has a value that starts with "CONTOSO".Exercise - Document IDs
    4. Click the Close button to close the document's properties dialog.

Posted On Thursday, July 23, 2015 4:12 AM | Comments (0) | Filed Under [ document id service ]

Tuesday, July 21, 2015

Creating a Folder in a SharePoint List and adding Items to it programatically

Creating a Folder in a SharePoint List and adding Items to it programatically

The following code is to create a folder in a SharePoint list and add items to it. This code is written for a Custom Visual Studio Workflow, the workflow will be started when a new item is added to a list.

public Guid workflowId = default(System.Guid);
public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
SPList list = null;
SPListItem folderItem = null;

private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
{
 SPListCollection listCollection = workflowProperties.Web.Lists;

//Creating folder in "MyContacts" Lists
list = listCollection["MyContacts"];

// create a folder under the path specified
folderItem = list.Items.Add(list.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder);

// set the folder name and update
folderItem["Title"] = "My Folder"
folderItem.Update();

//create a listitem object to add item in the foler
SPListItem listItem = list.Items.Add(folderItem.Folder.ServerRelativeUrl, SPFileSystemObjectType.File, null);

//Set the values for other fields in the list
listItem["Contact ID"] = workflowProperties.Item["Contact ID"];
listItem["Contact Name"] = workflowProperties.Item["Contact ID"];
listItem.Update();
workflowProperties.Item.Update();
oWeb.AllowUnsafeUpdates = false;
}

Posted On Tuesday, July 21, 2015 11:41 AM | Comments (0) | Filed Under [ Creating a Folder in a SharePoint List and adding Items to it programatically ]

Allow users to edit values for this property to IsUserEditable =TRUE at the user profile properties UPN user principal Name(Edit Settings)

if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{
Add-PsSnapin Microsoft.SharePoint.PowerShell
}
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("microsoft.sharepoint.portal")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("System.Web")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Taxonomy.dll")
$site = Get-SPSite -Identity $siteurl -ErrorAction Stop
$ctx = [Microsoft.Office.Server.ServerContext]::GetContext($site)
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ctx)
$upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($ctx)
foreach($property in $upm.Properties)
{
if($property.Name -eq "SPS-UserPrincipalName")
{
Write-Host $property.IsUserEditable
$property.IsUserEditable = $true;
$property.IsVisibleOnEditor = $false;
$property.IsVisibleOnViewer = $false;
$property.Commit();
}
}

Posted On Tuesday, July 21, 2015 8:27 AM | Comments (0) | Filed Under [ PROPERTY user principal name UPN Allow users to edit values for this property ]

Allow users to edit values for this property to IsUserEditable =TRUE at the user profile properties UPN user principal Name(Edit Settings)

if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{
Add-PsSnapin Microsoft.SharePoint.PowerShell
}
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("microsoft.sharepoint.portal")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("System.Web")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Taxonomy.dll")
$site = Get-SPSite -Identity $siteurl -ErrorAction Stop
$ctx = [Microsoft.Office.Server.ServerContext]::GetContext($site)
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ctx)
$upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($ctx)
foreach($property in $upm.Properties)
{
if($property.Name -eq "SPS-UserPrincipalName")
{
Write-Host $property.IsUserEditable
$property.IsUserEditable = $true;
$property.IsVisibleOnEditor = $false;
$property.IsVisibleOnViewer = $false;
$property.Commit();
}
}

Posted On Tuesday, July 21, 2015 8:27 AM | Comments (0) | Filed Under [ PROPERTY user principal name UPN Allow users to edit values for this property ]

Wednesday, July 15, 2015

SPNavigation levels increase from default to custom levels

https://social.technet.microsoft.com/Forums/sharepoint/en-US/04c1f719-f4d2-496f-98c6-db9022c795ab/sharepoint-2013-top-link-bar-extended-dropdown?forum=sharepointgeneral


http://sharepoint.stackexchange.com/questions/112401/how-to-create-multi-level-navigationhttp://sharepoint.stackexchange.com/questions/112401/how-to-create-multi-level-navigation

 

http://blog.thehensongroup.com/2013/01/13/3/http://blog.thehensongroup.com/2013/01/13/3/

 

https://social.technet.microsoft.com/Forums/sharepoint/en-US/f224e1af-613c-46ad-9863-997c10fdf926/3-level-navigation-in-sharepoint?forum=sharepointgeneralprevious

 

https://social.technet.microsoft.com/Forums/office/en-US/d9c5f287-c85a-49b8-8c7c-6e1912cedccd/sharepoint-2013-three-level-navigation?forum=sharepointadminhttps://social.technet.microsoft.com/Forums/office/en-US/d9c5f287-c85a-49b8-8c7c-6e1912cedccd/sharepoint-2013-three-level-navigation?forum=sharepointadmin

 

 

Posted On Wednesday, July 15, 2015 12:25 PM | Comments (0) |

SharePoint 2013 Timer Job

Hi,

 

Started writing the timer job. I had the experince long ago. Now working on this ..

https://www.simple-talk.com/dotnet/.net-tools/a-complete-guide-to-writing-timer-jobs-in-sharepoint-2010/ 

 

https://social.msdn.microsoft.com/Forums/en-US/a864ffeb-417e-43db-8e6b-bb750a8e2f84/how-to-display-user-account-for-modified-by-when-the-listitem-is-updated-by-timer-job?forum=sharepointdevelopmentprevious used for R&D

 

started with the above link and then MSDN links.

Posted On Wednesday, July 15, 2015 9:47 AM | Comments (0) | Filed Under [ SharePoint 2013 Timer Job ]

Changing the Master Page in SharePoint 2013 and Navigation

Hi,

 

SharePoint 2013 ..change the master page.

 

we can get this option at Look and Feel section of the site settings but the thing is..we must remember

pblishing features activated or not. two places we must activate one is web and site collection feautres. Also I would like bring ..Navigation link @look and feel section will come once the above features activation.

Another thing is default the site will have two level top navigation. If we want to change the Top Menu ..qwe must do changes the master page which has been used for site and proceeed.

Posted On Wednesday, July 15, 2015 9:37 AM | Comments (0) | Filed Under [ masterpage site masterpage change navigation spnavigation ]

Friday, July 10, 2015

Style SharePoint 2013 Top Navigation (Global Navigation) menu

https://kogzee.wordpress.com/2013/08/07/style-sharepoint-2013-top-navigation-global-navigation-menu/

http://www.nothingbutsharepoint.com/2013/04/25/yes-the-sharepoint-navigation-really-can-work-for-your-needs-aspx/

How much room do I have to change the top navigation in SharePoint?
I have a publishing site and I am using SharePoint's default top navigation which I have modified a little (by applying CSS) but now I want some more changes as below.

Please check if this is possible to do or not?

In my top navigation there are three levels:

Main Link
|
------Sub link 1
| |
| -----------Sub link a
| |
| -----------Sub link b
|
------Sub link 2

When you mouse over "Main Link" it opens level 1 which shows "Sub link1" and "Sub link2".
When you mouse over "Sub link 1" then it shows level 2 "Sub link a" and "Sub link b".

I want to show a different style bullet on level 1 and level 2. They are basically images (small icons) which will be displayed in level 1 and level2 with each item. But again the thing is, icon of level 1 is different than icon of level 2.

Is this possible?

EDIT
I am using custom master page not the ones provided by SharePoint.

shareimprove this question
   
I have this problem and I got so excited when I see this solution, but I think the master page "HTML file" and "Master file" are associated. how can I change the master file? Thanks in advance. –  user24931 Apr 7 '14 at 9:36

I found this tutorial and looks like it is quite possible.http://kogzee.wordpress.com/2013/08/07/style-sharepoint-2013-top-navigation-global-navigation-menu/

EDIT
The above article explains how you can integrate your custom menu with SharePoint in 2 easy steps.
Suppose you have got the CSS and HTML of menu from designer and now as a SharePoint developer you want to integrate it. Here's how CSS and HTML file will look like:

CSS
The CSS is pretty large so I am only pasting small portion of it. You can see rest of it on the link above.

/*Navigation*/
.crom-Navigation {
    font-family:"Trebuchet MS", Helvetica, sans-serif;
    margin: 10px 0px; 
    top: 0px; 
    position: relative;
    z-index:200;
}
.crom-Navigation a {
    margin: 0px; 
    padding: 0px; 
    border: 0px;
    text-decoration:none;
}
.crom-Navigation ul {
    list-style: none; 
    margin: 0px; 
    padding: 0px; 
    font-size: 16px; 
    z-index:200;
    border-bottom: 2px solid #003f5f;
}

HTML

<!--Menu-->
   <div id="navigation" class="crom-Navigation">
   <ul>
      <li><a href="#">Cameras</a>
         <ul>
            <li><a href="#">Camcorders</a></li>
            <li><a href="#">Digital cameras</a></li>
            <li><a href="#">Disposable cameras</a></li>
            <li><a href="#">Film cameras</a></li>
         </ul>
      </li>
      <li><a href="#">Computers</a>
         <ul>
            <li><a href="#">Desktops</a></li>
            <li><a href="#">Laptops</a></li>
            <li><a href="#">Netbooks</a></li>
            <li><a href="#">Tablets</a></li>
         </ul>
      </li>
      <li><a href="#">Media</a>
         <ul>
            <li><a href="#">Movies</a></li>
            <li><a href="#">Music</a></li>
            <li><a href="#">TV shows </a></li>
            <li><a href="#">Video games </a></li>
         </ul>
      </li>
   </ul>
</div>

Now simply do the following steps and the menu will be displayed.

Call that custom CSS in your master page

<SharePoint:CssRegistration
  name="&lt;% $SPUrl:~sitecollection/_catalogs/masterpage/CromwellFixedWidth/CromwellFixedWidthStyle.css %&gt;"
  runat="server"
  after="SharepointCssFile"/>

Copy/Paste following code in your master page where you want to display menu

<!--Menu-->
   <div id="navigation" class="crom-Navigation">
   <!--Top Menu-->
   <SharePoint:AjaxDelta id="DeltaTopNavigation" BlockElement="true" CssClass="ms-displayInline ms-core-navigation" role="navigation" runat="server">
    <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
        <Template_Controls>
            <asp:SiteMapDataSource
                ShowStartingNode="False"
                SiteMapProvider="SPNavigationProvider"
                id="topSiteMap"
                runat="server"
                StartingNodeUrl="sid:1002"/>
        </Template_Controls>
    </SharePoint:DelegateControl>
    <asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
        <SharePoint:AspMenu
            runat="server" UseSeparateCss="false"
            AdjustForShowStartingNode="False" StaticDisplayLevels="2"
            AccessKey="1" SkipLinkText="" EnableViewState="False"
            MaximumDynamicDisplayLevels="1" 
            DataSourceID="topSiteMap" Orientation="Horizontal"
            RenderingMode="List"
            UseSimpleRendering="False"
            ID="TopNavigationMenu">
            </SharePoint:AspMenu>
    </asp:ContentPlaceHolder>
</SharePoint:AjaxDelta>
</div>
shareimprove this answer

Posted On Friday, July 10, 2015 2:13 AM | Comments (1) | Filed Under [ masterpage topmenu global nagivation current navidation ]

Wednesday, July 8, 2015

create custom user profile property of type taxomomy multivalue

http://sharepoint-community.net/profiles/blogs/sp2013-powershell-create-userprofile-taxonomy-based-property -----------------------------------OR-------------------------------------------- param ( # Site Url input parameter [string]$SiteUrlParameter ) try { $propertyNames = New-Object System.Collections.ArrayList $propertyDisplayNames = New-Object System.Collections.ArrayList $termSetNames = New-Object System.Collections.ArrayList $siteUrl = "http://ABC:123" if($SiteUrlParameter -ne $null) { $siteUrl = $SiteUrlParameter } # Add your Custom User Properties to the Arraylist below #if you add term set name as NA, the correspoding property will be added as single line of text $propertyNames.Add("UPS-ABC") $propertyDisplayNames.Add("ABC") $termSetNames.Add("ABC") $propertyNames.Add("UPS-ABC") $propertyDisplayNames.Add("ABC") $termSetNames.Add("ABC") $propertyNames.Add("UPS-ABC") $propertyDisplayNames.Add("ABC") $termSetNames.Add("ABC") $propertyNames.Add("UPS-ABC") $propertyDisplayNames.Add("ABC") $termSetNames.Add("ABC") $propertyNames.Add("UPS-ABC") $propertyDisplayNames.Add("ABC") $termSetNames.Add("ABC") if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" } [System.Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") [System.Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles") [System.Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles.UserProfileManager") $site = Get-SPSite $siteUrl $serviceContext = Get-SPServiceContext $site $upConfigMgr = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext) $coreProperties = $upConfigMgr.ProfilePropertyManager.GetCoreProperties() $taxonomySession = Get-SPTaxonomySession -Site $site $loopcount = 0 foreach($propertyName in $propertyNames) { $propertyDisplayName = $propertyDisplayNames[$loopcount] $termSetName = $termSetNames[$loopcount] if($coreProperties.GetPropertyByName($propertyName) -ne $null) { Write-Host "Property Already exists, deleting" $propertyName $coreProperties.RemovePropertyByName($propertyName) } $upcoreproperty = $coreProperties.Create($false) $upcoreproperty.Name = $propertyName $upcoreproperty.DisplayName = $propertyDisplayName if($termSetName -ne "NA") { $upcoreproperty.Type = [Microsoft.Office.Server.UserProfiles.PropertyDataType]::StringMultiValue $upcoreproperty.IsMultivalued = $true $mytermSet = $taxonomySession.GetTermSets($termSetName,1033) $upcoreproperty.TermSet = $mytermSet[0] } else { $upcoreproperty.Type = [Microsoft.Office.Server.UserProfiles.PropertyDataType]::StringSingleValue $upcoreproperty.IsMultivalued = $false $upcoreproperty.Length = 100 } $upcoreproperty.Description = "This Property Value is populated by a Timer Job" $upcoreproperty.IsSearchable = $true $coreProperties.Add($upcoreproperty) $userProfilePropertyManager = $upConfigMgr.ProfilePropertyManager $userProfileTypeProperties = $userProfilePropertyManager.GetProfileTypeProperties([Microsoft.Office.Server.UserProfiles.ProfileType]::User) $userProfileProperty = $userProfileTypeProperties.Create($upcoreproperty) $userProfileProperty.IsVisibleOnEditor = $false $userProfileProperty.IsVisibleOnViewer = $true $userProfileTypeProperties.Add($userProfileProperty) $upSubTypeManager = [Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager]::Get($serviceContext) $userProfile = $upSubTypeManager.GetProfileSubtype([Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager]::GetDefaultProfileName([Microsoft.Office.Server.UserProfiles.ProfileType]::User)) $userProfileProperties = $userProfile.Properties $userProfileSubProperty = $userProfileProperties.Create($userProfileProperty) $userProfileSubProperty.DefaultPrivacy = [Microsoft.Office.Server.UserProfiles.Privacy]::Public $userProfileSubProperty.PrivacyPolicy = [Microsoft.Office.Server.UserProfiles.PrivacyPolicy]::OptIn $userProfileSubProperty.IsUserEditable = $false $userProfileSubProperty.UserOverridePrivacy = $false $userProfileProperties.Add($userProfileSubProperty) $userProfileProperty.CoreProperty.Commit() $userProfileProperty.Commit() $userProfileSubProperty.Commit() Write-Host "Propert Created InternalName" $propertyName " Display Name " $propertyDisplayName " Mapped to Termset " $termSetName $loopcount = $loopcount+1 } } catch { Write-Error "Error Creating Profile properites, check error details." Write-Error $_.message }

Posted On Wednesday, July 8, 2015 6:14 AM | Comments (1) | Filed Under [ taxonomy folksonomy CUSTOMUSERPROFILE USERPROFILE PROPERTY ]

Powered by: