[THIN] Re: OT: populate AD user info

  • From: Brian Lilley <Brian.Lilley@xxxxxxxxxxxxx>
  • To: "'thin@xxxxxxxxxxxxx'" <thin@xxxxxxxxxxxxx>
  • Date: Thu, 15 Jan 2004 10:34:19 -0000

Neil,

What is HTA???

And while were on the subject... 

I am trying to pull out term services specific info for users via 
the ADSI interface and the WinNT provider,  here is a VB script that 
should work 
 
 
Set DSO = GetObject("WinNT:") 
Set usr = DSO.OpenDSObject("WinNT://OURDOMAIN/username01", 
"OURDOMAIN\administratorid", "password", ADS_SECURE_AUTHENTICATION) 
usr.GetInfo 
WScript.echo usr.TerminalServicesProfilePath 
WScript.echo usr.HomeDirectory 
WScript.echo usr.FullName 
WScript.echo usr.Description 
 
when I run it, it bombs out with 
 
C:\temp\b.vbs(8, 1) Microsoft VBScript runtime error: Object doesn't 
support this property or method: 'usr.TerminalServicesProfilePath' 
 
if i query any 'standard' properties on the DSO object other than TS 
related ones, it works fine? 



-----Original Message-----
From: Braebaum, Neil [mailto:Neil.Braebaum@xxxxxxxxxxxxxxxxx]
Sent: 15 January 2004 09:59
To: thin@xxxxxxxxxxxxx
Subject: [THIN] Re: OT: populate AD user info


The slick thing to do, would be write a HTA - you could even use the
Microsoft script encoder to encode the scripting within it, to hide it
from amateur, prying eyes - which would be a (effectively) GUI front
end, just prompting the user themselves for this info - since users
normally have the individual permissions (self) to update their user
object.

Much of the vbscript / ADSI stuff would be the same to a stand alone
script - the advantage being you could have the users do these fields
(and only these fields) from a GUI front end, and be able to complete /
update these things, themselves.

Doing it via HTA alleviates some of the trickiness of authentication
issues that may blight / complex the issue, were you to do this by a
more rather traditional web / ASP type application.

Neil

(PS: if you want any tips or info on how to do this sort of thing by
HTA, then holler up - I'm reasonably sure it wouldn't be totally
off-topic, here)

> -----Original Message-----
> From: Roger Riggins [mailto:roger.riggins@xxxxxxxxxx] 
> Sent: 14 January 2004 22:23
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: OT: populate AD user info
> 
> Thanks. I was envisioning IT sending a form to all staff to 
> fill out and send back and then use a script similar to this 
> to parse the files and enter that info into their existing 
> accounts. Sound feasible?
> 
> -----Original Message-----
> From: thin-bounce@xxxxxxxxxxxxx 
> [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf Of Paul DeHaan
> Sent: Wednesday, January 14, 2004 4:12 PM
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: OT: populate AD user info
> 
> 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!
> 
> >>> 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?

***********************************************
This e-mail and its attachments are confidential
and are intended for the above named recipient
only. If this has come to you in error, please 
notify the sender immediately and delete this 
e-mail from your system.
You must take no action based on this, nor must 
you copy or disclose it or any part of its contents 
to any person or organisation.
Statements and opinions contained in this email may 
not necessarily represent those of Littlewoods.
Please note that e-mail communications may be monitored.
The registered office of Littlewoods Limited and its
subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
Registered number of Littlewoods Limited is 262152.
************************************************

********************************************************
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

_____________________________________________________________________

This message has been checked for all known viruses on behalf of Vivista by
MessageLabs. 

http://www.messagelabs.com or Email: mailsweeper.info@xxxxxxxxxxxxx

Vivista formerly Securicor Information Systems for further information
http://www.vivista.co.uk  



**********************************************************************
The information contained in this e-mail message is intended
only for the individuals named above.  If you are not the 
intended recipient, you should be aware that any 
dissemination, distribution, forwarding or other duplication 
of this communication is strictly prohibited.  The views 
expressed in this e-mail are those of the individual author 
and not necessarily those of Vivista Limited.  
Prior to taking any action based upon this e-mail message 
you should seek appropriate confirmation of its authenticity.
If you have received this e-mail in error, please immediately 
notify the sender by using the e-mail reply facility.
**********************************************************************


_____________________________________________________________________

This message has been checked for all known viruses on behalf of Vivista by 
MessageLabs. 

http://www.messagelabs.com or Email: mailsweeper.info@xxxxxxxxxxxxx

Vivista formerly Securicor Information Systems for further information 
http://www.vivista.co.uk  

********************************************************
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: