CyBeRkId2002 Posted April 20, 2012 Posted April 20, 2012 Hi all, Having my first real go at producing a vbscript to provision users (including creating exchange mailboxes) with data entry fields for surname, forname, username and group (Years 7,8,9 or Staff). I am almost there but I am struggling with something small and I can't work out why! Here is the provisioning part of the script: 'Create User Account in AD Set objOU = GetObject(userLDAP) Set objUser = objOU.Create("User", "cn="&userName) objUser.Put "sAMAccountName", userName objUser.Put "givenName", userForename objUser.Put "sn", userSurname objUser.Put "displayName", userForename & " " & userSurname objUser.Put "userPrincipalName", userName&"@brockingtoncc.internal" objUser.Put "sAMAccountName", userName objUser.SetInfo objUser.SetPassword("passwordhere") objUser.pwdLastSet = 0 objUser.AccountDisabled = FALSE objUser.SetInfo objUser.Put "profilePath", userProfile & userName objUser.Put "homeDirectory", userHome & userName objUser.Put "homeDrive", "N" objUser.SetInfo All the variables being called are absolutely correct and fine. Users provision absolutely fine with the correct fields being populated but when logging on users don't see the N:\ home drive in My Computer. When clicking on My Computer it is mapped correctly and works fine but users have got so used to clicking My Computer > N:\ that I don't want to have to say that is no longer available. If I go into AD, change the drive letter to something else, then immediately back to N:\ and click apply when I log-on it works fine. It's like it needs another switch turning on but I cannot for the life of me work out where I am going wrong. Any advise would be very, very much appreciated! Michael
apeo Posted April 20, 2012 Posted April 20, 2012 Fyi if you have Exchange 2010 (probably 2007 too), I dont think you can create mailboxes using vbs but if you have Exchange 2003 then I have a script that create mailboxes. I could be wrong but the only way is using powershell. If you do find a way then I'd be interested.
CyBeRkId2002 Posted April 20, 2012 Author Posted April 20, 2012 We are on Exchange 2007 at present and I have created a powershell script at present which will provision users based on users name and place them in the correct DB dependent on whether they are staff or students. The final step of the script will be to call the powershell script and, hopefully, parse through username and staff/student details so it doesn't ask for them again...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now