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 ?
there is no cmdlet specifically for this. you can do so by using the DirectoryServiceConnection methods
Microsoft Certified Master | SharePoint 2010
Microsoft Certified Master | SharePoint 2007
- Marked as answer by Lily Wu Friday, September 17, 2010 6:41 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.
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
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?
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