Answer the question
In order to leave comments, you need to log in
PowerShell - How to display parent and top user manager from Active Directory?
Good afternoon.
Created a script that displays the following data about a user from Active Directory:
SamAccountName - User name
displayName - Display name
Created - Date of user creation
Enabled - Active or not (True/false)
Manager - Superordinate manager (line in the organization)
AccountExpirationDate - Expiration date user expiration date
Get-ADUser -Filter {SamAccountName -like "UserPrefix*"} -Properties * ` -SearchBase "OU=Users,OU=OU,OU=Sites,OU=COMPANY,DC=domain,DC=com" |
select SamAccountName, displayName, Created, Enabled, @{Name='Manager'; Expression={(Get-AdUser $_.Manager -Properties DisplayName).DisplayName}}, AccountExpirationDate |
Export-CSV "Final15.csv"
Answer the question
In order to leave comments, you need to log in
1. In the user accounts in AD there is a "head" field, who prevents you from using it normally?
2. psh has a provider for accessing AD, and then technet.microsoft.com/en-us/library/ee617195.aspx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question