Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Change contact information from Active Directory from all users by query

Posted on 2011-03-09
1
Medium Priority
?
443 Views
Last Modified: 2012-05-11
How can I export a user's list and contact information from Active Directory on a csv file and/ or run a query that help me change the username and email address from a list of users on Active Directory.
Let's say I have 500 users I need to make that change over those 2 fields mentioned above, is there any query that help me to do it automatically by parameters, instead of going one by one ?
Any help will be appreciated.
Thank you.
0
Comment
Question by:petrobraspai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 63

Accepted Solution

by:
SysExpert earned 2000 total points
ID: 35090016

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/2003_Server/Q_21439433.html
LDIFDE import/export for a Dummy

for deletion of users from a list
Try this script.It was given to me by Farhan and its a great one...

:: ===============
:: READ THIS FIRST
:: ===============
:: * This script require "UserIDs.txt" file on C: drive root from where it will pick computer names.
:: * Successful run will generate "DisableUserRpt.txt" file on C: drive root.
:: * Copy and paste following script in notepad and save it with any name having .cmd extension.
:: *** SCRIPT START ***

@Echo Off
SETLOCAL EnableDelayedExpansion
IF NOT EXIST C:\UserIDs.txt Goto ShowErr
FOR %%R IN (UserIDs.txt) Do IF %%~zR EQU 0 Goto ShowErr
IF EXIST C:\DisableUserRpt.txt DEL /F /Q C:\DisableUserRpt.txt

FOR /F %%c IN ('Type C:\UserIDs.txt') Do (
    Echo Processing: %%c
    DSQuery User -samid %%c | Find /I "CN=" >NUL
    IF NOT ErrorLevel 1 (
            DSQuery User -samid %%c |DSMod User -disabled yes >>C:\DisableUserRpt.txt
      ) ELSE (Echo %%c: ERROR - User NOT Found in AD. >>C:\DisableUserRpt.txt)
)
Goto EndScript
:ShowErr
Echo "C:\UserIDs.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: *** SCRIPT END ***

Hi!

You can use CSVDE or LDIFDE, both tools have some limitations, I prefer to use LDIFDE:
http://support.microsoft.com/kb/555634
http://support.microsoft.com/kb/327620
Try here http://www.computerperformance.co.uk/vbscript/vbscript_user_spreadsheet.htm

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_2003_Active_Directory/Q_22927314.html



I hope this helps !
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
How to deal with a specific error when using the Enable-RemoteMailbox cmdlet to create a mailbox in the cloud-based service, for an existing user in an on-premises Active Directory.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

715 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