[THIN] Re: OT? WSH Logon Scripts

to add to Neil's take on this,=20

I use Kix for my login scripts because its easy and efficient.  Even an =
idiot like me can write good login scripts with Kix.  All I would do is =
make a mess of things with WSH.  And they run fast.   I map 8 drives and =
almost 30 printers (and script the default).  All of it based on group =
membership and it happens in the blink of an eye.  My users don't even =
notice a script ran.

When it comes to scripting, Neil is one of the best on this list.  There =
are a lot of people with skills on this list but Neil has mad game when =
it come to scripts.  If you need to know anything about what kind of =
script to use where, he's the man.

Greg

-----Original Message-----
From: Braebaum, Neil [mailto:Neil.Braebaum@xxxxxxxxxxxxxxxxx]
Sent: Friday, May 09, 2003 10:55 AM
To: 'thin@xxxxxxxxxxxxx'
Subject: [THIN] Re: OT? WSH Logon Scripts



As to why Kix is better for that sort of thing?

Well, as you asked - with WSH, to map a drive (as your code example =
points
out) you have to create an object for the wscript.network object, *then* =
use
a method to map the drive.

In Kix it'd just be two lines (as in your example your delete any prior
mappings first...)

use g: /delete
use g: "\\servername\share"

As to the group membership thing, your code doesn't actually do that, it
just enumerates all the member objects of the group  - no good if it's
inherited by being a member of another group.

In Kix, you'd just use the ingroup function.

Don't get me wrong, I write a fair amount of WSH /ADSI stuff - I just
believe in horses for courses.

You *can* do practically all the same things in WSH, that you can in Kix =
-
merely that for login type scripts, it's easier / more optimal to do it =
in
Kix. Especially when you consider reading / writing to the registry - =
that's
*very* limited in WSH, and you need to make use of WMI to make that =
anywhere
near decent - and *still* it's considerably more unwieldly for it than =
Kix.

Neil

> -----Original Message-----
> From: White, Michael S [mailto:Michael.White@xxxxxxxxxxxxxxxxxx]=20
> Sent: 09 May 2003 15:43
> To: 'thin@xxxxxxxxxxxxx'
> Subject: [THIN] Re: OT? WSH Logon Scripts
>=20
> First why is Kix better? =20
>=20
> Here is some sample code you can use. =20
>=20
> Mapping a drive
>=20
> Set WSHNetwork =3D WScript.CreateObject("WScript.Network")
>=20
> WSHNetwork.RemoveNetworkDrive "G:", 0, -1=20
> WSHNetwork.MapNetworkDrive "G:","\\ServerName\Share"
>=20
> Getting group membership
>=20
> strDomain =3D "Enter Domain Name Here"
>=20
> Set WSHNetwork =3D WScript.CreateObject("WScript.Network")
>=20
> strUser =3D WSHNetwork.UserName
>=20
> adsPath =3D "WinNT://" & strDomain & "/" & strUser
>=20
> set adsObj =3D GetObject(adsPath)
>=20
> For Each Prop In adsobj.groups
>=20
> Msgbox Prop.Name
>=20
> Next
>=20
> -----Original Message-----
> From: Braebaum, Neil [mailto:Neil.Braebaum@xxxxxxxxxxxxxxxxx]=20
> Sent: Friday, May 09, 2003 9:20 AM
> To: 'thin@xxxxxxxxxxxxx'
> Subject: [THIN] Re: OT? WSH Logon Scripts
>=20
>=20
> Just out of interest, why is it you wish to get away from=20
> Kixtart - you've mentioned the WAN thing, is it the Kixtart=20
> caching functionality that's causing issues, or have you=20
> genuinely found performance differences in WAN environments=20
> between the two scripting technologies?
>=20
> I honestly think, for much of login script activity, that=20
> Kixtart can't be beat. And anyways, nearly always the best=20
> choice is the tool you're most familiar with.
>=20
> Personally I use Kixtart, WSH / ADSI / vbscript, and normal=20
> command files for various things - but I honestly think that=20
> for login processing stuff, Kixtart is the optimal choice -=20
> especially if you know it already.
>=20
> I would have thought you'll have plenty of opportuinity to=20
> use and learn WSH / ADSI / WMI stuff, from lots of other=20
> admin tasks you'll no doubt find.
>=20
> Neil
>=20
> >-----Original Message-----
> >From: Derek J. Lambert [mailto:dlambert@xxxxxxxxxx]
> >Sent: Friday, May 09, 2003 8:44 AM
> >To: thin@xxxxxxxxxxxxx
> >
> >This may be a little OT, but I was wondering if anyone had some WSH
> >logon scripts they could send my way. I am currently using kixstart,=20
> >but would like to migrate our scripts to VBScript & WSH to improve=20
> >execution time across our WAN. If you have something that's=20
> >not too too=20
> >complex (I'm interested in mapping/deleting shares, checking group=20
> >membership,
> >etc.) that you could share it would be greatly appreciated!

***********************************************************************
This e-mail and its attachments are confidential and are intended for=20
the above named recipient only. If this has come to you in error,=20
please notify the sender immediately and delete this email 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=20
represent those of Littlewoods. Please note that email communications=20
may be monitored.=20

The registered office of Littlewoods Limited and its  subsidiaries
is 100 Old Hall Street, Liverpool, L70 1AB.=20
Registered number of Littlewoods Limited is 262152=20
 ***********************************************************************
********************************************************
This Week's Sponsor - Emergent Online
EOL's Universal Printer new Features include:
Network Printing, Pagestreaming, 2400 DPI.
No Client Software Required!
http://www.go-eol.com/
**********************************************************

For Archives, to Unsubscribe, Subscribe or=20
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm
********************************************************
This Week's Sponsor - Emergent Online
EOL's Universal Printer new Features include:
Network Printing, Pagestreaming, 2400 DPI.
No Client Software Required!
http://www.go-eol.com/
**********************************************************

For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:
http://thethin.net/citrixlist.cfm

Other related posts: