Hey,
Working on a script to disable user accounts, and i got a request to add a function so that everytime a user gets disabled the script sends a mail to that users boss/bosses.
Since we have all bosses as ManagedBy in AD for their respective groups i will need to get the data from the groups. Any ideas on how to proceed?
Tried fiddling with "Get-ADUser -Identity $UserName -Properties MemberOf" but can't really pipe the information to usefull variables.