Thursday, March 29, 2007

Mail Enable a User using a script

Another Script - This one is to mail-enable a user using a vbs script. With very little work, you could use this to mail-enable a list of users... but, I will leave that up to you.


MailboxEnableUser.vbs

UserDN = "CN=cn-name,OU=OU-name,DC=company,DC=com"
MBoxDN = "CN=Mailbox Store (Server),CN=First Storage Group,CN=Store,CN=ServerName,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=Domain,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=Company,DC=Com"

'Set objUser = GetObject("LDAP://" & UserDN)
Set objMailboxStore = GetObject("LDAP://" & UserDN)
objMailboxStore.CreateMailbox MboxDN

3 comments:

TCarson said...

This script does not mail enable a user...it mailBOX enables a user. IOW it creates a mailbox on the Exchange server.

There is a difference. :)

Tim

Very Lost said...

Okay Point.. But.. So.. So what? You don't say.. I am going to add a mailbox to a security group... You say, I am going to mail-enable a group. ie.. Mail-Enabled Security Group...

DUH....

BTW, Check you English before you post to a public website.. it mailBOX enables a user...

Unknown said...

There is actually a difference... Mail enable is like creating a contact, but mailbox enabling is creating a mailbox. Mail Enable a user doesn't create the box on the servers.