+ Post New Thread
Results 1 to 4 of 4
Scripts Thread, VBScript Help - Provisioning AD Users in Coding and Web Development; Hi all, Having my first real go at producing a vbscript to provision users (including creating exchange mailboxes) with data ...
  1. #1

    Join Date
    Sep 2008
    Posts
    132
    Thank Post
    15
    Thanked 11 Times in 8 Posts
    Rep Power
    14

    VBScript Help - Provisioning AD Users

    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:

    Code:
    '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

  2. #2

    Join Date
    Sep 2008
    Posts
    132
    Thank Post
    15
    Thanked 11 Times in 8 Posts
    Rep Power
    14
    sorted... the "N" needed to be "N:"

  3. #3
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42
    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.

  4. #4

    Join Date
    Sep 2008
    Posts
    132
    Thank Post
    15
    Thanked 11 Times in 8 Posts
    Rep Power
    14
    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...

SHARE:
+ Post New Thread

Similar Threads

  1. Exchange AD users and computers
    By browolf in forum Windows
    Replies: 0
    Last Post: 4th December 2006, 10:59 AM
  2. Essential add-on for AD Users & Computers
    By ajbritton in forum Downloads
    Replies: 9
    Last Post: 10th August 2006, 02:08 PM
  3. AD user field Labels
    By Gatt in forum Windows
    Replies: 4
    Last Post: 9th July 2006, 11:03 AM
  4. Replies: 22
    Last Post: 15th May 2006, 10:50 AM
  5. AD User Manager
    By Dos_Box in forum Downloads
    Replies: 0
    Last Post: 27th September 2005, 09:56 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •