Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


have a new user on windows?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,591
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> have a new user on windows?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 have a new user on windows? - 3/7/2002 4:11:59 AM   
  yoyok

 

Posts: 2
Score: 0
Joined: 3/7/2002
From: Germany
Status: offline
hello everyone,
who can help me with a vbscript to add a new user to a windows-client.
found a script at misos:
Option Explicit
Dim objAs, objUser, sUser
sUser = "Dummy"
Set objAs = GetObject("LDAP://omc.net")
Set objUser = objAs.Create("User", "CN=" & sUser)
objUser.FullName ="Dummy Big B"
objUser.Description = "Needs his own Server"
objUser.Put "samAccountName", sUser
objUser.Put "userPrincipalName", "dummy@omc.net"
objUser.SetInfo
WScript.Echo "Benutzer " & sUser & " angelegt"
but my vb says no LDAP-server.
which is true, but where lse can put the needed infos, and which infos does windows need at that point?

yoyok
 
 
Post #: 1
 
 Re: have a new user on windows? - 3/7/2002 6:50:00 PM   
  Tory

 

Posts: 16
Score: 0
Joined: 11/13/2001
From: USA
Status: offline
Use the WinNT Provider instead. I know the code below will add a user but I don't know
all of the user properties off the top of my head and I couldn't find them listed anywhere. Once you find the property list for the WinNT providers user method you can fill in more than just the user name. It will be something like user.description = "Big time User" and user.fn = "Full Name Here" then when your all done you do the user.SetInfo .

If anybody has a good reference for the ADSI WinNT provider that will tell us what user properties we can use please post it. At this point I'm not 100 percent sure you can do anything more than add the user. I just sort of ass-u-me'd....

UPDATE: I found this - http://www.swynk.com/winscript/SCRIPT_Usrmgmt.asp
Pretty good use of all the fields.


-Tory


'domain can be a real domain name or a local server name Tjami is my Win2K Pro PC
domain="TJami"
User="jdoe"

Set Domain = GetObject("WinNT://" & domain)
Set User = domain.Create ("user", user)
User.SetInfo
Set domain=Nothing
Set user=Nothing



Edited by - tory on 03/08/2002 00:56:47

(in reply to yoyok)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> have a new user on windows? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts