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).