Otherwise please find attached a script for 'INGROUP'
Option Explicit ' Force explicit declarations
'
' Variables
'
Dim WSHNetwork
Dim FSO
Dim strUserName ' Current user
Dim strUserDomain ' Current User's domain name
Dim ObjGroupDict ' Dictionary of groups to which the user belongs
Dim strDrive ' Drive letter
Dim strShare ' Share path (UNC)
Dim colDrives ' Something anyway
Dim i
Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set FSO = CreateObject("Scripting.FileSystemObject")
'
' Wait until the user is really logged in...
'
strUserName = ""
While strUserName = ""
WScript.Sleep 100 ' 1/10 th of a second
strUserName = WSHNetwork.UserName
Wend
strUserDomain = WSHNetwork.UserDomain
' Read the user's account "Member Of" tab info across the network
' once into a dictionary object.
Set ObjGroupDict = CreateMemberOfObject(strUserDomain, strUserName)
'GROUP1
If MemberOf(ObjGroupDict, "GROUP1") Then
'Map network Drives
Call ConnectNetworkDrives("W:", "\\SERVER\SHARE1")
'Connect Printer(s)
WSHNetwork.AddWindowsPrinterConnection "\\SERVER\PRINTER1"
'Set Default printer
'WSHNetwork.SetDefaultPrinter "\\SERVER\PRINTER1"
End If
'GROUP2
If MemberOf(ObjGroupDict, "GROUP2") Then
'Map Network Drives
'Call ConnectNetworkDrives("<LETTER>:", "\\<SERVER>\<SHARE>")
'Connect Printer(s)
WSHNetwork.AddWindowsPrinterConnection "\\SERVER\PRINTER2"
'Set Default printer
'WSHNetwork.SetDefaultPrinter "\\SERVER\PRINTER2"
End If
Function MemberOf(ObjDict, strKey)
' Given a Dictionary object containing groups to which the user
' is a member of and a group name, then returns True if the group
' is in the Dictionary else return False.
'
' Inputs:
' strDict - Input, Name of a Dictionary object
' strKey - Input, Value being searched for in
' the Dictionary object
' Sample Usage:
'
' If MemberOf(ObjGroupDict, "DOMAIN ADMINS") Then
' wscript.echo "Is a member of Domain Admins."
' End If
'
'
MemberOf = CBool(ObjGroupDict.Exists(strKey))
End Function
Function CreateMemberOfObject(strDomain, strUserName)
' Given a domain name and username, returns a Dictionary
' object of groups to which the user is a member of.
'
' Inputs:
'
' strDomain - Input, NT Domain name
' strUserName - Input, NT username
'
Dim objUser, objGroup
Set CreateMemberOfObject = CreateObject("Scripting.Dictionary")
CreateMemberOfObject.CompareMode = vbTextCompare
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUserName & ",user")
For Each objGroup In objUser.Groups
CreateMemberOfObject.Add objGroup.Name, "-"
Next
Set objUser = Nothing
End Function
Function ConnectNetworkDrives(strDrive, strShare)
' Input drive letter and share path
' This function connects a drive letter to a specified share share
' Inputs:
' strDrive = Drive letter e.g. "W:"
' strShare = Share path e.g. "\\Server\Share"
Set colDrives = wshNetwork.EnumNetworkDrives
For i = 0 To colDrives.Count - 1 Step 2
If (colDrives(i) = strDrive) Then
wshNetwork.RemoveNetworkDrive strDrive
End If
Next
wshNetwork.MapNetworkDrive strDrive, strShare
End Function
From: "Lum, David" <[EMAIL PROTECTED]>
Reply-To: "NT 2000 Discussions" <[EMAIL PROTECTED]>
To: "NT 2000 Discussions" <[EMAIL PROTECTED]>
Subject: RE: Help with script
Date: Mon, 18 Nov 2002 12:58:20 -0500
Use the login script to detect a TS login, or pyut the users in a group and
have the login script map according to membership. I,e. create a group
called TS_USERS or similar and use an IF INGROUP statement for mapping.
Dave Lum - [EMAIL PROTECTED]
Sr. Network Specialist - Textron Financial
503-675-5510
-----Original Message-----
From: John Q Jr. [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 09:25 AM
To: NT 2000 Discussions
Subject: Help with script
Where are the files/registry settings for mapped drives in windows 2000
Server.
I am trying to map a set of users to drives, and can not think of a way to
do it.
I do not have GPO login script as a choice, I need this mapping to be a
seperate TS ONLY mapping and I have already used the default for another
share.
Any ideas?
- John Q Jr.
----- Original Message -----
From: "Lum, David" <[EMAIL PROTECTED]>
To: "NT 2000 Discussions" <[EMAIL PROTECTED]>
Sent: Friday, November 15, 2002 2:18 PM
Subject: RE: Help with script to get hardware info
> I sent a post with attachemnts, if they make it to this list, I sincerely
> apologize! I meant it to go to Ed only.
>
> Dave Lum - [EMAIL PROTECTED]
> Sr. Network Specialist - Textron Financial
> 503-675-5510
>
> ------
> You are subscribed as [EMAIL PROTECTED]
> Archives: http://www.swynk.com/sitesearch/search.asp
> To unsubscribe send a blank email to %%email.unsub%%
>
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to %%email.unsub%%
------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to %%email.unsub%%
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
------
You are subscribed as [email protected]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]
