Re: I need help with a login script
- From: "kj [SBS MVP]" <KevinJ.SBS@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 25 Jan 2008 13:15:27 -0700
John K wrote:
I have a problem with my login script. It is only mapping the first
drive "H". Am i missing something . Any help willbe appreciated. I am
running the script on a sbs2003 sp2 server with vista and xp clients.
Option Explicit
On Error Resume Next
Const lsn_Accounting_group = "cn=Accounting"
Const lsn_Sales_group = "cn=Sales"
Const lsn_Excecutive_group = "cn=Excecutive"
Const lsn_Operations_group = "cn=Operations"
Const lsn_Programming_group = "cn=Programming"
Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.MapNetworkDrive "h:","\\xxxsrv01\Users\" &
wshNetwork.UserName
Set ADSysInfo = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
strGroups = LCase(Join(CurrentUser.MemberOf))
If InStr(strGroups, lsn_Accounting_group) Then
wshNetwork.MapNetworkDrive "F:","\\lsnsrv01\Accounting\"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\LaserJet4000"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\3500Color"
wshNetWork.SetDefaultPrinter "\\lsnsrv01\2840Color"
ElseIf InStr(strGroups, Lsn_Sales_group) Then
wshNetwork.MapNetworkDrive "S:","\\lsnsrv01\Sales\"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\LaserJet4000"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\3500Color"
wshNetWork.SetDefaultPrinter "\\lsnsrv01\2840Color"
ElseIf InStr(strGroups, lsn_Excecutive_group) Then
wshNetwork.MapNetworkDrive "X:","\\lsnsrv01\Excecutive\"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\LaserJet4000"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\3500Color"
wshNetWork.SetDefaultPrinter "\\lsnsrv01\2840Color"
ElseIf InStr(strGroups, lsn_Operations_group) Then
wshNetwork.MapNetworkDrive "O:","\\lsnsrv01\Operations\"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\LaserJet4000"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\3500Color"
wshNetWork.SetDefaultPrinter "\\lsnsrv01\2840Color"
ElseIf InStr(strGroups, lsn_Programming_group) Then
wshNetwork.MapNetworkDrive "P:","\\lsnsrv01\Programming\"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\LaserJet4000"
wshNetwork.AddWindowsPrinterConnection "\\lsnsrv01\3500Color"
wshNetWork.SetDefaultPrinter "\\lsnsrv01\2840Color"
End If
"If a user is a mamber of no groups other than Domain Users, the list is
Null. If the user is a member of just one additional group, the value is a
string. If member of two or more groups, an array. Before you try the Join
operation, test to see if the value is an array or not."
http://www.visualbasicscript.com/m_1807/tm.htm
--
/kj
.
- Follow-Ups:
- Re: I need help with a login script
- From: John K
- Re: I need help with a login script
- References:
- I need help with a login script
- From: John K
- I need help with a login script
- Prev by Date: Re: I need help with a login script
- Next by Date: WEIRD VPN Behavior
- Previous by thread: Re: I need help with a login script
- Next by thread: Re: I need help with a login script
- Index(es):
Relevant Pages
|