Here is my situation, I have a farm that has two profile service applications. One is a standard user profile service application, the other is a replicated profile service application. They each run on different servers.
The standard commands for PowerShell to grab and interact with the profile application is as follows:
$site = get-spsite https:/siteurl $context = Get-SpserviceContext $site $profilemanager = New-object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
Then to check if which profile Service the manager is connected to I just have it output the profile count
The result is always around 40,000 which means it is connected to the my replicated profile service.
I want to connect to the normal profile service so I can interact with profiles programmatically.
Anyone have any ideas how I can connect to either profile service via powershell?