TJOSY
asked on
VBScript or PowerShell for to generate report from Active Directory
Hi, require assistance to generate report (csv or xls) from Active Directory for users with below information. The script should be able to customize to specific AD OU's.
The report should have following information in the excel\csv:-
Account (enable or disabled)
Account with Expire (yes or no)
Expiry date (if expiry enabled)
HIDDEN FROM ADDRESS LIST (yes or no)
displayName
mail
samAccountName
Description
title
department
telephoneNumber
MOBILE
Manager
physicalDeliveryOfficeName ,
Company
Thank you..
The report should have following information in the excel\csv:-
Account (enable or disabled)
Account with Expire (yes or no)
Expiry date (if expiry enabled)
HIDDEN FROM ADDRESS LIST (yes or no)
displayName
samAccountName
Description
title
department
telephoneNumber
MOBILE
Manager
physicalDeliveryOfficeName
Company
Thank you..
Just another note, what version of Exchange are you running? You might need to add the following snapin to each of the scripts for the version of Exchange you are running.
Exchange 2007 - add-pssnapin microsoft.exchange.managem ent.powers hell.admin
Exchange 2010 - add-pssnapin microsoft.exchange.managem ent.powers hell.E2010
Exchange 2013 - add-pssnapin microsoft.exchange.managem ent.powers hell.E2013
Will.
Exchange 2007 - add-pssnapin microsoft.exchange.managem
Exchange 2010 - add-pssnapin microsoft.exchange.managem
Exchange 2013 - add-pssnapin microsoft.exchange.managem
Will.
ASKER
Thank you Will. infact im getting error while running the first script.
im using exchange 2013. can you guide me where to place "add-pssnapin microsoft.exchange.managem ent.powers hell.E2013 " command to the script
im using exchange 2013. can you guide me where to place "add-pssnapin microsoft.exchange.managem
ASKER
Need your help to get the result in the attached format
Export-Template.csv
Export-Template.csv
Unfortunately, because we are using hash tables to grab the data from multiple cmdlets this is the only way to present the data. However, you removed the attribute HiddenFromAddressList this command would be much easier, because you can just use a single cmdlet.
Will.
Will.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also do you have a list of users or you just want to query all users in your domain?
This will get all info from all AD Accounts in your environment
Open in new window
If you want to do it from a txt file use the below command...
Open in new window
Running this command for a single user
Open in new window
Will.