473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

VB Script for New User on AD

16
Help! I am getting an error in this script. It is my first attempt at creating a script to create a new user in Active Directory.

Expand|Select|Wrap|Line Numbers
  1. 'New User
  2.  
  3. firstname = InputBox("Enter First Name: ")
  4. lastname = InputBox("Enter Last Name: ")
  5. username = InputBox("Enter username: ")
  6.  
  7.  
  8. Set objOU = GetObject("LDAP://OU=xxx,dc=xxx,dc=xxx")
  9.  
  10. Set objUser = objOU.Create("User", "cn=" & username)
  11.  
  12. objUser.Put "sAMAccountName", username
  13. objUser.Put "Description", "Intern"
  14.  
  15. objUser.SetPassword "W3lcome"
  16.  
  17. objUser.AccountDisabled = False
  18.  
  19. objUser.Put "givenName", firstname
  20.  
  21. objUser.Put "sn", lastname
  22.  
  23. strNewProfilePath = "\\servername\Profiles\" & username
  24. objUser.Put "profilePath", strNewProfilePath
  25.  
  26. objUser.Put "scriptPath", "logon.wsf"
  27.  
  28. objUser.Put "homeDirectory", "\\servername\Users" & username
  29. objUser.Put "homeDrive", "H:"
  30.  
  31. objUser.SetInfo

The Error is: There is no such object on the server.
It is occuring at char 1 of: objUser.SetPassword "W3lcome"

Thanks for the help all!
Feb 23 '07 #1
2 3625
willakawill
1,646 1GB
Moved you here. Thought you might get a better response
Feb 23 '07 #2
Cyberdyne
627 Expert 512MB
Mikael take a look at THIS from microsoft as it contains script information relevant to your task.

Cyber.
Feb 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dmitry | last post by:
Hi folks! I need to find a way to switch to a different Unix user from within the Perl script that is currently ran unattended. Script must switch user in order to execute proper profile for...
6
by: Clay Beatty | last post by:
When you create database diagrams in Enterprise Manager, the details for constructing those diagrams is saved into the dtproperties table. This table includes an image field which contains most of...
4
by: Hal | last post by:
Can someone please tell me what is wrong with this script? <script language="JavaScript"> <!-- function HF_CloseAllChildren() { if (g_win1) != undefined { if ((g_win1) && !(g_win1.closed))...
17
by: comp.lang.tcl | last post by:
The TCL command I am using will do a command-line action on a PHP script: set cannotRunPHP I have to do it this way as both the TCL script and the PHP script run as CLI. However, "info.php"...
2
by: ern | last post by:
My command-line application must be able to run text scripts (macros). The scripts have commands, comments, and flags. Comments are ignored (maybe they are any line beginning with " ; ") Commands...
11
by: Dave Schwimmer | last post by:
I am relatively new to PHP. One of the things that seems glaring obvious to me (coming from a C/C++ background) is how 'open' everything seems - (AFAIK). For instance, URLs typically have the name...
9
by: niteck07 | last post by:
I am using following shell script to ftp files to another server but this is failing as the shell script changes the user name for the ftp login the correct user name is 'ag\invprint' which the...
2
by: Henry Hollenberg | last post by:
Hello, I have written a script that uses environment variables set during a particular users login in ".bash_profile" and ".profile". I have changed to that users uid and gid in my python...
82
by: happyse27 | last post by:
Hi All, I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters? Two codes below : a)...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.