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

***********************************************************************
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 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 
represent those of Littlewoods. Please note that email 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 - 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: