Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form or script to create users 1

Status
Not open for further replies.

Trekk

Programmer
Aug 16, 2001
66
US
I have had no luck with this
I need to create a form or script for the HR department that will allow them to do the following when a new employee starts

Create a new user account in AD (First name Last name, Username) or have the code auto create the username from the values from the first and last name
Choose which OU to place the user in (there are 4 OUs that represent different divisions on our company)

My manager does not want them to use the MMC


Any help would be greatly appreciated

Thank you
 
you may want to ask around the VBScript forum.
 
Is the name/username the only thing that is going to get populated like this? Some companies like to have the entire account created with all the "goodies" (address, phone number, memberships, etc.,etc.) added as well. Is this something you planned on doing?
 
No, we are using a new SAP app for address etc, Our HR department only needs to create a user in the department OU in which they are being hired for
 
Let me see if I can dig up my .asp form that I have for this.....
 
I only found the rough draft that I did before I got it working. Take this over to the guys in the VBScript forum, and they should be able to get this working perfect. I may have gotten the rough from them to begin with....

Code:
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<p align="center"><font face="Arial Black"><big>Adding personnel</big></font></p>
<p align="center">&nbsp;

</p>
<p align="center">&nbsp;</p>
<INPUT type=button NAME="Add Personnel" value="Add person">
<Script For="Add Personnel" Event="onclick" LANGUAGE="VBScript">
<script>

Username = InputBox "Username:"
Accountname = InputBox "Accountname:"
Message = "Enter the OU this account will go to:" & vbCRLF &  _ 
vbCRLF & "Human Resources" & vbCRLF _
& vbCRLF _
& "Sales" & vbCRLF _
& vbCRLF _
& "Manufacturing" & vbCRLF _
& vbCRLF _
& "Management" & vbCRLF _
& vbCRLF _
number = InputBox(Message, Title, default, 100, 100)
Set objRoot = GetObject("LDAP://rootDSE")
Set objUsers = GetObject("LDAP://" & username & "," & objRoot.Get("DefaultNamingContext"))
Set objUser = objOU.Create("user", & Username &)
objUser.Put "sAMAccountName", & Accountname &
objUser.SetInfo

</script>

</body>

</html>
 
Thank you very much
This gives me a place to start

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top