Display 'Manager' Property of AD User
Best Answer
-
Leigh_Kilday Member Ninja IT Monkey ✭✭✭✭I played around with this a few months ago and couldn't get it to show. I think that relationship is not in the User CI class that the portal uses.
Now, I actively avoid using the Manager property as populated by SCSM because it has a few issues that make it unsuitable:- SCSM's AD connector only adds managers, never removing the old relationships.
- Using the "Line manager to review" (or whatever it is called) does not refer to the Affected User, but the Created By user.
- Users changing their manager have to wait for DC replication and the next connector sync for the manager to be reflected in SCSM.
6
Answers
Now, I actively avoid using the Manager property as populated by SCSM because it has a few issues that make it unsuitable:
- SCSM's AD connector only adds managers, never removing the old relationships.
- Using the "Line manager to review" (or whatever it is called) does not refer to the Affected User, but the Created By user.
- Users changing their manager have to wait for DC replication and the next connector sync for the manager to be reflected in SCSM.
I'm using Cireson PowerShell Activities and SMA to query Active Directory directly for the current Manager.Thanks, Leigh. The "Line Manger to review" using the created by user is one of the hurdles we're looking to overcome.
I'm looking to create a PSA to create a review activity with the Affected User's manager as the reviewer once I get time. If anyone your or anyone else has any code they can share to that affect, I'd be very grateful.
- PSA script that gets the Affected User and then invokes a SMA script, passing it the Affected User's UPN.
- The SMA script queries AD and returns the manager's UPN back to the PSA script.
- PSA script uses the UPN to return the SCSM user and adds them as a reviewer to any RA with "Manager" in the title.
The reason I've used the SMA script to get the AD manager is that I need to pass credentials with the query to AD since it counts as a double-hop and needs CredSSP.By the way, creating a custom PowerShell module for SCSM is a great idea as it allows you to keep your code in the PSAs to the bare minimum, allowing you to change the content without having to manually refresh every template.