To get username and email in Active Directory accounts using PowerShell, can be done easily if AD Powershell Modules cmdlets is loaded on the system. Check out this link if PowerShell AD module is not loaded: http://mikepfeiffer.net/2010/01/how-to-install-the-active-directory-module-for-windows-powershell/ Codes below will get all user accounts in Active Directory. Code below will display Name, UserPrincipalName and EmailAddress. Get-ADUser -Filter * | FT Name,UserPrincipalName,EmailAddress -AutoSize Name is the user account complete name (First name, Surname). UPN or UserPrincipalName is the domain account name for logon purposes. Email Address the email account address set on the user account property. Code below will display UserName, Email Address and PasswordLastSet (if PasswordLastSet data is available it will be displayed) Get-ADUser -Properties * -Filter * | FT Name,EmailAddress,PasswordLastSet -AutoSize Display user ...
Make the world a better place by sharing knowledge, ideas and anything that you can give that comes from the heart.