|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dire Need of Help PleaseI need a script that will create an OU called Jlab
then in the OU I need users 100-130 200-230 300-330 400-430 500-530 600-630 700-730 I need them to be enabled accounts please I have spen ALL day trying to get this to work I can't get them to work together please help Set objDomain = GetObject ("LDAP://dc=suma")
Set objOU = objDomain.Create ("organizationalUnit", "ou=jLab") objOU.SetInfo For i = 1 to 7 name = i & "00" & "-" & i & "30" Set objUser = objOU.Create ("user", "cn=" & name ) objUser.Put "sAMAccountName", name objUser.SetInfo objUser.AccountDisabled = False objUser.SetInfo Next -- Show quoteHide quoteurkec "Jason Weathers" wrote: > I need a script that will create an OU called Jlab > then in the OU I need users > 100-130 > 200-230 > 300-330 > 400-430 > 500-530 > 600-630 > 700-730 > > I need them to be enabled accounts > > please I have spen ALL day trying to get this to work I can't get them to > work together please help sorry was in a hurry when I wrote that this is what I need
i have a server 2003 domin of Lmsd.local I need an OU of jlab i need to make 200+ users with in the OU jlab example: jlab100 jlab101 jlab102 jlab103 and so on until jlab130 then i need the same thing for jlab200 thru jlab230 jlab300 thru jlab330 all the way to jlab700 - jlab730 with the account set enabled and set not to expire also i need a home path of H:\home\"then the user name" example H:\home\jlab100 and also a login name of jlab100 that is unique to each or the created 200+ users I am sorry for the confusion and thank you so much for your help I tried the script you wrote and it worked like a charm thank you for your respone urkec Jason Show quoteHide quote "urkec" wrote: > Set objDomain = GetObject ("LDAP://dc=suma") > > Set objOU = objDomain.Create ("organizationalUnit", "ou=jLab") > objOU.SetInfo > > For i = 1 to 7 > name = i & "00" & "-" & i & "30" > Set objUser = objOU.Create ("user", "cn=" & name ) > objUser.Put "sAMAccountName", name > objUser.SetInfo > objUser.AccountDisabled = False > objUser.SetInfo > Next > -- > urkec > > > "Jason Weathers" wrote: > > > I need a script that will create an OU called Jlab > > then in the OU I need users > > 100-130 > > 200-230 > > 300-330 > > 400-430 > > 500-530 > > 600-630 > > 700-730 > > > > I need them to be enabled accounts > > > > please I have spen ALL day trying to get this to work I can't get them to > > work together please help Set objDomain = GetObject ("LDAP://dc=test")
Set objOU = objDomain.Create ("organizationalUnit", "ou=jLab") objOU.SetInfo For i = 1 To 7 For j = 0 To 30 If j < 10 Then name = objOU.ou & Cstr (i) & "0" & Cstr (j) Else name = objOU.ou & i & CStr (j) End If Set objUser = objOU.Create ("user", "cn=" & name ) objUser.Put "sAMAccountName", name objUser.SetInfo objUser.AccountDisabled = False objUser.AccountExpirationDate = "01/01/1970" objUser.Put "userPrincipalName", name objUser.Put "homeDirectory", "\\test\home\" & name objUser.Put "homeDrive", "H:" objUser.SetInfo Next Next -- urkec you are a GOD my friend
Show quoteHide quote "urkec" wrote: > Set objDomain = GetObject ("LDAP://dc=test") > > Set objOU = objDomain.Create ("organizationalUnit", "ou=jLab") > objOU.SetInfo > > For i = 1 To 7 > For j = 0 To 30 > If j < 10 Then > name = objOU.ou & Cstr (i) & "0" & Cstr (j) > Else > name = objOU.ou & i & CStr (j) > End If > Set objUser = objOU.Create ("user", "cn=" & name ) > objUser.Put "sAMAccountName", name > objUser.SetInfo > objUser.AccountDisabled = False > objUser.AccountExpirationDate = "01/01/1970" > objUser.Put "userPrincipalName", name > objUser.Put "homeDirectory", "\\test\home\" & name > objUser.Put "homeDrive", "H:" > objUser.SetInfo > Next > Next > -- > urkec > > > |
|||||||||||||||||||||||