- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
下面是我使用 WMI 读取域中远程计算机中的 IIS 应用程序的代码。
var connOptions = new ConnectionOptions
{
Username = "USERNAME",
Password = "PASSWORD",
Authority = "ntlmdomain:DOMAINNAME",
EnablePrivileges = true,
Impersonation = ImpersonationLevel.Impersonate
};
var scope = new ManagementScope(@"\\SERVERNAME\root\WebAdministration", connOptions);
var WMIQuery = new ObjectQuery("SELECT * FROM Application");
var searcher = new ManagementObjectSearcher(scope, WMIQuery);
//Connect to WMI
scope.Connect();
//Write the list of Applications info
foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("SiteName: {0} - {1}", queryObj["SiteName"], queryObj["Path"]);
}
失败并出现以下异常:
System.Management.ManagementException was caught
Message=Access denied
Source=System.Management
StackTrace:
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectSearcher.Get()
at Program.Main(String[] args)
InnerException:
我尝试过的补救措施:
If your computer is part of a domain, connect to the target computerusing a domain account that is in the local Administrators group ofthe remote computer. Then UAC access token filtering will not affectthe domain accounts in the local Administrators group. Do not use alocal, nondomain account on the remote computer, even if the accountis in the Administrators group.
最佳答案
通过将 ConnectionOptions 的 Authentication 属性设置为 'AuthenticationLevel.PacketPrivacy' 解决
关于c# - WMI - 读取远程域计算机中的 IIS 应用程序时抛出 'Access Denied' 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27039814/
对于 Windows,我可以使用哪些与 WMI 的监视和系统管理功能类似的其他框架或编程语言? 最佳答案 最能与 WMI 的性能监控功能相媲美的是 SNMP (Simple Network Manag
我的客户有一个旧的基于 DOS 的应用程序,它将格式化的输出发送到打印机。我已禁用打印,因此假脱机文件仍保留在打印队列中。我想拿起这些假脱机文件并将它们转换为 PDF 格式(然后最好删除它们)。这可能
给定一个查询,例如 SELECT * FROM WIN32_PROCESS 有没有办法查询结果对象的返回列的名称? 将结果对象中的所有行写入文本文件,例如 最佳答案 Is there a way to
谷歌让我失望,我在 MSDN 上找不到它。 man wmi在 Windows shell 上不起作用... 我正在寻找可以查询的对象列表,以及如何构建查询。 使用 WMI 我的意思是查询语言来查询诸如
我使用 .Net Framework SDK 中的 MgmtClassGen.exe 为 BizTalk 工件(例如主机、主机实例等)生成一些 WMI 包装器类。 我正在使用 HostSetting.
我正在尝试使用 WMI 获取连接到 Windows XP 计算机的硬件打印机列表。我想要的与从 Win32_Printers 获取列表不同,因为我只想获取物理上以盒子形式存在的打印机,从而消除所有“打
我查看了“root\virtualization”命名空间中的几个对象,但我无法找到 Hyper-V 存储给定虚拟机配置文件路径的位置。我需要以编程方式获取此文件路径,或者至少只是给定虚拟机的主路径也
这些都驻留在 root\RSOP\Computer 命名空间中。我得到非空结果的唯一类是 RSOP_RegistryPolicySetting ,而那个只给了我 Windows 更新和系统还原配置的设
有没有办法通过 WMI 创建/删除磁盘分区?我已经能够挂载/卸载虚拟磁盘 (vhd) 并列出它们的分区。 最佳答案 据我所知,在 WMI 中无法创建/删除分区。您可能想查看 Shell Functio
是否有用于 WMI/WBEM 的 OLEDB 提供程序? 换句话说,有人可以通过以下方式访问 WMI: shell vbscript 中的 ADO ASP 脚本中的 ADO Win32 native
我正在尝试破译 SecurityCenter.productState WMI 命名空间中的 productState 属性。 例如,产品状态是一个整数:262144 - 然后您可以查看此文档页面,将
最近很多用户在使用电脑的时候发现了wmi provider host进程占用内存比较大,不知道这个进程到底是干什么的,能不能禁止,怎么禁止。下面来一起看看想想的介绍吧。 wmi provide
我很难过,似乎无法找到明确的答案。我正在尝试通过 WMI 获取网络适配器列表。我一直在使用的命令在我们办公室的几乎所有工作站上都运行良好,没有任何问题。昨天,问题。一台机器出故障。由于它直接在用户
首先,我想说谢谢你帮我解决这个问题。非常感谢您付出的时间和努力。 标题总结得很好,但我将提供一些细节。基本上,如果我使用 C# 提取操作系统版本,它会返回适用于 Windows 8 的结果 6.2,即
我正在检测我是否正在尝试与本地主机建立连接,并创建(或不创建)WMI 连接选项,如下所示: if (NetworkUtils.IsLocalIpAddress(machineName)) {
我们如何枚举所有网络连接,以便使用 WMI 提取 VPN 连接的 IP 地址?在 XP 上,Win32_NetworkAdapterConfiguration 工作正常,但在 Vista 上它似乎只枚
我想使用 WMI(在 C++ 中)来配置静态 IPv6 地址。 使用 EnableStatic 配置静态 IPv4 地址工作正常,它是名为 Win32_NetworkAdapterConfigurat
我用这里的安装程序安装了wmi http://timgolden.me.uk/python/wmi/index.html但我无法导入模块。 这是我的代码: import wmi c=wmi.WMI()
当我尝试这样做时 SetDynamicDNSRegistration(True) 它返回“68”,我在 MSDN WMI page 上查找过它它的意思是“输入参数无效”。 完整脚本 import wm
我尝试使用 convert-vhd 命令将 VHD 转换为 VHDX,但出现以下错误: The Hyper-V Management Tools could not access an expecte
我是一名优秀的程序员,十分优秀!