<% ' ------------------------------------------------------ '| FILE: AUTOCFG.ASP | '| DATE: 01/06/99 | '| AUTHOR: Erik Mikkelson (Microsoft) | '| DESCRIPTION: Customizable ASP script to perform the | '| IEAK AutoConfig | '| Copyright Microsoft Corpation 1999 | ' ------------------------------------------------------ ' ---------------------------------------------------- '| Set the DEBUGFLAG variable to | '| TRUE to DEBUG this file. By default this parameter | '| is FALSE | ' ---------------------------------------------------- DEBUGFLAG = FALSE 'DEBUG INFO if DEBUGFLAG =TRUE then Response.Write "Debug Info DEBUG OUTPUT:" Response.Write "

This debug output should aid you in solving any problems you might have in using this script.

" end if ' --------------------------------------------------- '| Get the authenticated user's DOMAIN and USER NAME | ' --------------------------------------------------- AuthDomainandUser=Request.ServerVariables("LOGON_USER") ' ---------------------------------------------------- '| Enter the default domain and user name that the | '| server should use if it doesn't recognize the user | ' ---------------------------------------------------- if AuthDomainandUser="" then AuthDomainandUser="DOMAIN\guest" 'DEBUG INFO if DEBUGFLAG =TRUE then Response.Write "

The web server is detecting that the user is logged in with the following domain name and user name.

" Response.Write "

" & AuthDomainandUser & "

" Response.Write "

If the guest account that you specified in this active server script always equals your guest account (eg. 'DOMAIN\GUEST') " Response.Write "make sure that the authentication method for this ASP file is set to 'Allow Anonymous' and 'Windows NT Challenge/Response', and that Internet User Account (IUSR_computer name) has No Access to AUTOCFG.ASP.

" Response.Write "

The authentication method used by the server is " & Request.ServerVariables("AUTH_TYPE") & "

" end if ' ------------------------------------------------ '| Flip the "\" to a "/" so that the ADSI Command | '| GetObject:// can use it | ' ------------------------------------------------ AuthDomainandUser = Replace(AuthDomainandUser, "\", "/") ' ---------------------------------------------------- '| Use the GetObject (ADSI) to obtain the user object | ' ---------------------------------------------------- Set User=GetObject("WinNT://" & AuthDomainandUser) ' -------------------------------------------------------- '| Loop through all NT Global Groups of which the user is | '| a member looking for the "IE_" prefix to a group name | ' -------------------------------------------------------- For Each Group in User.Groups if Left(Group.Name, 3) = "IE_" then IsGroupMember = TRUE IEGroupName = Group.Name end if Next 'DEBUG INFO if DEBUGFLAG = TRUE then Response.Write "

These are all of the NT Global Groups that the user is a member of. This script will look for the " Response.Write "first group that starts with 'IE_' and use it for the INS filename.

" Response.Write "

" end if ' -------------------------------------------- '| If user is a Member of IE_[groupname] then | '| the filename is [groupname].ins, else it's | '| IE_Default.ins | ' -------------------------------------------- if IsGroupMember = TRUE then 'DEBUG INFO if DEBUGFLAG = TRUE then Response.Write "

The script found this group name " & IEGroupName & "

" end if TheINSFileName = IEGroupName & ".ins" ' ------------------------------ '| If DEBUGFLAG <> TRUE, | '| redirect to [groupname].ins, | '| else display the filename | ' ------------------------------ if DEBUGFLAG = TRUE then 'DEBUG INFO Response.Write "If you weren't debugging this file you would be redirected to " & TheINSFileName & "" else Response.Redirect "ins/" & TheINSFileName end if else ' ------------------------------- '| Retrieve the Default INS File | ' ------------------------------- 'DEBUG INFO if DEBUGFLAG = TRUE then Response.Write "

The script did not find any group starting with 'IE_' of which " & AuthDomainandUser & " is a member. " Response.Write "It will use the default script ('IE_Default') instead.

" end if TheINSFileName = "IE_Default.ins" ' ------------------------------ '| If DEBUGFLAG <> TRUE, | '| redirect to [groupname].ins, | '| else display the filename | ' ------------------------------ if DEBUGFLAG = TRUE then 'DEBUG INFO Response.Write "If you weren't debugging this File you would be redirected to " & TheINSFileName & "" Response.Write "" else Response.Redirect "ins/" & TheINSFileName end if end if ' ------------ '| End Script | ' ------------ %>