Active directory users

Diaonic

Senior member
May 3, 2002
305
0
0
Is it possible to create multiple users in active directory from the command and specify parameters such as:

Home folder
Profile location
logon script
Group memberships


I have a lot of users that I need to impliment and any time I could save would be huge.


Thanks in advance.
 

Diaonic

Senior member
May 3, 2002
305
0
0
Yea i'v looked at that before. Have really what I'm looking for. I need to create about 200 accounts from either a tab delimited or excel spread sheet and import them into active directory. When they import I want a default password on all accounts and I need to put them into a particular OU and group.


 

Diaonic

Senior member
May 3, 2002
305
0
0
This is the closest i'v got. This creates a users with specified parameters but it doesn't import from an external source.


' -------------------------------------------------------------------------
' From the book Inside Active Directory, ISBN 0-201-61621-1
' Copyright (C) 2002 by Addison-Wesley
' Script by Sakari Kouti (see http://www.kouti.com)
' You have a royalty-free right to use, modify, reproduce and distribute
' this script (and/or any modified version) in any way you find useful,
' provided that you agree that Addison-Wesley or Sakari Kouti has no
' warranty, obligations or liability for the script. If you modify
' the script, you must retain this copyright notice.
' -------------------------------------------------------------------------
Option Explicit
Const UF_SMARTCARD_REQUIRED = &H40000
Call CreateUser("Jack", "Brown")
Sub CreateUser(strFirstName, strLastName)
Dim objContainer, objUser, objLargeInt, strSAMName, intUserFlags
Set objContainer = _
GetObject("LDAP://OU=Sales,DC=sanao,DC=com")
Set objUser = objContainer.Create("user", _
"CN=" & strLastName & " " & strFirstName)
'The Essential Properties
'-----------------------
strSAMName = strFirstName & Left(strLastName, 1)
Call objUser.Put("sAMAccountName", strSAMName)
Call objUser.Put("userAccountControl", &H200)
Call objUser.Put("userPrincipalName", _
strFirstName & "." & strLastName & "@sanao.com")
objUser.SetInfo
objUser.SetPassword ("secret")
objUser.GetInfo
'The Significant Properties
'-------------------------
Call objUser.Put("profilePath", "\\dc1\Prof$\" & strSAMName)
'We let Group Policy take care of the logon script setting
Call objUser.Put("homeDirectory", "\\dc1\" & strSAMName)
Call objUser.Put("homeDrive", "H:")
'User must NOT change password at next logon
Set objLargeInt = CreateObject("LargeInteger")
objLargeInt.LowPart = &HFFFFFFFF
objLargeInt.HighPart = &HFFFFFFFF
Call objUser.Put("pwdLastSet", objLargeInt)
objUser.AccountDisabled = True
intUserFlags = objUser.Get("userAccountControl")
intUserFlags = intUserFlags Or UF_SMARTCARD_REQUIRED
'If we wanted to clear a setting instead of setting it:
'intUserFlags = intUserFlags And Not UF_SMARTCARD_REQUIRED
Call objUser.Put("userAccountControl", intUserFlags)
'The Informational Properties
'-------------------------
Call objUser.Put("givenName", strFirstName)
Call objUser.Put("initials", _
Left(strFirstName, 1) & Left(strLastName, 1))
Call objUser.Put("sn", strLastName)
Call objUser.Put("displayName", strFirstName & " " & strLastName)
Call objUser.Put("telephoneNumber", "555-4268")
Call objUser.Put("otherTelephone", Array("555-6122", "555-7991"))
CH11-08 ADSI Create a User with More Attributes.vbs

objUser.SetInfo
Set objUser = Nothing
End Sub
CH11-08 ADSI Create a User with More Attributes.vbs

 

Diaonic

Senior member
May 3, 2002
305
0
0
I haven't exported the users yet. But it will be very simple.

Firstname, Lastname

and I would like to add them to "Class of 2010" group and "all students"


Thanks for all the responses thus far, i'm getting closer.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
have you looked into a netsh script? I think it can add entries to AD. I wrote a simple perl script that would pull info line by line to add entries to the DHCP server of our domain, I would think you could do the same thing with users. I think i had a comma seperated line that had IP,MAC Addy, Description.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |