Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating email addresses 1

Status
Not open for further replies.

acl03

MIS
Jun 13, 2005
1,077
0
0
US
Is there a way to populate Active Directory users' email addresses?

All our email address are in the same format:

UserID@domain.com

So I would like to run a script that will populate a list of users's email addresses with their ID, followed by @domain.com.

Is this possible?
 
Oh - I probably should have mentioned that we don't use exchange :)

 
So what DO you use then?

I hope you find this post helpful.

Regards,

Mark
 
We use lotus notes. If i highlite a bunch of users who do have email addresses populated, and hit send mail, it opens up a new message addressed to all of the highlighted people.

I'm just looking for a way to script the population of the email addresses since they are all in a standard format...
 
OK, so you will want to populate the Mail field in AD for your users.

First bind to the user object as oUser then you can do this:

oUser.Put "mail", email
oUser.SetInfo


I hope you find this post helpful.

Regards,

Mark
 
Set objUser = GetObject _
("LDAP://cn=johnsmith,ou=management,dc=fabrikam,dc=com")


I hope you find this post helpful.

Regards,

Mark
 
This isn't working right (well, i'm not doing it right).

It's failing on the Set objUser line. Is johnsmith the user id in your example?
 
Yes, but you need to use the full username and have the right LDAP path. I suggest you use ADSIEdit to browse your ID and look at the distinguished name for your user.

I hope you find this post helpful.

Regards,

Mark
 
Now if you want to do that to a bunch of users, take a look at my FAQ for how to modify your script to make it Enterprise ready. faq329-4871

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top