Just made the jump from Help Desk to Infrastructure and I am suddenly wish I used PowerShell for more than a glorified command prompt before now. Hopefully my first question is a really easy one for the seasoned pros:
Get-ADUser -Identity <SAMAcountname. -Property Manager gives the manager in the common name format… How can I get this result as SAMAccountName (FirstInitialLastName)?
The end goal here is to enter the SAMAccountName as an extensionAttribute, which will translate to a Custom Attribute in Exchange, allowing me to create a dynamic distribution group for a manager and all of their direct reports. I figure this is the easiest approach but if I am wrong, call me on it, I’m here to learn. Thanks in advance for your time!
This will only show me the managers of the users (not users themselves). I assume I will need to add a | ft SAMAccountName,Manager somewhere but I am unsure of how to work that in with the right syntax…
I feel pretty lame bringing basics like this up but I am spinning my wheels at this point… My copy of “Learn Windows PowerShell in a Month of Lunches, Third Edition” is in the mail, I swear!