Link to home
Start Free TrialLog in
Avatar of cowiekspert
cowiekspert

asked on

Create user with vbs in Exchange 2007

Hi

I have the following vbs code that creates a user in AD and adjoining Exchange account.  This code has worked fine with Exchange 2003, but with Exchange 2007 the Exchange account that is created is of type legacy and does not work.  Help&.
user="nnn"
Set objOU = GetObject("LDAP://cn=users,dc=interconsult,dc=com") 
Set objUser = objOU.Create("User", "cn=" & user)
objUser.Put "sAMAccountName",user
objUser.SetInfo
MailServer="ICGTRD241"
MBXStoreDN ="LDAP://CN=Mailbox Database,CN=First Storage Group,CN=InformationStore,CN=" & MailServer & ",CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=Interconsult ASA,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=interconsult,DC=com"
Set ExchUser = objUser
ExchUser.CreateMailbox(MBXStoreDN)
ExchUser.SetInfo
objUser.Close

Open in new window

Avatar of callieman
callieman
Flag of Netherlands image

ASKER CERTIFIED SOLUTION
Avatar of BSonPosh
BSonPosh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
any news here?