Login | |
|
 |
RE: Re: Create User Script - 7/11/2005 5:07:12 AM
|
|
 |
|
| |
esnmb
Posts: 431
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
|
Here is the HTML for the checkbox: <input type="checkbox" name="CreateMail" value="CreateMail" checked="Checked">Create Mailbox<br> ' Notice the checked="Checked". This sets the default value to checked. Then in my script section I would have this: If CreateMail.Checked Then ' Creates the users mailbox Set oIADSUser = GetObject("LDAP://CN=" & strCN & "," & strLDAP) oIADSUser.CreateMailbox "LDAP://CN=Mailbox Store (EXCHANGE),CN=First Storage Group,CN=InformationStore,CN=EXCHANGE,CN=Servers,CN=MIDDLETOWN,CN=Administrative Groups,CN=DOMAIN,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=com" oIADSUser.SetInfo End If
< Message edited by esnmb -- 1/2/2007 5:29:41 AM >
|
|
| |
|
|
|
 |
RE: Re: Create User Script - 7/11/2005 9:02:51 PM
|
|
 |
|
| |
sdeklerk
Posts: 16
Score: 0
Joined: 6/28/2005
From: the Netherlands
Status: offline
|
couldn't you use something like this then: If CreateMail.Checked = TRUE Then 'Action 1 Set oIADSUser = GetObject("LDAP://CN=" & strCN & "," & strLDAP) oIADSUser.CreateMailbox "LDAP://CN=Mailbox Store (EXCHANGE),CN=First Storage Group,CN=InformationStore,CN=EXCHANGE,CN=Servers,CN=MIDDLETOWN,CN=Administrative Groups,CN=DOMAIN,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=com" oIADSUser.SetInfo ElseIf CreateMail.Checked = FALSE Then 'Action 2 'state your code here End If
< Message edited by esnmb -- 1/2/2007 5:35:59 AM >
|
|
| |
|
|
|
 |
RE: Re: Create User Script - 7/12/2005 2:36:04 AM
|
|
 |
