<%@ Language=VBScript %> <% Option Explicit %> <% '------------------------------------------------------------------------- ' sysbackup.asp : Backup/Restore through terminal services client ' ' Copyright (c) Microsoft Corporation. All rights reserved. ' ' Date Description ' 14-03-2001 Modified Date '------------------------------------------------------------------------- %> <% '------------------------------------------------------------------------------------------------- 'Localized content '------------------------------------------------------------------------------------------------- DIM L_BACKUPTITLE_TEXT L_BACKUPTITLE_TEXT = SA_GetLocString("sysbackup.dll", "40700005", "") DIM L_BACKUP_WINIECLIENT_ERRORMESSAGE L_BACKUP_WINIECLIENT_ERRORMESSAGE = SA_GetLocString("sysbackup.dll", "C0700007", "") DIM L_BACKUP_SERVERCONNECTIONFAILED_ERRORMESSAGE L_BACKUP_SERVERCONNECTIONFAILED_ERRORMESSAGE = SA_GetLocString("sysbackup.dll", "C0700009", "") DIM L_UNABLETOACCESSBROWSER_ERRORMESSAGE L_UNABLETOACCESSBROWSER_ERRORMESSAGE = SA_GetLocString("sysbackup.dll", "C070000A", "") DIM L_BACKUP_HELP_MESSAGE L_BACKUP_HELP_MESSAGE = SA_GetLocString("sysbackup.dll", "4070000B", "") Dim WinNTSysInfo 'Getting object Dim strComputerName(1) 'Computer name Set WinNTSysInfo = CreateObject("WinNTSystemInfo") strComputerName(0) = WinNTSysInfo.ComputerName DIM L_ERRMSG_TITLE DIM L_ERRMSG_PROMPT L_ERRMSG_TITLE = GetLocString("tserver.dll", "40420007", "") L_ERRMSG_PROMPT = GetLocString("tserver.dll", "40420006", strComputerName) '------------------------------------------------------------------------------------------------- 'End of Localization content '------------------------------------------------------------------------------------------------- 'serve the HTML content along with client side validations Call ServePage() '------------------------------------------------------------------------------------ 'Function name :ServeContent 'Description :serves the HTML content along with client side validations 'Input Variables :None 'Output Variables :None 'Returns :None 'Global Variables :L_* '------------------------------------------------------------------------------------ Function ServeContent() %> <% If ( IsIE() AND InStr( Request.ServerVariables("HTTP_USER_AGENT"), "Windows")) Then %> <% End If %>
<% If ( IsIE() AND InStr( Request.ServerVariables("HTTP_USER_AGENT"), "Windows")) Then %> 1600 Then resWidth = 800 End If Response.Write("WIDTH="+CStr(resWidth)+" ") Dim resHeight ' to hold height of the new terminal services window resHeight = Request.QueryString("rH") If resHeight < 200 or resHeight > 1200 Then resHeight = 600 End If Response.Write("HEIGHT="+CStr(resHeight) + " " ) %> <% End If %>
<% End Function %> <% '------------------------------------------------------------------------------------ 'Subroutine name :ServePage 'Description :serves the HTML content 'Input Variables :None 'Output Variables :None 'Returns :None 'Global Variables :L_* '------------------------------------------------------------------------------------ Sub ServePage() Err.Clear On Error Resume Next %> <%=L_BACKUPTITLE_TEXT%> <% 'For XP pro (XPE), we display help msg for how to manully open up the ntbackup.exe 'since launching a app from Termial Service is not supported in XP pro. If CONST_OSNAME_XPE = GetServerOSName() Then Response.Write L_BACKUP_HELP_MESSAGE End If Dim bIsSupported 'whether the browser is installed on Windows Clients bIsSupported = false 'initialize to false ' ' The Terminal Server ActiveX control is only supported on Windows Clients ' running Internet Explorer. ' If IsIE() Then If InStr( Request.ServerVariables("HTTP_USER_AGENT"), "Windows") Then bIsSupported = true End If End If 'if IE installed on Windows Clients, serve the HTML content If ( bIsSupported ) Then ServeContent() Else Response.Write("
") Response.Write("

"+L_BACKUP_WINIECLIENT_ERRORMESSAGE+"

") Response.Write("
") End If %> <% End Sub '------------------------------------------------------------------------------------ 'Function name :GetUserName 'Description :gets the user name 'Input Variables :None 'Output Variables :None 'Returns :login user name 'Global Variables :None '------------------------------------------------------------------------------------ Function GetUserName() Dim domainAndUser 'holds string containing DOMAIN\USER Dim loginUser 'holds LOGIN user loginUser = Request.ServerVariables("LOGON_USER") domainAndUser = Split(loginUser, "\") If IsArray(domainAndUser) Then GetUserName = domainAndUser(UBound(domainAndUser)) Else GetUserName = loginUser End If End Function %>