Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.8 KiB

  1. <%@ Language=VBScript
  2. EnableSessionState=False
  3. Option Explicit %>
  4. <%
  5. 'Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved.
  6. Dim strTask
  7. Dim rc
  8. Dim objContext
  9. Dim objTaskCol
  10. Dim objTask
  11. Dim objServiceCol
  12. Dim objService
  13. On Error Resume Next
  14. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  15. strSourceName = "sakitmsg.dll"
  16. if Err.number <> 0 then
  17. Response.Write "Error in localizing the web content "
  18. Response.End
  19. end if
  20. '-----------------------------------------------------
  21. 'START of localization content
  22. DIM L_APPLIANCEMGRTEST_TEXT
  23. DIM L_APPLIANCEMGR_TEXT
  24. DIM L_TASKS_TEXT
  25. DIM L_SERVICES_TEXT
  26. DIM L_SERVER_TEXT
  27. DIM L_TASKHRESULTS_TEXT
  28. L_APPLIANCEMGRTEST_TEXT = objLocMgr.GetString(strSourceName, "&H4001004D",varReplacementStrings)
  29. L_APPLIANCEMGR_TEXT = objLocMgr.GetString(strSourceName, "&H4001004E",varReplacementStrings)
  30. L_TASKS_TEXT = objLocMgr.GetString(strSourceName, "&H4001004F",varReplacementStrings)
  31. L_SERVICES_TEXT = objLocMgr.GetString(strSourceName, "&H40010050",varReplacementStrings)
  32. L_SERVER_TEXT = objLocMgr.GetString(strSourceName, "&H40010051",varReplacementStrings)
  33. L_TASKHRESULTS_TEXT = objLocMgr.GetString(strSourceName, "&H40010052",varReplacementStrings)
  34. 'End of localization content
  35. '-----------------------------------------------------
  36. On Error Resume Next
  37. strTask = Request.Form("TaskName")
  38. %>
  39. <HTML>
  40. <!-- Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved-->
  41. <HEAD>
  42. <title>L_APPLIANCEMGRTEST_TEXT</title>
  43. </HEAD>
  44. <BODY bgcolor="silver">
  45. <FORM action="appmgr.asp" method=POST>
  46. <strong><% =L_APPLIANCEMGR_TEXT %></strong><BR>
  47. <BR>
  48. <% =L_SERVER_TEXT %><% =GetServerName %>
  49. <BR><BR>
  50. <HR>
  51. <strong><% =L_TASKS_TEXT %></strong>
  52. <BR>
  53. <% Set objTaskCol = GetObject("WINMGMTS:{impersonationLevel=impersonate}!\\" & GetServerName & "\root\cimv2:Microsoft_SA_Task").Instances_
  54. For each objTask in objTaskCol
  55. response.write objTask.TaskName & "<BR>"
  56. Next
  57. Set objTaskCol = Nothing
  58. Set objTask = Nothing
  59. Response.Write "<BR><HR><strong>" & L_SERVICES_TEXT & "</strong><BR>"
  60. Set objServiceCol = GetObject("WINMGMTS:{impersonationLevel=impersonate}!\\" & GetServerName & "\root\cimv2:Microsoft_SA_Service").Instances_
  61. For each objService in objServiceCol
  62. response.write objService.ServiceName & "<BR>"
  63. Next
  64. Set objServiceCol = Nothing
  65. Set objService = Nothing
  66. %>
  67. <BR>
  68. <HR>
  69. <!--
  70. <strong>Task Execution</strong><BR><BR>
  71. Task name:<INPUT type=text name="TaskName" value="<% =strTask %>">
  72. &nbsp;&nbsp;&nbsp;
  73. <INPUT type=submit value="Execute">
  74. <BR>
  75. <BR>
  76. -->
  77. <%
  78. If strTask <> "" Then
  79. response.write "<BR>" & L_TASKHRESULT_TEXT & ExecuteTask(strTask, objContext) & "<BR>"
  80. 'response.write "<BR>" & objContext.GetParameter("TaskName") & "<BR>"
  81. End If
  82. Set objContext = Nothing
  83. %>
  84. </form>
  85. </BODY>
  86. </HTML>
  87. <%
  88. '=========================================
  89. Function GetServerName()
  90. On Error Resume Next
  91. GetServerName = Request.ServerVariables("SERVER_NAME")
  92. End Function
  93. ' JUNK
  94. 'Set objAM = GetObject("WINMGMTS:{impersonationLevel=impersonate}!\\" & GetServerName & "\root\cimv2:Microsoft_SA_Manager=@" )
  95. 'Set objTask = GetObject("WINMGMTS:{impersonationLevel=impersonate}!\\" & GetServerName & "\root\cimv2:Microsoft_SA_Task.TaskName=" & Chr(34) & TaskName & Chr(34) )
  96. 'Appsrvcs.ApplianceServices
  97. 'Microsoft.ApplianceManager
  98. '
  99. 'objTask.Execute()
  100. 'response.write "task type: " & typename(objTask) & "<BR>"
  101. %>