Login script..timeout? 
Author Message
 Login script..timeout?

Hi All,
I have a login script that I've been working on which works great for LAN
attached users, but I think there are some timeout issues for users who
dial-in (using PAL, i.e. UUNet's dial-in).

One of the first things I do is call the main function via an if statement:
IF IsMember("GUESTS") THEN
    etc....

Function IsMember(sGroup)

Dim strAdsPath, objUser, objGroup
If IsEmpty(objGroupDict) Then
    Set objGroupDict = CreateObject("Scripting.Dictionary")
    objGroupDict.CompareMode = vbTextCompare
    strAdsPath = objNet.UserDomain & "/" & objNet.UserName
    Set objUser = GetObject("WinNT://" & strAdsPath & ",user")

    For Each objGroup In objUser.Groups
        objGroupDict.Add objGroup.Name, "-"
    Next
End If
IsMember = CBool(objGroupDict.Exists(sGroup))
End Function

The problem is that I think it times out on this call of the function, and
since there is an 'On error resume next' statement at the beginning of the
script, it proceeds in the script and in this case, processes the user as if
it were a guest user.

How can I tell it to give the function time to execute? Do I need to just
put in a 'while' loop that says that if the IfMember function is false, to
wait? How would I do this?

I think it's probably fairly simple, I just don't have the knowledge and
want to make sure it's done correctly.

Thanks in advance,
Per

(note sure which was the best group for this, so posted to 3...sorry if
that's considered bad manners).



Mon, 28 Feb 2005 23:07:37 GMT  
 Login script..timeout?
I would start by yanking the On Error statement and try running it
remotely to see what the actual error is.

--
Please respond in the newsgroup so everyone may benefit.
 http://dev.remotenetworktechnology.com
 ----------
 Subscribe to Microsoft's Security Bulletins:
 http://www.microsoft.com/technet/security/bulletin/notify.asp


Quote:
> Hi All,
> I have a login script that I've been working on which works great for
LAN
> attached users, but I think there are some timeout issues for users
who
> dial-in (using PAL, i.e. UUNet's dial-in).

> One of the first things I do is call the main function via an if
statement:
> IF IsMember("GUESTS") THEN
>     etc....

> Function IsMember(sGroup)

> Dim strAdsPath, objUser, objGroup
> If IsEmpty(objGroupDict) Then
>     Set objGroupDict = CreateObject("Scripting.Dictionary")
>     objGroupDict.CompareMode = vbTextCompare
>     strAdsPath = objNet.UserDomain & "/" & objNet.UserName
>     Set objUser = GetObject("WinNT://" & strAdsPath & ",user")

>     For Each objGroup In objUser.Groups
>         objGroupDict.Add objGroup.Name, "-"
>     Next
> End If
> IsMember = CBool(objGroupDict.Exists(sGroup))
> End Function

> The problem is that I think it times out on this call of the function,
and
> since there is an 'On error resume next' statement at the beginning of
the
> script, it proceeds in the script and in this case, processes the user
as if
> it were a guest user.

> How can I tell it to give the function time to execute? Do I need to
just
> put in a 'while' loop that says that if the IfMember function is
false, to
> wait? How would I do this?

> I think it's probably fairly simple, I just don't have the knowledge
and
> want to make sure it's done correctly.

> Thanks in advance,
> Per

> (note sure which was the best group for this, so posted to 3...sorry
if
> that's considered bad manners).



Tue, 01 Mar 2005 09:03:13 GMT  
 Login script..timeout?
Alex.
thanks. i'll try that



Quote:
> I would start by yanking the On Error statement and try running it
> remotely to see what the actual error is.

> --
> Please respond in the newsgroup so everyone may benefit.
>  http://dev.remotenetworktechnology.com
>  ----------
>  Subscribe to Microsoft's Security Bulletins:
>  http://www.microsoft.com/technet/security/bulletin/notify.asp



> > Hi All,
> > I have a login script that I've been working on which works great for
> LAN
> > attached users, but I think there are some timeout issues for users
> who
> > dial-in (using PAL, i.e. UUNet's dial-in).

> > One of the first things I do is call the main function via an if
> statement:
> > IF IsMember("GUESTS") THEN
> >     etc....

> > Function IsMember(sGroup)

> > Dim strAdsPath, objUser, objGroup
> > If IsEmpty(objGroupDict) Then
> >     Set objGroupDict = CreateObject("Scripting.Dictionary")
> >     objGroupDict.CompareMode = vbTextCompare
> >     strAdsPath = objNet.UserDomain & "/" & objNet.UserName
> >     Set objUser = GetObject("WinNT://" & strAdsPath & ",user")

> >     For Each objGroup In objUser.Groups
> >         objGroupDict.Add objGroup.Name, "-"
> >     Next
> > End If
> > IsMember = CBool(objGroupDict.Exists(sGroup))
> > End Function

> > The problem is that I think it times out on this call of the function,
> and
> > since there is an 'On error resume next' statement at the beginning of
> the
> > script, it proceeds in the script and in this case, processes the user
> as if
> > it were a guest user.

> > How can I tell it to give the function time to execute? Do I need to
> just
> > put in a 'while' loop that says that if the IfMember function is
> false, to
> > wait? How would I do this?

> > I think it's probably fairly simple, I just don't have the knowledge
> and
> > want to make sure it's done correctly.

> > Thanks in advance,
> > Per

> > (note sure which was the best group for this, so posted to 3...sorry
> if
> > that's considered bad manners).



Tue, 01 Mar 2005 21:29:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Login script..timeout?

2. Return to Login Screen on Session Timeout

3. How do I Set Login Timeout?

4. ODBC Login Timeout

5. The script was aborted because execution exceeded the specified timeout period

6. vbscript login scripts - starting a script from the Windows 95 command prompt

7. Script to remove login script by OU.

8. Using a WSH Script as a Login Script

9. Login script - Script running before user logs on.

10. Login script - Script running before user logs on.

11. Executing a WSH script as a login script

12. Change Script Timeout

 

 
Powered by phpBB® Forum Software