我有一个用VB完成的asp页面,我在安装操作系统之前用它来准备PC。 我将页面全部编码,并且我创建了一个具有所有必要访问权限的服务帐户。
我在IIS中配置了一个应用程序池,可以在服务帐户下运行,并将该页面添加为应用程序。
但是,当用户运行该页面时 - 它会使用访问权限和凭据运行代码 - 我希望它以服务帐户权限运行。
这可能吗?我认为配置应用程序池就足够了吗?
页面正在使用Windows身份验证来授予对页面的访问权限。
~~默认页面中的一些代码:
<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="asp._Default" %>
.....
.....
asp:ListBox ID="ListBox1" runat="server" Height="405px" Width="693px" >
</asp:ListBox>
<asp:Button ID="Button1" runat="server" Text="GO!" Width="168px" />
GO! 然后将在页面后面运行VB:
if pcname <> Nothing AndAlso user <> Nothing AndAlso MAC <> Nothing AndAlso asset_tag <> Nothing Then
writelog("Starting Prep - |MachineName:" & pcname & " |Username:" & user & " |MAC:" & MAC & " |Asset_tag:" & asset_tag & " |Prepper:" & (Page.User.Identity.Name), "Main", "1")
writelog("Starting AD prep for: " & pcname, "Factory", "1")
do_AD_prep(pcname, user, asset_tag)
writelog("Starting SCCM prep for: " & pcname, "Factory", "1")
do_SCCM_Prep(pcname, MAC, user)
writelog("Starting ePO prep for: " & pcname, "Factory", "1")
do_EPO_prep(pcname, user)**
~~网站管理员:
<%@ Master Language="VB" AutoEventWireup="true" CodeBehind="Site.master.vb" Inherits="asp.SiteMaster" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
<title><%: Page.Title %> - My ASP.NET Application</title>
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
<webopt:BundleReference runat="server" Path="~/Content/css" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<asp:ContentPlaceHolder runat="server" ID="HeadContent" />
</head>
<body>
<form runat="server">
<asp:ScriptManager runat="server">
<Scripts>
<%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=272931&clcid=0x409 --%>
<%--Framework scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="jquery.ui.combined" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site scripts--%>