Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Kixtart Script question

Status
Not open for further replies.

abuthemagician

IS-IT--Management
Joined
Nov 26, 2003
Messages
192
Location
US
In our network we use kixtart and every user gets 5 basic shared drives. What i would like to do is to exclude a certain group of users from those drives. Anyone know how to do that?

Here is a sample of how we do it right now:

; Basic drive mappings for All Users
use N: "\\Server\@userid"
use O: "\\Server\Bridger"
use S: "\\Server2\share"
use U: "\\Server2\software"
use z: "\\Server2\resources"

thanks in advance!
 
Sure, but you will want to get rid of KixStart and just use VBScript.

Here is a sample script that will do everything you ask and a lot more.

Enjoy

'==========================================================================
'
' NAME: LogonScript
'
' AUTHOR: Mark D. MacLachlan, The Spider's Parlor
' URL : ' DATE : 4/10/2003
'
' COMMENT: Enumerates current users' group memberships in given domain.
'
'==========================================================================


ON ERROR RESUME NEXT

Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = "DomainName"
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

'Synchronizes the time with Server our NTP Server
WSHShell.Run "NET TIME \\Server /set /y"


WSHNetwork.RemoveNetworkDrive "F:"

wscript.sleep 300

'Maps drives needed by all
WSHNetwork.MapNetworkDrive "U:", "\\server\users",True
WSHNetwork.MapNetworkDrive "X:", "\\server\executables",True

'Now check for group memberships and map appropriate drives
For Each GroupObj In UserObj.Groups

Select Case GroupObj.Name
'Check for group memberships and take needed action
Case "Admin"
WSHNetwork.MapNetworkDrive "w:", "\\Server\Admin Stuff",True
Case "WorkerB"
WSHNetwork.MapNetworkDrive "w:", "\\Server\Shared Documents",True

End Select

Next


'Install Printers

WSHNetwork.AddWindowsPrinterConnection "\\Server\HP5si"



set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing

wscript.quit
 
This example, we create a new group called Digest1 and placed certain users in this group and then had the following Kix script run

IF INGROUP("Digest1")
USE Q: "\\server1\THEDIGEST"
ENDIF

This example we used everybody who is in the domain users group and ran the following script

IF INGROUP("Domain Users")
USE S: "\\server1\Common$"
ENDIF

Hope this helps
 
Did you review the script I posted? It has a section for group memberships and mapping drives.

The section you want to modify is where you will see the "Case" statements.
 
VBScript is great and all, but kix is a lot easier to use in my oppinion. Anyway, my original question was how to exclude a group of users from the general mappings. We already have certain groups who get special mappings, but we would like top keep the script as clean as possible. Is there a command like "if not in group"??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top