Thanks Bonnie,

 

That was right, I had missed the mailenabled line off J

 

Cheers

 

Olly




 

From: Miller Bonnie L. [mailto:[EMAIL PROTECTED] 
Sent: 28 August 2008 15:57
To: NT System Admin Issues
Subject: RE: AD/Exch2003 Script help

 

Are you mail-enabling the contact objects after they are created (like
you would with Exchange tools)?  I'm not really a vb person, but I don't
see any reference to that...

 

-Bonnie

 

From: Oliver Marshall [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 28, 2008 6:32 AM
To: NT System Admin Issues
Subject: AD/Exch2003 Script help

 

Hi chaps,

 

I have a script which I have been using to easily add contacts and have
them added to a group on the sbs box here. However, I've just realised
that contacts added to the server using this script never show up in
Outlooks Address Book. Closer hunting showed that they don't show up
when checking the results of the GAL or the All Contacts group in
exchange.

 

This is the script. Is there anything that I have missed to get the
contacts added to the GAL ?

****************************************************

dim u

dim e

dim d

dim UsrReturn

 

u=inputbox("Enter Name of Contact","Information","Name")

e=inputbox("Enter Email of contact","Information","Email")

d=inputbox("Enter optional description of
contact","Information","Description")

 

Set objOU =
GetObject("LDAP://OU=Contacts,OU=MyBusiness,dc=MyClient,dc=local")

 

'Get the Group Object

Set objGroup = GetObject("LDAP://cn=DISTi,OU=Distribution
Groups,OU=MyBusiness,dc=MyClient,dc=local") 

If Err <> 0 Then 

msbox "Error " & Hex(Err)

End If 

Err.Clear

 

'Create the Contact Object

Set objUser = objOU.Create("contact", "cn=" & u)

 

If Err <> 0 Then 

msgbox "Error " & Hex(Err)

End If 

Err.Clear

 

'Set the additional info

if e<>"" then

                objUser.put "Mail",e 

else

                msgbox "Email Blank"

 

end if

objUser.Put "Description",d

objUser.SetInfo

 

usrReturn=msgbox("Would you like " & n & " added to the DISTi list?",
VBYesNo + VBQuestion)

 

if usrReturn = vbYES then

  'Set the Group Membership

  objGroup.Add(objUser.AdsPath)

  objGroup.SetInfo

end if

****************************************************

 

Olly

 

 

 

 

 

 

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

Reply via email to