Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Creating a new user in ADAM

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Creating a new user in ADAM
  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 >>
 Creating a new user in ADAM - 4/30/2008 8:15:19 AM   
  srinivenkatesan

 

Posts: 2
Score: 0
Joined: 4/30/2008
Status: offline
I am trying to create a list of users from Active Directory to an ADAM instance(Active Directory Application Mode). So I took a snippet to
create a single user. I am not sure, why I get a  naming violation on the last statement in the following script.(objUser.SetInfo ).
Any help is appreciated !!

' The following code will add a new user to an ADAM instance
'---------------- SCRIPT CONFIGURATION -----------------
strComputerName = "localhost" ' Use "localhost" for the local computer
strPort = "389"           ' the LDAP port number to connect to
strAppPart = "ou=Adam users,o=Microsoft,c=US" ' ie "o=rallencorp,c=us"
Wscript.Echo  strAppPart
strUserDN = "Joe Smith"    ' ie "Joe Smith"
strUPN = "joe@rallencorp.com"     ' ie "joe@rallencorp.com"
'-------------------------------------------------------
Set objOU = GetObject("LDAP://" & strComputerName &  ":" & strPort &  "/" &  strAppPart)
objOU.Filter = Array("group")
for each obj in objOU
Wscript.Echo  obj.name
for each member in obj.Members
Wscript.Echo  member.name
next
next
Set objUser = objOU.Create("user", strUserDN)
objUser.Put "displayName", strUserDN 
objUser.Put "userPrincipalName", strUPN
objUser.SetInfo

Result Window:
C:\VBScripts>Cscript CreateUsers.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
ADAM_devinstance1 -- Running
ou=Adam users,o=Microsoft,c=US
CN=Adam Testers
CN=S-1-5-21-1169774684-3328196929-2088990163-500
CN=Mary Baker
C:\VBScripts\CreateUsers.vbs(45, 1) (null): There is a naming violation.

 
 
Post #: 1
 
 RE: Creating a new user in ADAM - 4/30/2008 8:29:22 AM   
  srinivenkatesan

 

Posts: 2
Score: 0
Joined: 4/30/2008
Status: offline
Fixed the issue, I Just have to change the name to
"CN=Joe Smith".

(in reply to srinivenkatesan)
 
 
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 >> Creating a new user in ADAM 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