|
| |
cjwallace
Posts: 484
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
|
Hi Guys. Thanks for the help so far. I am not sure how to do this. Basically this script below will create a user who is in the family department within my firm. What i would like to do is have on the main page 6 checkbox's for each of the departments and depending on which department is selected it will create the user. Can anyone help me with this, what i have tied really messed my script up. I am just trying to have one script that will each department rather than 6 scripts to maintain The Script so Far: <html> <HTA:APPLICATION APPLICATIONNAME="Withers LLP AD Account Creation" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="normal" > <head> <title>Withers LLP User Account Creation Form</title> <style type="text/css"> <!-- .style3 {font-size: 13px} body,td,th { font-family: Arial, Helvetica, sans-serif; } .style2 { font-family: Arial, Helvetica, sans-serif; font-size: 13.5pt; color: #CC6600; font-weight: bold; } .style5 {font-size: small; color: #FF0000; } .style6 {color: #FF0000} --> </style> <script type="text/vbscript"> 'This section is the error reporting for the application Sub CreateAccount strUser = TextBox0.Value If strUser = "" Then MsgBox "You're missing required fields.",64, "Alert" Exit Sub End If strFirst = TextBox1.Value If strFirst = "" Then MsgBox "You're missing required fields",64, "Alert" Exit Sub End If strInitial = TextBox2.Value strLast = TextBox3.Value If strLast = "" Then MsgBox "You're missing required fields",64, "Alert" Exit Sub End If strDisplay = strFirst & ", " & strLast strCN = strFirst & "\, " & strLast Const ADS_UF_ACCOUNTDISABLE = 2 Const ADS_PROPERTY_UPDATE = 2 ' This section will create the user & set part of the General Page. Set objOU = GetObject("LDAP://OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") Set objUser = objOU.Create("User", "cn=" & strCN) objUser.Put "sAMAccountName", LCase(strUser) objUser.Put "userPrincipalName", strUser & "@withers.net" objUser.SetInfo objUser.Put "givenName", strFirst If strInitial <> "" Then objUser.Put "initials", strInitial End If objUser.Put "sn", strLast objUser.Put "displayName", strDisplay ' This section will assign the user a standard password objUser.SetPassword "Passw0rd" objUser.Put "pwdLastSet", 0 intUAC = objUser.Get("userAccountControl") If intUAC And ADS_UF_ACCOUNTDISABLE Then objUser.Put"userAccountControl", intUAC Xor ADS_UF_ACCOUNTDISABLE End If objUser.SetInfo ' Address Page Information Set objUser = GetObject _ ("LDAP://cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objUser.Put "streetAddress", "16 Old Bailey" objUser.Put "l", "London" objUser.Put "postalCode", "EC4M 7EG" objUser.Put "c", "GB" objUser.SetInfo ' General Page Information objUser.Put "physicalDeliveryOfficeName", "London" objUser.Put "telephoneNumber", "+44 (0)20 7597" objUser.Put "mail", strFirst & "." & strLast & "@withersworldwide.com" objUser.Put "wWWHomePage", "http://www.withersworldwide.com" objUser.SetInfo ' Users Telephone Information objUser.Put "facsimileTelephoneNumber", "+44 (0)20 7597 6543" objUser.SetInfo ' Organization Information objUser.Put "department", "Family Department" objUser.Put "company", "Withers LLP" objUser.SetInfo 'This Section Will Add the user to the Withers standard Security Groups Const ADS_PROPERTY_APPEND = 3 Set objGroup = GetObject _ ("LDAP://cn=LN London Users,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo Set objGroup = GetObject _ ("LDAP://cn=LN Family,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo Set objGroup = GetObject _ ("LDAP://cn=LN GWArchive,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo ' Creates where the users Roaming Profile will be stored based on Checkbox selection. If CreateProfile.Checked = TRUE Then 'Action 1 ' Users Profile Information objUser.Put "profilePath", "\\LNFS01\LNGlobalProfiles$\" & strUser & "" ElseIf CreateProfile.Checked = FALSE Then 'Action 2 ' Users Profile Information objUser.Put "profilePath", "\\LNFS01\Profiles$\" & strUser & "" End If ' Users Home Drive Information objUser.Put "homeDirectory", "\\LNFS01\Home$\" & strUser & "" objUser.Put "homeDrive", "H" objUser.SetInfo 'This Section will Create The Users Home Drive on \\lnfs01\home$ Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.CreateFolder("\\LNFS01\home$\" & strUser) 'This Section will give the user change NTFS permissions to their home drives. Set objShell = CreateObject("Wscript.Shell") strDest = "\\LNFS01\home$\" & strUser objShell.Run ("SetACL.exe -on """ & strDest & """ -ot file -actn ace " & "-ace ""n:WITHERS.net\" & strUser & ";p:change""") 'This Section will create the Groupwise Archive Folder on \\LNFS01\GWArchive$\%username% Set objFolder = objFSO.CreateFolder("\\LNFS01\GWArchive\" & strUser) ' Will Disbale User Account based on Checkbox selection. If DisableAccount.Checked Then ' Disables The User Account rem Const ADS_UF_ACCOUNTDISABLE = 2 Set objUser = GetObject _ ("LDAP://cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") intUAC = objUser.Get("userAccountControl") objUser.Put "userAccountControl", intUAC OR ADS_UF_ACCOUNTDISABLE objUser.SetInfo End If End Sub Sub Reload location.Reload(True) End Sub Sub bodyLoaded() window.ResizeTo 400,685 ' WIDTH, HEIGHT End Sub </script> </head> <body onLoad="bodyLoaded()"> <p><img src="withers.bmp" width="286" height="92"></p> <p class="style2" align="left"> <font color="#CC6600"> Account Creation Page</font></p> <table width="369" border="0" align="left" height="208"> <tr> <td width="187" height="25"><span class="style5"><b>*</b></span>Login ID: </td> <td width="173" height="25"><input type="text" name="textbox0" size="23"></td> </tr> <tr> <td width="187" height="25"><span class="style5"><b>*</b></span>First Name:</td> <td width="173" height="25"><input type="text" name="textbox1" size="23"></td> </tr> <tr> <td width="187" height="25">Middle Initial: </td> <td width="173" height="25"><input type="text" name="textbox2" size="23"></td> </tr> <tr> <td width="187" height="25"><span class="style5"><b>*</b></span>Last Name: </td> <td width="173" height="25"><input type="text" name="textbox3" size="23"></td> <tr> <td width="187" height="20"><font color="#FF0000"><b>User Options</b></font> </td> <td width="173" height="20"></td> <tr> <td width="187" height="38">International roaming </td> <td width="173" height="38"><input type="checkbox" name="CreateProfile" value="CreateProfile"></td> </tr> <tr> <td width="187" height="38">Disable User Account </td> <td width="173" height="38"><input type="checkbox" name="DisableAccount" value="DisableAccount"></td> </tr> </table> <br> <br> <br> <p><br> </p> <p> <br> </p> <p> <br> <br> <br> <br> <br> <br> <br> <input type="button" name="Submit" value="Submit" onClick="CreateAccount"> </p> <p>The new employee will also be required <br> to change their password at first logon. </p> <p class="style3"><b><span class="style6">*</span> </b> Indicates Required Field</p> <p> <input id="reloadbutton" class="button" type="reset" value="Clear Form" name="reload_button" onClick="Reload"> </p> <p> <input type="button" value=" Exit " name="close_button" onClick="Self.Close"><br> <br> </p> </body> </html>
|
|
| |
|
|
|
 |
RE: Re: Create User Script - 7/12/2005 7:38:42 AM
|
|
 |
|
| |
ExHorn04
Posts: 4
Score: 0
Joined: 6/8/2005
From: USA
Status: offline
|
quote:
ORIGINAL: esnmb Here is the HTML for the checkbox: <input type="checkbox" name="CreateMail" value="CreateMail" checked="Checked">Create Mailbox<br> ' Notice the checked="Checked". This sets the default value to checked. Then in my script section I would have this: If CreateMail.Checked Then ' Creates the users mailbox Set oIADSUser = GetObject("LDAP://CN=" & strCN & "," & strLDAP) oIADSUser.CreateMailbox "LDAP://CN=Mailbox Store (EXCHANGE),CN=First Storage Group,CN=InformationStore,CN=EXCHANGE,CN=Servers,CN=MIDDLETOWN,CN=Administrative Groups,CN=DOMAIN,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=DOMAIN,DC=com" oIADSUser.SetInfo End If When attempting to do this I am getting an error that states that createmail does not have a value when referencing: If CreateMail.Checked Then Do I need to add anything else to the code to allow it to recognize that it is checked? I basically mirrored what is above, but I changed mailbox location, but it does not get that far to error our there if there in fact is an error. Thanks. Chris
< Message edited by esnmb -- 1/2/2007 5:36:20 AM >
|
|
| |
|
|
|
 |
RE: Re: Create User Script - 7/12/2005 7:40:23 AM
|
|
 |
|
| |
ExHorn04
Posts: 4
Score: 0
Joined: 6/8/2005
From: USA
Status: offline
|
quote:
ORIGINAL: cjwallace Hi Guys. Thanks for the help so far. I am not sure how to do this. Basically this script below will create a user who is in the family department within my firm. What i would like to do is have on the main page 6 checkbox's for each of the departments and depending on which department is selected it will create the user. Can anyone help me with this, what i have tied really messed my script up. I am just trying to have one script that will each department rather than 6 scripts to maintain The Script so Far: <html> <HTA:APPLICATION APPLICATIONNAME="Withers LLP AD Account Creation" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="normal" > <head> <title>Withers LLP User Account Creation Form</title> <style type="text/css"> <!-- .style3 {font-size: 13px} body,td,th { font-family: Arial, Helvetica, sans-serif; } .style2 { font-family: Arial, Helvetica, sans-serif; font-size: 13.5pt; color: #CC6600; font-weight: bold; } .style5 {font-size: small; color: #FF0000; } .style6 {color: #FF0000} --> </style> <script type="text/vbscript"> 'This section is the error reporting for the application Sub CreateAccount strUser = TextBox0.Value If strUser = "" Then MsgBox "You're missing required fields.",64, "Alert" Exit Sub End If strFirst = TextBox1.Value If strFirst = "" Then MsgBox "You're missing required fields",64, "Alert" Exit Sub End If strInitial = TextBox2.Value strLast = TextBox3.Value If strLast = "" Then MsgBox "You're missing required fields",64, "Alert" Exit Sub End If strDisplay = strFirst & ", " & strLast strCN = strFirst & "\, " & strLast Const ADS_UF_ACCOUNTDISABLE = 2 Const ADS_PROPERTY_UPDATE = 2 ' This section will create the user & set part of the General Page. Set objOU = GetObject("LDAP://OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") Set objUser = objOU.Create("User", "cn=" & strCN) objUser.Put "sAMAccountName", LCase(strUser) objUser.Put "userPrincipalName", strUser & "@withers.net" objUser.SetInfo objUser.Put "givenName", strFirst If strInitial <> "" Then objUser.Put "initials", strInitial End If objUser.Put "sn", strLast objUser.Put "displayName", strDisplay ' This section will assign the user a standard password objUser.SetPassword "Passw0rd" objUser.Put "pwdLastSet", 0 intUAC = objUser.Get("userAccountControl") If intUAC And ADS_UF_ACCOUNTDISABLE Then objUser.Put"userAccountControl", intUAC Xor ADS_UF_ACCOUNTDISABLE End If objUser.SetInfo ' Address Page Information Set objUser = GetObject _ ("LDAP://cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objUser.Put "streetAddress", "16 Old Bailey" objUser.Put "l", "London" objUser.Put "postalCode", "EC4M 7EG" objUser.Put "c", "GB" objUser.SetInfo ' General Page Information objUser.Put "physicalDeliveryOfficeName", "London" objUser.Put "telephoneNumber", "+44 (0)20 7597" objUser.Put "mail", strFirst & "." & strLast & "@withersworldwide.com" objUser.Put "wWWHomePage", "http://www.withersworldwide.com" objUser.SetInfo ' Users Telephone Information objUser.Put "facsimileTelephoneNumber", "+44 (0)20 7597 6543" objUser.SetInfo ' Organization Information objUser.Put "department", "Family Department" objUser.Put "company", "Withers LLP" objUser.SetInfo 'This Section Will Add the user to the Withers standard Security Groups Const ADS_PROPERTY_APPEND = 3 Set objGroup = GetObject _ ("LDAP://cn=LN London Users,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo Set objGroup = GetObject _ ("LDAP://cn=LN Family,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo Set objGroup = GetObject _ ("LDAP://cn=LN GWArchive,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo ' Creates where the users Roaming Profile will be stored based on Checkbox selection. If CreateProfile.Checked = TRUE Then 'Action 1 ' Users Profile Information objUser.Put "profilePath", "\\LNFS01\LNGlobalProfiles$\" & strUser & "" ElseIf CreateProfile.Checked = FALSE Then 'Action 2 ' Users Profile Information objUser.Put "profilePath", "\\LNFS01\Profiles$\" & strUser & "" End If ' Users Home Drive Information objUser.Put "homeDirectory", "\\LNFS01\Home$\" & strUser & "" objUser.Put "homeDrive", "H" objUser.SetInfo 'This Section will Create The Users Home Drive on \\lnfs01\home$ Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.CreateFolder("\\LNFS01\home$\" & strUser) 'This Section will give the user change NTFS permissions to their home drives. Set objShell = CreateObject("Wscript.Shell") strDest = "\\LNFS01\home$\" & strUser objShell.Run ("SetACL.exe -on """ & strDest & """ -ot file -actn ace " & "-ace ""n:WITHERS.net\" & strUser & ";p:change""") 'This Section will create the Groupwise Archive Folder on \\LNFS01\GWArchive$\%username% Set objFolder = objFSO.CreateFolder("\\LNFS01\GWArchive\" & strUser) ' Will Disbale User Account based on Checkbox selection. If DisableAccount.Checked Then ' Disables The User Account rem Const ADS_UF_ACCOUNTDISABLE = 2 Set objUser = GetObject _ ("LDAP://cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") intUAC = objUser.Get("userAccountControl") objUser.Put "userAccountControl", intUAC OR ADS_UF_ACCOUNTDISABLE objUser.SetInfo End If End Sub Sub Reload location.Reload(True) End Sub Sub bodyLoaded() window.ResizeTo 400,685 ' WIDTH, HEIGHT End Sub </script> </head> <body onLoad="bodyLoaded()"> <p><img src="withers.bmp" width="286" height="92"></p> <p class="style2" align="left"> <font color="#CC6600"> Account Creation Page</font></p> <table width="369" border="0" align="left" height="208"> <tr> <td width="187" height="25"><span class="style5"><b>*</b></span>Login ID: </td> <td width="173" height="25"><input type="text" name="textbox0" size="23"></td> </tr> <tr> <td width="187" height="25"><span class="style5"><b>*</b></span>First Name:</td> <td width="173" height="25"><input type="text" name="textbox1" size="23"></td> </tr> <tr> <td width="187" height="25">Middle Initial: </td> <td width="173" height="25"><input type="text" name="textbox2" size="23"></td> </tr> <tr> <td width="187" height="25"><span class="style5"><b>*</b></span>Last Name: </td> <td width="173" height="25"><input type="text" name="textbox3" size="23"></td> <tr> <td width="187" height="20"><font color="#FF0000"><b>User Options</b></font> </td> <td width="173" height="20"></td> <tr> <td width="187" height="38">International roaming </td> <td width="173" height="38"><input type="checkbox" name="CreateProfile" value="CreateProfile"></td> </tr> <tr> <td width="187" height="38">Disable User Account </td> <td width="173" height="38"><input type="checkbox" name="DisableAccount" value="DisableAccount"></td> </tr> </table> <br> <br> <br> <p><br> </p> <p> <br> </p> <p> <br> <br> <br> <br> <br> <br> <br> <input type="button" name="Submit" value="Submit" onClick="CreateAccount"> </p> <p>The new employee will also be required <br> to change their password at first logon. </p> <p class="style3"><b><span class="style6">*</span> </b> Indicates Required Field</p> <p> <input id="reloadbutton" class="button" type="reset" value="Clear Form" name="reload_button" onClick="Reload"> </p> <p> <input type="button" value=" Exit " name="close_button" onClick="Self.Close"><br> <br> </p> </body> </html> Are you not automatically creating an email address for your users?
|
|
| |
|
|
|
 |
RE: Re: Create User Script - 7/18/2005 10:36:27 PM
|
|
 |
|
| |
Cary Shultz
Posts: 4
Score: 0
Joined: 7/1/2005
From: USA
Status: offline
|
Now, that would have been a good idea, huh? No, in my haste I did not include this line.....I did catch this, however, and added it and everything works very well now. I should have posted that I found the culprit ( me! ). Do you have any tips on enummerating all of the OUs in the AD environment and having them populoate the drop down list for the creation of the user account object? I will be playing with this and trying to figure it out. Being new to something is sometimes a lot of fun, sometimes a little frustrating. But it is the discovery process along the way that is a lot of fun! So, if there were five OUs in the environment all five of them would show up in the drop down list. I have not yet played with your forms suggestion. Have not yet had the time, to be honest. Will in the next couple days, though. Thanks, Cary
|
|
| |
|
|
|
 |
RE: Re: Create User Script - 7/25/2005 8:15:10 AM
|
|
 |
|
| |
cjwallace
Posts: 484
Score: 0
Joined: 3/5/2005
From: United Kingdom
Status: offline
|
Hi Guys, sorry i have not been on for a whille. Below is a copy of my script so far. As you can see from the bold section i am using check boxs to perform where the users profile is stored. i would like to use a drop down menu. Can someone explain how i can use dropdown menu? Many thanks ===================================================================== <html> <HTA:APPLICATION APPLICATIONNAME="Withers LLP AD Account Creation" SCROLL="no" SINGLEINSTANCE="yes" WINDOWSTATE="normal" > <head> <title>Withers LLP User Account Creation Form</title> <style type="text/css"> <!-- .style3 {font-size: 13px} body,td,th { font-family: Arial, Helvetica, sans-serif; } .style2 { font-family: Arial, Helvetica, sans-serif; font-size: 13.5pt; color: #CC6600; font-weight: bold; } .style5 {font-size: small; color: #FF0000; } .style6 {color: #FF0000} --> </style> <script type="text/vbscript"> 'This section is the error reporting for the application Sub CreateAccount strUser = TextBox0.Value If strUser = "" Then MsgBox "You're missing required fields.",64, "Alert" Exit Sub End If strFirst = TextBox1.Value If strFirst = "" Then MsgBox "You're missing required fields",64, "Alert" Exit Sub End If strInitial = TextBox2.Value strLast = TextBox3.Value If strLast = "" Then MsgBox "You're missing required fields",64, "Alert" Exit Sub End If strDisplay = strFirst & ", " & strLast strCN = strFirst & "\, " & strLast Const ADS_UF_ACCOUNTDISABLE = 2 Const ADS_PROPERTY_UPDATE = 2 ' This section will create the user & set part of the General Page. Set objOU = GetObject("LDAP://OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") Set objUser = objOU.Create("User", "cn=" & strCN) objUser.Put "sAMAccountName", LCase(strUser) objUser.Put "userPrincipalName", strUser & "@withers.net" objUser.SetInfo objUser.Put "givenName", strFirst If strInitial <> "" Then objUser.Put "initials", strInitial End If objUser.Put "sn", strLast objUser.Put "displayName", strDisplay ' This section will assign the user a standard password objUser.SetPassword "Passw0rd" objUser.Put "pwdLastSet", 0 intUAC = objUser.Get("userAccountControl") If intUAC And ADS_UF_ACCOUNTDISABLE Then objUser.Put"userAccountControl", intUAC Xor ADS_UF_ACCOUNTDISABLE End If objUser.SetInfo ' Address Page Information Set objUser = GetObject _ ("LDAP://cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objUser.Put "streetAddress", "16 Old Bailey" objUser.Put "l", "London" objUser.Put "postalCode", "EC4M 7EG" objUser.Put "c", "GB" objUser.SetInfo ' General Page Information objUser.Put "physicalDeliveryOfficeName", "London" objUser.Put "telephoneNumber", "+44 (0)20 7597" objUser.Put "mail", strFirst & "." & strLast & "@withersworldwide.com" objUser.Put "wWWHomePage", "http://www.withersworldwide.com" objUser.SetInfo ' Users Telephone Information objUser.Put "facsimileTelephoneNumber", "+44 (0)20 7597 6543" objUser.SetInfo ' Organization Information objUser.Put "department", "Family Department" objUser.Put "company", "Withers LLP" objUser.SetInfo 'This Section Will Add the user to the Withers standard Security Groups Const ADS_PROPERTY_APPEND = 3 Set objGroup = GetObject _ ("LDAP://cn=LN London Users,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo Set objGroup = GetObject _ ("LDAP://cn=LN Family,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo Set objGroup = GetObject _ ("LDAP://cn=LN GWArchive,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.PutEx ADS_PROPERTY_APPEND, _ "member", Array("cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") objGroup.SetInfo ' Creates where the users Roaming Profile will be stored based on Checkbox selection. If CreateProfile.Checked = TRUE Then 'Action 1 ' Users Profile Information objUser.Put "profilePath", "\\LNFS01\LNGlobalProfiles$\" & strUser & "" ElseIf CreateProfile.Checked = FALSE Then 'Action 2 ' Users Profile Information objUser.Put "profilePath", "\\LNFS01\Profiles$\" & strUser & "" End If ' Users Home Drive Information objUser.Put "homeDirectory", "\\LNFS01\Home$\" & strUser & "" objUser.Put "homeDrive", "H" objUser.SetInfo 'This Section will Create The Users Home Drive on \\lnfs01\home$ Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.CreateFolder("\\LNFS01\home$\" & strUser) 'This Section will give the user change NTFS permissions to their home drives. Set objShell = CreateObject("Wscript.Shell") strDest = "\\LNFS01\home$\" & strUser objShell.Run ("SetACL.exe -on """ & strDest & """ -ot file -actn ace " & "-ace ""n:WITHERS.net\" & strUser & ";p:change""") 'This Section will create the Groupwise Archive Folder on \\LNFS01\GWArchive$\%username% Set objFolder = objFSO.CreateFolder("\\LNFS01\GWArchive\" & strUser) ' Will Disbale User Account based on Checkbox selection. If DisableAccount.Checked Then ' Disables The User Account Set objUser = GetObject _ ("LDAP://cn=" & strCN & ",OU=FAMILY,OU=LONDON USERS,OU=WITHERS USERS,dc=withers,dc=net") intUAC = objUser.Get("userAccountControl") objUser.Put "userAccountControl", intUAC OR ADS_UF_ACCOUNTDISABLE objUser.SetInfo End If End Sub Sub Reload location.Reload(True) End Sub Sub bodyLoaded() window.ResizeTo 510,545 ' WIDTH, HEIGHT End Sub </script> </head> <body onLoad="bodyLoaded()"> <p align="center"><img src="withers.bmp" width="286" height="92"></p> <p class="style2" align="left"> <font color="#CC6600"> Account Creation Page User Options</font></p> <table width="272" border="0" align="left" height="59"> <tr> <td width="94" height="10"><span class="style5"><b>*</b></span>Login ID: </td> <td width="173" height="10"><input type="text" name="textbox0" size="23"></td> </tr> <tr> <td width="94" height="14"><span class="style5"><b>*</b></span>First Name:</td> <td width="173" height="14"><input type="text" name="textbox1" size="23"></td> </tr> <tr> <td width="94" height="13">Middle Initial: </td> <td width="173" height="13"><input type="text" name="textbox2" size="23"></td> </tr> <tr> <td width="94" height="1"><span class="style5"><b>*</b></span>Last Name: </td> <td width="173" height="1"><input type="text" name="textbox3" size="23"></td> </table> <table width="219" border="0" align="left" height="28"> <tr> <td width="187" height="1">London Fee Earner </td> <td width="23" height="1"><input type="checkbox" name="CreateProfile" value="CreateProfile"></td> </tr> <tr> <td width="187" height="1">Disable User Account </td> <td width="23" height="1"><input type="checkbox" name="DisableAccount" value="DisableAccount"></td> </tr> </table> <br> <br> <br> <br> <p> <br> <br> <br> </p> <p> <input type="button" name="Submit" value="Submit" onClick="CreateAccount"> </p> <p>The new employee will also be required <br> to change their password at first logon. </p> <p class="style3"><b><span class="style6">*</span> </b> Indicates Required Field</p> <p> <input id="reloadbutton" class="button" type="reset" value="Clear Form" name="reload_button" onClick="Reload"> <font </p> <p> <input type="button" value=" Exit " name="close_button" onClick="Self.Close"> </p> </body> </html>
|
|
| |
|
|
|
|