Make a csv file with two columns. First is DN & second is Telephonenumber & use 
the below command to import them in AD.

admod -safety 1000 Telephonenumber::{{.}} -csv -expand -csvmodnull IGNORE < 
d:\telephone.csv

Dhiraj

From: David Lum [mailto:[email protected]]
Sent: Saturday, December 18, 2010 4:21 AM
To: NT System Admin Issues
Subject: RE: LDIFDE brain cramp

Thanks! The other nice thing about learning these tricks is keeping them around 
for later. What I find humorous is the Excel files I have to use as .CMD file 
templates. I use stuff like =C2&" "&D2&","E2 a lot! Drop in CSV data in front 
and away I go...

Dave

From: Michael B. Smith [mailto:[email protected]]
Sent: Friday, December 17, 2010 2:38 PM
To: NT System Admin Issues
Subject: RE: LDIFDE brain cramp

That's not cheating. I do it all the time.

Use the tools you are most effective with.

Regards,

Michael B. Smith
Consultant and Exchange MVP
http://TheEssentialExchange.com

From: David Lum [mailto:[email protected]]
Sent: Friday, December 17, 2010 4:35 PM
To: NT System Admin Issues
Subject: RE: LDIFDE brain cramp

I cheated, I used Excel and plopped adfind -b in a column ahead of the changes 
and saved it out to a .CMD file and made a couple tweaks to make that work. Not 
as flexible but did the trick, thanks!

Dave

From: Coleman, Hunter [mailto:[email protected]]
Sent: Friday, December 17, 2010 11:21 AM
To: NT System Admin Issues
Subject: RE: LDIFDE brain cramp

2 other things:

-You'll need to retype the command rather than copy/paste. Outlook tends to 
wreck the "-" character and convert it to an emdash, which hoses the command 
line.
-test it on one or two accounts before doing it on all of them

From: David Lum [mailto:[email protected]]
Sent: Friday, December 17, 2010 12:11 PM
To: NT System Admin Issues
Subject: RE: LDIFDE brain cramp

OH?  I can change my formatting to match that format easy. Does the admod you 
posted command need any changes other than the correct filename to work as is?

From: Coleman, Hunter [mailto:[email protected]]
Sent: Friday, December 17, 2010 10:58 AM
To: NT System Admin Issues
Subject: RE: LDIFDE brain cramp

If you have a text file that has your desired information in a format like
cn=David Lum,ou=Users,dc=domain,dc=nwea,dc=pvt;503-548-5229;5229

then you can run something like
for /f "tokens=1,2,3 delims=;" %1 in (yourFile.txt) do admod.exe -b "%1" 
"telephoneNumber::%2" "otherTelephone::%3"

From: David Lum [mailto:[email protected]]
Sent: Friday, December 17, 2010 11:39 AM
To: NT System Admin Issues
Subject: LDIFDE brain cramp

So I need to change 295 phone numbers in AD, and I could have SWORE I've done 
similar without too much headache, but it looks like taking an LDIFDE export 
and making it a "modify" is far more involved than an add.

Sample exported record:
dn: CN=David Lum,OU=Users, DC=Domain,DC=nwea,DC=pvt

changetype :add

telephoneNumber: 4311

otherTelephone: 971-222-1025


I need it to change to:
dn: CN=David Lum,OU=Users, DC=Domain,DC=nwea,DC=pvt

changetype :modify
replace: telephoneNumber

 telephoneNumber: 503-548-5229
-
Replace: otherTelephone
otherTelephone: 5229

I usually use Excel to handle repositioning/matching magic, but can't figure 
this one out and there has to be a better way.

Anyone?
David Lum // SYSTEMS ENGINEER
NORTHWEST EVALUATION ASSOCIATION
(Desk) 971.222.1025 // (Cell) 503.267.9764


~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
[email protected]<mailto:[email protected]>
with the body: unsubscribe ntsysadmin

________________________________
This email is confidential and intended only for the use of the individual or 
entity named above and may contain information that is privileged. If you are 
not the intended recipient, you are notified that any dissemination, 
distribution or copying of this email is strictly prohibited. If you have 
received this email in error, please notify us immediately by return email or 
telephone and destroy the original message. - This mail is sent via Sony Asia 
Pacific Mail Gateway..

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to