Re: adding Account Scripts

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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.

.



Relevant Pages

  • Re: Weird usage of printf/scanf? Why do they work?
    ... programming assignments. ... Script started on Mon Sep 7 14:47:00 2009 ... darwin:~ kevin$ ls *.c ...
    (comp.lang.c)
  • Re: Easy GPO Question - Setting Registry Keys
    ... > Hello Kevin, ... In this GPO I defined a logon script which ... >>> isn't local administrator of his client. ... >>> users local Administrators of their machines ... ...
    (microsoft.public.windows.group_policy)
  • Re: howto determine if IE is in protected mode?
    ... Kevin Yu wrote: ... we can use IEIsProtectedModeProcess function to determine whether IE is running under protected mode. ... However, on page script, we can only try executing something that is not allowed in protected mode and catch the exception to determine it. ...
    (microsoft.public.scripting.jscript)
  • Re: TDBC drivers available as Win32 binaries
    ... Thanks, Kevin. ... The INSTALL.tcl script didn't work for me. ... I've packaged pre-built binaries of the packages: ... To install them, download the file 'tdbc1.0b6-win32-drivers.ZIP'. ...
    (comp.lang.tcl)
  • Re: Firewall & Routing - help! (PROBLEM SOLVED!)
    ... At 22:40 6/10/2004, Kevin F. Berrien wrote: ... Gonna test my script some more, ... >settings in a notebook, and do it all over again for the production install. ...
    (Fedora)