Page 1 of 1 1
Topic Options
#46647 - 2003-10-14 01:46 PM Huge kixtart script
colweb Offline
Fresh Scripter

Registered: 2003-10-14
Posts: 9
Im not new to Kixtart, been using it for about 5 years, but we've never used it for much more than mapping drives so I've posted in the noobs section.

We have 3000+ groups in our domain, a lot of which are for mapping drives. This means we have a central kixtart script with about 500 USE commands in it. As you can imagine with no real naming standard in place for groups its hard to find what drives are mapping for which users (without going through the long process of checking each group for each user singlely)

I was wondering if it was possible to write a kixtart script that could "run" the logon script for a given user (without replicating the logon process) and return a list of what drive letters were supposed to be mapped for that user.

Does anyone think this is possible? I think it is but dont have the programming genius brain to make it happen, help!

Thanks in advance. [Big Grin]

Top
#46648 - 2003-10-14 01:53 PM Re: Huge kixtart script
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
so you want to audit the logon process for users and generate a list of mapped drives.

But you want to do it as an admin tool, and then RUNAS each user...

You would need their username and password.
run the script
use DriveEnum() and DriveProp() UDFs to collect the mapped drives
dump it to a file
exit and run it again for a new user
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#46649 - 2003-10-14 01:56 PM Re: Huge kixtart script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm...
there is 2 ways to do this.
for a real dynamic script (groupmaps according to dynamic groupnames) it's easy but think in your case there is little harder way needed.

you would need to read in your logonscript and split all your use statements to an array.
then check each of those against some users groups.
_________________________
!

download KiXnet

Top
#46650 - 2003-10-14 01:58 PM Re: Huge kixtart script
colweb Offline
Fresh Scripter

Registered: 2003-10-14
Posts: 9
Thanks for the speedy response.

I would like to Audit the logon drives for users, but without having to logon as them (requiring passwords etc). I simply want to be able to feed a script a User's ID and for it to tell me what drives they will get mapped....

I will have a read about those UDFs though.

Cheers,

Col.

Top
#46651 - 2003-10-14 02:00 PM Re: Huge kixtart script
colweb Offline
Fresh Scripter

Registered: 2003-10-14
Posts: 9
up until now Ive been "processing" the logon script manually with Excel and collating into MS Access. Then importing the Users and Groups using Hyena, then linking it all together. Works nice until someone makes changes on the live system then you've got to start again... doooooh...
Top
#46652 - 2003-10-14 02:15 PM Re: Huge kixtart script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that's why you should modify the live-system.
make it ini or similar based.
every group that has a mapping, has a ini-section associated to it.
this way each user can map all the drives with SHORT code and you can enum all the groups with SHORT code.
_________________________
!

download KiXnet

Top
#46653 - 2003-10-14 03:21 PM Re: Huge kixtart script
colweb Offline
Fresh Scripter

Registered: 2003-10-14
Posts: 9
hmmmm a bit of work there for 500 groups though.... doh!

Ah well, I'll do my MS Access "solution" again and sort these users out....

I've also emailed a DOS guru who might find another way using various "FIND" commands etc..

Thanks everyone for their comments. [Big Grin]

Top
#46654 - 2003-10-14 03:29 PM Re: Huge kixtart script
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You may also have other avenues available to you as well.

After reading this thread I am left wondering how you actually use these groups to map drives. Could you provide some code? Are you using a Master domain model where users are in an account domain and computers are in resource domains? Have you though about logically calling sub-scripts with specific functionality for different groups or classes of users?

See for some additional ideas: http://home.comcast.net/~habullock/logon_script_architecture.htm

Also see my GrpMaint.exe program elsewhere on my site which can enumerate all users in all groups and write the output to a text file. Great for importing into excel or Access.

[ 14. October 2003, 15:33: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#46655 - 2003-10-14 04:05 PM Re: Huge kixtart script
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
A few ideas…

First, Get a list of a given users groups memberships by using the UDF UserGroups

Now, you are going to want to compare this list against your current logon script's ingroup/USE commands. With out knowing how your code is written i am only able to give you some pointers on how to do this. Either way, it will require you reading in your logon script as a text file and parsing the data that you are looking for.

And easier way would to use the suggested external INI file method. But even this will require you to rewrite your logon script to support such an action. Might be more work at the beginning, but will really pay off in the end.

This might be of some help... a shell command to get out only the "USE" lines. like USE d: \\server\share

shell '%comspec% /c findstr /i "USE " logon.kix | find /i ":" > temp.txt'

Just read in temp.txt for a list of what share = what drive letter in your script.

Bryce

Top
#46656 - 2003-10-14 04:11 PM Re: Huge kixtart script
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
quote:
As you can imagine with no real naming standard in place for groups its hard to find what drives are mapping for which users
This would need to be taken care of immediately. Secondly, one could parse the original login script and extract the mappings that are defined for each user/group, maybe even based on the userid. However, whitout seeing the original script and hwo the drives are being mapped for each user, it's hard to suggest specifics. Thirdly, one could also remotely scan the registry for the user's mapped drives under HKCU\Network.
_________________________
There are two types of vessels, submarines and targets.

Top
#46657 - 2003-10-14 04:30 PM Re: Huge kixtart script
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
If you just want a list of what drives are mapped, you could also add some code to the logon script to enumerate the mapped drives and write the data as a file to a network share. ?You could then collect this data and use it accordingly.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 464 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.031 seconds in which 0.011 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org