Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network

Please refer to the original post as not all the script may be visible here.

This script should create a new user in AD as well as a new mailbox on an Exchange server. Use this one with caution, I haven’t really tested it yet.

Code: Select all
Option Explicit

Dim RootDSE, myDomain
Set RootDSE = GetObject("LDAP://RootDSE")
Set myDomain = GetObject("LDAP://" & RootDSE.Get("DefaultNamingContext"))

myDomainADSPath = myDomain.ADSPath      ' LDAP://DC=myDomain,DC=com
myDomainPath = MID(myDomain.ADSPath,8)   'DC=myDomain,DC=com

strTitle = "New User with Exchange Mailbox"
strUserName = InputBox("What is the name of the new user?", strTitle, "John Doe")
strSAM = InputBox("What will the be the user's SAMAccount name?", strTitle, "JDoe")

By admin

Former Freehand Freelance Graphic Illustrator... been online since 2004 ( late starter ), blogging since 2005, presently writing a suspense-thriller e-book that began as a screenplay.