Solved

Exporting Users from Active Directory with Account Options

Posted on 2013-05-11
1
404 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
ID: 39159197
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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
OfficeMate Freezes on login or does not load after login credentials are input.
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…

778 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