cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Get a Users Manager from Web Service call

I'm able to successfully call the UserGroup.asmx, but I'm stuck on how to get the users manager from the userLoginName. Is there a listing of the properties that I can access from the web service call?

 

2015-11-09_14-41-42.png

 

2015-11-09_14-43-20.png

Labels: (1)
0 Kudos
Reply
3 Replies
Workflow Hero

Re: Get a Users Manager from Web Service call

Hey Jason,

The method you're calling won't return the manager I don't think. You can find the typical result from that webservice here: https://msdn.microsoft.com/en-us/library/ms774637(v=office.12).aspx

That being said, you could get it a couple of ways. One would be using the UserProfileService.asmx, GetUserProfileByName method. This returns all properties from the User Profile Service and you'd have to write some XPath to pull out the appropriate property.

The other way, if you're using SP2013, is you could use the REST services API. You can do this with a Web Request action instead of web service (be sure to change the type from POST to GET) and use this URL:

http://YOURWEBSITEURL/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,pr...'

Just replace the all caps sections and then store the result in a variable like you were doing with your webservice call. You'll still need to write some XPath to get the result out, but it will be a much simpler XPath. Here's an example of what this REST service would respond with:

<?xml version="1.0" encoding="utf-8"?><d:GetUserProfilePropertyFor xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">DOMAIN\USERNAME</d:GetUserProfilePropertyFor>

Good Luck!

Owen Runnals - General Networks

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Get a Users Manager from Web Service call

I'm going to go down the path of the REST API, and jQuery.

Thanks,

Jason

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Get a Users Manager from Web Service call

To get the standard function running check at SharePoint CA if the the app pool account (Nintex) has permissions to access User Profile Service AND Search DB. That worked for us.

Best Regards

Joergen

0 Kudos
Accept as Solution Reply