[THIN] Re: Scripting issue
- From: "Braebaum, Neil" <Neil.Braebaum@xxxxxxxxxxxxxxxxx>
- To: <thin@xxxxxxxxxxxxx>
- Date: Fri, 27 Feb 2004 13:21:02 -0000
Comments inline...
> -----Original Message-----
> From: thin-bounce@xxxxxxxxxxxxx
> [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf Of Nick Smith
> Sent: 27 February 2004 13:07
> To: thin@xxxxxxxxxxxxx
> Cc: Danny Shisler
> Subject: [THIN] Scripting issue
>
> I want to map drives for my users based on their department.
> I know I can use %username% within the TS global policy for
> their Home Directory, but in addition to this I want to give
> them a Deparmental Directory, based on an attribute in AD, so
> want to use a syntax along the lines of;
>
> Net use U: \\server01\users\%username%
> Net use u: \\server01\users\%departmentname%
>
> I know I can do this by putting them into different
> groups/OUs, and assigning a different script to each, but I
> ideally want one script which I can then edit to affect everyone;
>
> Net use U: \\server02\users\%username%
> Net use u: \\server02\users\%departmentname%
There seems to ways to go about this.
Place the users, in AD, in OUs that represent their departments - then
in those OUs, create shared folder resources.
Have one (global) login script that accesses the shared folder resources
in the users OU (a little tricky to establish, but can be done), then
map it to the drive letter you want.
Or, use ADSI scripting, or Kixtart (Kixtart can do all of those ADSI
things these days) to obtain the users department from the field on
their user object in AD, then map the drive appropriately.
Kixtart can obtain the AD information, and is easier to map drives with,
so would seem the more suitable language. But ADSI & vbscript or jscript
would do - it's just more elaborate / involved to do things like map
drives.
The "ADSI" type code you would use in either approach (Kixtart or ADSI
scripting) would be largely the same.
> This is part of our *extremely* cheap (Whoops - I meant
> "resource-efficient", of course) fallover routine!
>
> So: how can I can access an AD attribute in a logon script?
Use ADSI or Kixtart to read the particular property of the user object.
Two things to be aware of - at this point, there'll be no obvious way of
having the full, LDAP path (ie the DN) of the user's object in AD. You
could search for it, or do something slick, but you won't have it
immediately.
The other thing, being that some attributes or properties are only
available through the LDAP provider - which is why the first thing I
mentioned is relevant.
If everything was available through the WinNT provider, it would be
simpler to code (although not exactly tipping a wink at futures ;-)),
because all you'd need to know is the domain name, and the username.
> Do I need to use something more powerful than just a abtch
> file such as Kix or Vbscript? Can anyone point me in the
> right direction?
You'll almostly certainly need something like Kixtart or vbscript.
If you're unfamiliar with either, or as a general recommendation for
*login* scripts, I'd suggest Kixtart. The ADSI type stuff will be no
more difficult in Kixtart, but the other types of things you tend to do
in login scripts, eg: map drives, copy files, write to the registry -
are significantly easier and more straightforward than they would be in
vbscript.
Neil
***********************************************
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 weeks sponsor triCerat Inc.
triCerat makes your job easier by offering essential
applications to eliminate your printing, policy and profile,
and your application management problems.
http://www.triCerat.com
**********************************************************
Useful Thin Client Computing Links are available at:
http://thin.net/links.cfm
***********************************************************
For Archives, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link:
http://thin.net/citrixlist.cfm
Other related posts: