Usage instructions

  1. Copy and extract the sp2010profpowershell.zip file and extract it in a folder on one of the servers in the SharePoint 2010 farm.
  2. Log on to the server with the farm account. Certain calls require farm account privileges.
  3. Edit the connections.xml file to set up parameters.
  4. Run the AutomateConnection.ps1 script in a PowerShell window.
    • Always run the PowerShell window with Machine Administrator privileges (Right-click / Run As Administrator)

Editing the XML file

The script gets the properties and data from a connections.xml file sitting in the same folder. You can specify it in the $file variable in the AutomateConnections.ps1 file (Ln10).

XLM File structure:
// multi-line
   <Connections> <!-- External tag. A connection is always required. -->
      <Connection name="Testing"> <!-- The name attribute here is only for information -->
         <SyncSettings> <!-- Specifying the Synchronization Connection's attributes -->
            <ProfileServiceApplicationName> ... </> <!--- Display name of the UPA -->
            <ConnectionForestName> ... </> <!-- Name of the AD forest you are connecting to -->
            <ConnectionDomain> ... </> <!-- Name of the domain in the forest you are connecting to -->
            <ConnectoinUserName> ... </> <!-- The sync account used to connect to AD -->
            <ConnectionPassword> ... </> <!-- Plain text password of the sync account. -->
            <ConnectionServerName> ... </> <!-- This will be the name of the connection, the OM will create the connection with this name. -->
            <ConnectionSynchronizatoinOU> ... </> <!-- The OU you are connecting to.-->
            <ServiceContextSite> ... </> <!-- If you want to create user profile properties, this is required. Specify a web app URL that has UPA service connection -->
         </SyncSettings>

         <PropertyCreations> <!-- Section to create user profile properties. Even if you do not create any, this tag is required. -->

            <ProfilePropertyCreation DisplayName="" Privacy="" PrivacyPolicy="" PropType="" PropLength="" IsVisibleOnEditor="" IsVisibleOnViewer="" IsEventLog=""> ... </>

         </PropertyCreations>

         <PropertyMappings> <!-- Mapping an existing SharePoint user profile property to an AD attribute. -->

            <ProfilePropertyMapping SharePointProp="" direction=""> ... </>

         </PropertyMappings>

      </Connection>

      <Connection>
         <SyncSettings>
            <ProfileServiceApplicationName> ... </>
            <ConnectionForestName> ... </>
            <ConnectionDomain> ... </>
            <ConnectoinUserName> ... </>
            <ConnectionPassword> ... </>
            <ConnectionServerName> ... </>
            <ConnectionSynchronizatoinOU> ... </>
            <ServiceContextSite> ... </> 
         </SyncSettings>

         <PropertyCreations>
            ...
            ...
            ...
         </PropertyCreations>

         <PropertyMappings>
            ...
            ...
            ...
         </PropertyMappings>

      </Connection>

   </Connections>



For the <ProfilePropertyCreation> tag you can find more information here:
The Privacy attribute of the <ProfilePropertyCreation> tag is an Enum with these values:
Privacy Name Description
Contacts Colleagues
Manager Manager and me
NotSet Not set
Organization Workgroup
Private Me
Public Everyone


The PrivacyPolicy attribute of the <ProfilePropertyCreation> tag is an Enum with these values:
Privacy Policy Name Description
Disabled The control is disabled and is not shown on the UI
Mandatory The property will be Required
OptIn Opt-in to provide a privacy policy value for a property
OptOut Opt-out from providing a privacy policy value for a property





Last edited Oct 9, 2011 at 8:51 AM by zsoltilles, version 4

Comments

No comments yet.