[THIN] Re: OT: populate AD user info

  • From: "Paul DeHaan" <wppad@xxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Wed, 14 Jan 2004 17:12:04 -0500

Nothing like a slick vbscript using a little adsi!  If you're not into 
scripting... good luck and start with cwashington.netreach.net.  Here's a 
sample of how you would create a user and add info to a few fields.  You'll 
have to look around to figure out the other field names I don't list.  The code 
might wrap.

'On error resume next
Set ou = GetObject("LDAP://OU=Users,OU=,dc=ms,dc=com";)
Set usr = ou.Create("user", "CN=jSmith")

'--- Mandatory Attributes----
usr.Put "samAccountName", "jsmith"

'---- Optional Attributes, you can optionally skip these----

usr.Put "sn", "Smith - SN"
usr.Put "givenName", "John - given"
usr.Put "displayname", "John Smith - display"
usr.Put "name", "jsmith"
usr.Put "description", "Charlotte - description 1"
usr.Put "userPrincipalName", "jsmith@xxxxxx"
usr.Put "physicalDeliveryOfficeName", "Charlotte"
usr.Put "title", "Test account - Paul D."
usr.Put "homedirectory", "\\rober\script\jsmith"
usr.Put "homedrive", "H:"
usr.Put "scriptpath", "slogon.bat"
usr.SetInfo

'--Now that the user is created, reset the user's password and
'--enable its account

usr.SetPassword "secret***!"
usr.AccountDisabled = True
usr.SetInfo

Have fun!

Paul DeHaan CISSP, CCNA, CCA...
Network Administrator
J.M. Huber Corp.

------------>
"The information transmitted is intended only for the person or entity to which 
it is addressed and may contain confidential, proprietary, and/or privileged 
material.  Any review, retransmission, dissemination or other use of, or taking 
of any action in reliance upon, this information by persons or entities other 
than the intended recipient is prohibited.  If you received this in error, 
please contact the sender and delete the material from all computers."

>>> roger.riggins@xxxxxxxxxx 01/14/04 03:08PM >>>
Anybody know of a way to get user info (name, job title, phone numbers,
etc.) entered into AD other than us manually entering the stuff?

 

Roger Riggins

Network Administrator

CCA, CCNA, MCSE

w: 319.352.2630 x306

c: 319-290-5687

 

Lutheran Services in Iowa

http://www.lsiowa.org 

 

 


Notice of Confidentiality:
This e-mail and any attachments may contain privileged and/or confidential 
information. This e-mail is intended solely for the use of the individual or 
entity to which it is addressed. If you are not the intended recipient of this 
e-mail, you are hereby notified that any copying, distribution, dissemination 
or action taken in relation to the contents of this e-mail and any of its 
attachments is strictly prohibited and may be unlawful. If you have received 
this e-mail in error, please notify the sender immediately and permanently 
delete the original e-mail and destroy any copies or printouts of this e-mail 
as well as any attachments. Please note Lutheran Services in Iowa does not 
endorse any opinions, conclusions or other information contained within this 
message that does not pertain to official business.


********************************************************
This Week's Sponsor - RTO Software / TScale
What's keeping you from getting more from your terminal servers? Did you
know, in most cases, CPU Utilization IS NOT the single biggest constraint to
scaling up?! Get this free white paper to understand the real constraints &
how to overcome them. SAVE MONEY by scaling-up rather than buying more
servers. http://www.rtosoft.com/Enter.asp?ID=147
*********************************************************
Useful Thin Client Computing Links are available at:
http://thethin.net/links.cfm
***********************************************************
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm

Other related posts: