I have to access user profile application for user profile manipulation by Power shell.
Environment
I have two user profile application installed in my farm.
I wrote this code:
$site = new-object Microsoft.SharePoint.SPSite(" GUID XXXXXXXXXX);
$ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site);
$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
The Problem is this code always point to the same (first created user profile).
I changed the GUID to point to the second profile application but it point that.
Please Help.
Environment
I have two user profile application installed in my farm.
I wrote this code:
$site = new-object Microsoft.SharePoint.SPSite(" GUID XXXXXXXXXX);
$ServiceContext = [Microsoft.SharePoint.SPServiceContext]::GetContext($site);
$ProfileManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
The Problem is this code always point to the same (first created user profile).
I changed the GUID to point to the second profile application but it point that.
Please Help.