【发布时间】:2011-01-07 15:57:01
【问题描述】:
我有一个对远程系统执行 WMI 调用的 ASP.NET 应用程序。应用程序 Web.config 包含
问题是我收到“访问被拒绝”错误,尽管我可以成功地从同一用户下同一主机上的 PowerShell 控制台向相关远程服务器执行我的 WMI 请求。
// this doesn't work
ManagementScope scope = new ManagementScope();
scope.Path.NamespacePath = "root\\virtualization";
scope.Path.Server = "vs01";
scope.Connect(); // <-- here comes exception
# this works just fine
Get-WmiObject -Namespace 'root\virtualization' -Class Msvm_ComputerSystem -ComputerName vs01
转储 HttpContext.Current.User.Identity.Name、System.Security.Principal.WindowsIdentity.GetCurrent().Name、System.Threading.Thread.CurrentPrincipal.Identity.Name 属性表明模拟按预期工作。
想法?问题可能是某种 .NET 或 IIS 安全问题?
【问题讨论】:
标签: asp.net security powershell wmi