Re: I need help with a login script
- From: "kj [SBS MVP]" <KevinJ.SBS@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 25 Jan 2008 22:36:53 -0700
Costas wrote:
John,
You rewrite the script but I think it will be time consuming trying
to loop through the array. My advise is to rearrange the hierarchy
of the directories and put those with multiple membership in top
level directories.
For example. You can have top level folder called 'Executive' and
under it the rest of the folders. With the appropriate permissions,
members of the Executive group need to only belong to that group to
see everything under it. Same goes for the rest of the groups.
I'm not the best VB scripter so I keep it simple (no loops, no arrays),
like;
' Map a drive if the user is a member of the group. *** Map the M: Drive for
QuickBook Users
strGroup = "Accounting"
If IsMember(strGroup) Then
On Error Resume Next
objNetwork.MapNetworkDrive "M:", "\\sbs\accounting"
If Err.Number <> 0 Then
On Error GoTo 0
objNetwork.RemoveNetworkDrive "M:", True, True
objNetwork.MapNetworkDrive "M:", "\\sbs\accounting"
End If
On Error GoTo 0
End If
fwiw.
"John K" <John K@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0AEB725D-1804-4947-B90D-955FA2EEDCA0@xxxxxxxxxxxxxxxx
"Costas" wrote:
John,
kj made a good point. Do your users belong to more than one groups?
--
Costas
About half of the belongs to more than one group
John K
"John K" <JohnK@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:6E1628DB-CCFB-4733-9146-7B329D602904@xxxxxxxxxxxxxxxx
Thanks Costas
Users are members of security group Accounting sales etc. Lsnsrv01 is
the
domain controller and yes printers are mapping okay.
"Costas" wrote:
The script looks ok as far as programming goes.
A couple of things to look at. First make sure that the user id
you are
using to connect on the client machine is a member of at least
one of the
groups you have the "IF" statements (e.g. Accounting, Sales...
etc). Another thing is the "\\LSNSRV01" is that a member server
in the domain?
Do the printers map properly?
--
Costas
"John K" <John K@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F47B4582-5B2D-4D6A-BD28-34ABFF48D58E@xxxxxxxxxxxxxxxx
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
--
/kj
.
- Follow-Ups:
- Re: I need help with a login script
- From: Costas
- Re: I need help with a login script
- References:
- I need help with a login script
- From: John K
- Re: I need help with a login script
- From: Costas
- Re: I need help with a login script
- From: John K
- Re: I need help with a login script
- From: Costas
- Re: I need help with a login script
- From: John K
- Re: I need help with a login script
- From: Costas
- I need help with a login script
- Prev by Date: Re: VPN with ISA
- Next by Date: Re: VPN with ISA
- 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
|