#46647 - 2003-10-14 01:46 PM
Huge kixtart script
|
colweb
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.
|
Top
|
|
|
|
#46648 - 2003-10-14 01:53 PM
Re: Huge kixtart script
|
Radimus
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
|
Top
|
|
|
|
#46650 - 2003-10-14 01:58 PM
Re: Huge kixtart script
|
colweb
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
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
|
|
|
|
#46653 - 2003-10-14 03:21 PM
Re: Huge kixtart script
|
colweb
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.
|
Top
|
|
|
|
#46654 - 2003-10-14 03:29 PM
Re: Huge kixtart script
|
Howard Bullock
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 ]
|
Top
|
|
|
|
#46655 - 2003-10-14 04:05 PM
Re: Huge kixtart script
|
Bryce
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
|
|
|
|
#46657 - 2003-10-14 04:30 PM
Re: Huge kixtart script
|
Howard Bullock
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.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 515 anonymous users online.
|
|
|