Basically I am making a timer job to send a birthdayWish email fetched from SharePoint userprofile service. But problem is I have multiple userprofile services on server.
like 1). userprofile service1
2). userprofile service2
3). userprofile service3
4). userprofile service4
So how to use 2nd user-profile service.
Here's some code, that I did:
SPServiceContext oServiceContext = SPServiceContext.GetContext(SPServiceApplicationProxyGroup.Default, SPSiteSubscriptionIdentifier.Default);
UserProfileManager oProfileManager = new UserProfileManager(oServiceContext);
So here in SPServiceApplicationProxyGroup.Default its getting 1st user-profile.
Among them I want to use 2nd user-profile service. but by default when trying to access its getting 1st user-profile service and iterate through it.
So how to set it to use 2nd user-profile service.
My guess is that you have one User Profile Service Instance (UPS) with multiple User Profile Service Applications (UPA) on it (and not multiple UPS):