Re: adding Account Scripts
- From: Luiz <Luiz@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 6 Mar 2007 13:50:05 -0800
Thank you, Kevin.
Regards.
Luiz
"Kevin C" wrote:
FYI:.
The script i posted was not working exactly how I originally wrote it ... i
took that from a larger script that i had created. I found my original
script, you give it a full first and last name of a person and it will auto
create a username and create the user set active ect.
if the user's name was John Doe His useraccount would be jdoe
because i'm worried about line clipping i put it online for you to download
just change the extention to .vbs
http://weblabtechs.com/downloads/userbasic.txt
--
Kevin Callanan
MSCA 2003, A+, Network+
www.weblabtechs.com
Please let us know if this response was helpful...
"Luiz" wrote:
Thank you, Kevin.
Best Regards.
Luiz
"Kevin C" wrote:
'## Kevin Callanan
'/ Make Sure You Change 'User Info and Set objDomain to = Your Domain
CONST ENABLE_USER_ACCOUNT = 512
'User Info
StrSAMAccount = "UserName"
strGivenName = "FirstName"
strSN = "LastName"
strDisplayName = "DisplayName"
strDescription = "Description"
strPassword = "0000"
'User Info
strOU = "OU=Temp,"
strDC = "dc=COTOSO,dc=COM"
strLDAPLocation = strOU & strDC
Set objDomain = GetObject("LDAP://dc=CONTOSO,dc=COM")
Set objOU = GetObject("LDAP://" & strLDAPLocation)
Set objUser = objOU.Create("User", "cn= " & strSAMAccount)
objUser.Put "sAMAccountName", strSAMAccount
objUser.Put "givenName", strGivenName
objUser.Put "sn", strSN
objUser.Put "displayName", strDisplayName
objUser.Put "Description", strDescription
objUser.SetInfo
Set objUser = GetObject("LDAP://cn=" & strSAMAccount & "," & strLDAPLocation)
objUser.SetPassword strDefaultPass
objUser.Put "userAccountControl", ENABLE_USER_ACCOUNT
objUser.SetInfo
--
Kevin Callanan
MSCA 2003, A+, Network+
www.weblabtechs.com
Please let us know if this response was helpful...
"Luiz" wrote:
Hi E C H,
This is for W2K3.
Thank you.
Luiz
"E C H (He of too much code)" wrote:
Is this for a win2k and above environment?
Luiz wrote:
Hi,
I need a script to add account in my AD with name, last name, initial
password, enable account.
Does anyone can help me, please?
Thanks.
Regards.
- References:
- Re: adding Account Scripts
- From: E C H (He of too much code)
- Re: adding Account Scripts
- From: Kevin C
- Re: adding Account Scripts
- From: Luiz
- Re: adding Account Scripts
- From: Kevin C
- Re: adding Account Scripts
- Prev by Date: Re: Help with reading XML via VBScript
- Next by Date: Re: Version Check
- Previous by thread: Re: adding Account Scripts
- Next by thread: get ready for 3-11 time change
- Index(es):
Relevant Pages
|