none
Configure Synchronization connections with PowerShell (User Profile)

    Question

  • Hi,

    I was checking the Pshell cmdlets for SPS2010 and wasn't able to configure the sync connection after creating the User Profile SA. Do you know if it's possible to configure this part (AD, filters, etc) in PShell ?
    Is it done using the "SetupSynchronizationService" method of the User Profile Service Application object ?

    Thanks !
    Wes

     

    Wednesday, September 08, 2010 3:50 PM

Answers

  • there is no cmdlet specifically for this. you can do so by using the DirectoryServiceConnection  methods
    Cheers
    Spence
    www.harbar.net
    Microsoft Certified Master | SharePoint 2010
    Microsoft Certified Master | SharePoint 2007
    • Marked as answer by Lily Wu Friday, September 17, 2010 6:41 AM
    Saturday, September 11, 2010 7:05 AM

All replies

  • there is no cmdlet specifically for this. you can do so by using the DirectoryServiceConnection  methods
    Cheers
    Spence
    www.harbar.net
    Microsoft Certified Master | SharePoint 2010
    Microsoft Certified Master | SharePoint 2007
    • Marked as answer by Lily Wu Friday, September 17, 2010 6:41 AM
    Saturday, September 11, 2010 7:05 AM
  • Thanks for the reply Spence, always appreciate it.

    I looked at the method and it's getting more of a C# coding than just Powershelling.
    I'll will try to see how I can manage an existant connection but this seems quite blurry for me at this time. Will have to test this alot I think.

    Do you have any examples ? I can't find some on the net.

    Regards,
    Wes

    Monday, September 13, 2010 1:53 PM
  • Sure, but you can use these methods from PowerShell. Unfortunately I can't share my sample scripts for this at present
    Cheers
    Spence
    www.harbar.net
    Microsoft Certified Master | SharePoint 2010
    Microsoft Certified Master | SharePoint 2007
    Monday, September 13, 2010 10:02 PM
  • hi.. i have created synchronization connection using DirectoryServiceConnection method in powershell...Could anyone help me out in creating exclusion filter for users in synchronization connections using powershell.. Thanks in advance.... Vijai Anand.R
    Wednesday, December 22, 2010 4:54 AM
  • So, I've worked through all the PS scripting to set up the user profile sync service (include the sql ownership issues - thanks for the post).

    Now I'd like to move to the configuring of connections.  As I understand it, I need to get to the UserProfileConfigManager.  I run this code:

    $site= new-object Microsoft.SharePoint.SPSite("http://sp")
    $servercontext=[Microsoft.Office.Server.SPServerContext]::GetContext($site)
    $upcm = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($servercontext)
    
    

    and I get "New-Object : Exception calling ".ctor" with "1" argument(s): "Object reference not set to an instance of an object.""

    I've got 2010 with Dec 2010 cum.  My url is pointing to my claims site (over FBA).  I've never run a profile import.

    Am I on the right path?


    GregM
    Friday, January 21, 2011 6:45 PM
  • Greg, I got that exception as well and it (in my case) had do to do with permissions (in getting the UserProfileConfigManager).

    I added my service account to both the Administrators as well as the Permissions (not sure if both are needed). I still had issues getting the ConnectionManager though (only on one environment, but not another).

    
    $site = get-spsite $siteURL
    $context = [microsoft.sharepoint.spservicecontext]::getcontext($site)
    $upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigmanager($context)
    $connectionManager = $upcm.ConnectionManager
    $connection = $cm["Default"] #change to your name

    Thursday, November 15, 2012 12:03 AM