Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

For each users in list -  'using last name and first name' get login name in Active Directory

Posted on 2012-09-05
11
Medium Priority
?
41 Views
Last Modified: 2015-08-14
I am trying to do the following...I have a list of users with last name, first name. I would like like to query AD and get their logon name. THANKS!
0
Comment
Question by:dekhan
  • 4
  • 3
  • 2
9 Comments
 
LVL 23

Expert Comment

by:Stelian Stan
ID: 38368514
Run this in powershell:
Get-ADUser -filter * -Properties Name | ft UserPrincipalName
0
 
LVL 23

Accepted Solution

by:
Stelian Stan earned 800 total points
ID: 38368788
or
Get-ADUser -filter * -Properties Name | ft UserPrincipalName | Out-File D:\t.txt

to export to a TXT file
0
 

Author Comment

by:dekhan
ID: 38369207
Hi sorry I forgot to mentioned that client is running AD 2003
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
LVL 24

Expert Comment

by:yo_bee
ID: 38370456
does not make a difference.  You can run PS Get-ADUser against AD 2003
0
 
LVL 24

Assisted Solution

by:yo_bee
yo_bee earned 1200 total points
ID: 38370465
Do you have any WIndows 7 Machines with RSAT installed?
0
 
LVL 24

Assisted Solution

by:yo_bee
yo_bee earned 1200 total points
ID: 38370498
What about using ADUC Saved Queries option.
Create a new User Query
Call it "Users"
Add the colums that you wish to have (First, Last and User Logon Name)
Then export this to a txt file and you are all set.
You may need to do a Find and Replace on the user Logon Name because it adds the @Domain.local to the end of each one. I do not think that is a deal breaker.


http://technet.microsoft.com/en-us/library/cc757566(v=ws.10).aspx
0
 

Author Comment

by:dekhan
ID: 38372317
hi guys thanks for for the suggestions...however i am receiving the following error message from where ever i run the commands from:

WARNING: Error initializing default drive: 'Unable to find a default server with Active Directory Web Services
running.'.
0
 
LVL 23

Assisted Solution

by:Stelian Stan
Stelian Stan earned 800 total points
ID: 38372385
Are running for a domain controller or from your workstation. If you are running from your workstation with Windows 7 you need to install RSAT (http://www.microsoft.com/en-ca/download/details.aspx?id=7887).  

To install RSAT: http://technet.microsoft.com/en-us/library/ee449483%28v=ws.10%29.aspx
0
 
LVL 24

Assisted Solution

by:yo_bee
yo_bee earned 1200 total points
ID: 38372498
Here is an option that will work for AD 2003 no matter what.

User csvde command for your AD machine with an account that has rights.

csvde -f c:\users.csv -r objectClass=user -l sn,givenName,sAMAccountName

Open in new window

0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

Question has a verified solution.

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

Here's a look at newsworthy articles and community happenings during the last month.
Scripts are great for performing batch jobs against users, however sometimes the GUI is all you need.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

578 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