Solved

Exporting Users from Active Directory with Account Options

Posted on 2013-05-11
1
401 Views
Last Modified: 2013-06-04
Hi,

I need to export the user's list from Active directory with "Account Option", like password never expires, user cannot change password...etc, for each users in an excel.

I know how to export user's . so please donot respond with that answer.

Regards
0
Comment
Question by:skoshy123
1 Comment
 
LVL 10

Accepted Solution

by:
Prashant Girennavar earned 250 total points
Comment Utility
If you use powershell,

Please use below code.

 
import-module activedirectory
$Users = Get-ADUser -Filter * -searchbase "dc=contoso,dc=com"
$info = @()
Foreach($User in $USers)
{
$info+= $USer | Select-Object @{l='DirectoryName';E={$_.SamAccountName}},@{l='Email';E={$_.Mail}},@{l='DisplayName';E={$_.Displayname}},@{l='AccountEnabled';E={$_.Enabled}},@{l='Name';E={$_.Name}},@{l='LastName';E={$_.Surname}},@{l='phone';E={$_.MobilePhone}} ,@{l='UserCanChangePassword';E={$_.CannotChangePassword}}
}
$info>>C:\Useraccount.txt

Open in new window


Please change the DN name DC=contoso,dc=com according to your domain name

Thanks,

-Prashant Girennavar.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I have been working as System Administrators since 2003. I recently started working as a FreeLancer and was amazed to find out that very few people are taking full advantage of their Windows Server Machines. Microsoft Windows Server comes with so…
I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now