create a new user in AD as well as a new mailbox on an Exchange server

ORIGINALLY POSTED BY TALEN FOR THETAZZONE/TAZFORUM HERE

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")

Tags:

About the Author

admin has written 564 stories on this site.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

Copyright © 2009 TAZ: TheTAZZone Network. All rights reserved. Privacy Policy
Powered by WordPress.org, Custom Theme and ComFi.com Calling Card Company.