→ 🚀What's New? Explore Lansweeper's Fall 2024 Updates! Fall Launch Blog !

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rarmstrong
Engaged Sweeper II

I'm looking to get the manager name from a user and pass it to a script for maintenance.

{manager} is not an option that works but it is the name of the ad field.


I'm able to pass {username} to my script -(powershell)- but I need to get the ad user's manager as well.

Any help would be greatly appreciated!

Thanks!

2 REPLIES 2
rarmstrong
Engaged Sweeper II
Thank you SO much! It works perfectly!
i_kulgu
Champion Sweeper
You can use this in your powershell script to find the manager :

$manager = (get-aduser (get-aduser $user -Properties manager).manager).samaccountName

Then you can use $manager where you want to.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now