Re: Script not working correctly for users w/out admin rights to t
From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 06/12/04
- Previous message: Sean: "Scripting the installation of NLB on W2K3"
- In reply to: Jerry: "Re: Script not working correctly for users w/out admin rights to t"
- Next in thread: Richard Mueller [MVP]: "Re: Script not working correctly for users w/out admin rights to t"
- Reply: Richard Mueller [MVP]: "Re: Script not working correctly for users w/out admin rights to t"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 12 Jun 2004 17:14:17 -0600
Could it be that when you have tested this for accounts that have admin
rights, those accounts also happen to have some different group membership
settings that happen to not cause your script to fail, whereas the
non-admins do not?
Clearly, the script works in some cases and fails in others. Richard
explained "the right way" to do this stuff in the general case, because
doing it the wrong way "works in some cases and fails in others". I'd
suggest you try it Richard's way, and let us know if you still have the
problem. If you don't, then you will know the answer to your question below.
If the problem persists, then we will need to have another look.
/Al
"Jerry" <Jerry@discussions.microsoft.com> wrote in message
news:57955E09-FD92-4EC5-8C68-A9E4970958CE@microsoft.com...
> Thanks but that does not explain why it works if the users have admin
rights to the server.
>
> "Richard Mueller [MVP]" wrote:
>
> > Jerry wrote:
> >
> > > I have a small network running Server 2003. I have created a logon
script
> > based on the example I obtained from Help & Support. It looks something
like
> > this:
> > >
> > > Const SOME_GROUP = "cn=somegroup"
> > >
> > > Set wshNetwork = CreateObject("WScript.Network")
> > >
> > > wshNetwork.MapNetworkDrive "u:", "\\Server\SomeFolder" &
> > wshNetwork.UserName
> > > wshNetwork.MapNetworkDrive "m:", "\\Server\SomeFolder"
> > >
> > > Set ADSysInfo = CreateObject("ADSystemInfo")
> > > Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
> > > strGroups = LCase(Join(CurrentUser.MemberOf))
> > >
> > > If InStr(strGroups, SOME_GROUP) Then
> > >
> > > wshNetwork.MapNetworkDrive "Q:", "\\Server\SomeFolder"
> > >
> > > End If
> > >
> > > My problem is that my users that do not have admin rights to the
server
> > get an type mismatch error for the "Join" setting in line 10. I don't
want
> > to give all my users admin rights to the server but so far that is the
only
> > way I have found to fix the problem. Can someone please provide a better
> > way?
> >
> > Hi,
> >
> > Every user should have rights to read the memberOf attribute of their
user
> > object, unless this permission has been specifically denied. A more
likely
> > explanation is that the code you posted will fail if
CurrentUser.memberOf is
> > not an array. The code should account for the memberOf attribute having
many
> > values, one value, or no values. A "type mismatch" error is raised if
> > memberOf has one or no values in the collection. I use code similar to:
> >
> > colGroups = objCurrentUser.memberOf
> > If IsEmpty(colGroups) Then
> > strGroups = ""
> > ElseIf TypeName(colGroups) = "String" Then
> > strGroups = LCase(colGroups)
> > Else
> > strGroups = LCase(Join(colGroups))
> > End If
> >
> > --
> > Richard
> > Microsoft MVP Scripting and ADSI
> > HilltopLab web site - http://www.rlmueller.net
> > --
> >
> >
> >
- Previous message: Sean: "Scripting the installation of NLB on W2K3"
- In reply to: Jerry: "Re: Script not working correctly for users w/out admin rights to t"
- Next in thread: Richard Mueller [MVP]: "Re: Script not working correctly for users w/out admin rights to t"
- Reply: Richard Mueller [MVP]: "Re: Script not working correctly for users w/out admin rights to t"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|