远程WMI失败了,我无法弄清楚问题出在哪里 [英] Remote WMI failed, and i cannot figure out where the problem

查看:71
本文介绍了远程WMI失败了,我无法弄清楚问题出在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想说我是asp.net和IIS的新手。我用C#.net开发了Web应用程序。但是,当我将它移动到Windows Server 2008中的IIS7.0时,远程连接让我感到不安.IIS中的身份验证使用Windows身份验证,ASP.Net
Impersonate = disable。连接的客户端是Windows Server 2003。


我的代码:

 //初始化变量

machineName = a;
myDomain =" NTLMDOMAIN:domain" ;;
userName =" admin" ;;
密码="密码" ;;

cnOptions = new ConnectionOptions();
string sServerPath = @" \\" + machineName + @" \Root \CIMV2" ;;
cnOptions.Impersonation = ImpersonationLevel.Impersonate;
cnOptions.EnablePrivileges = true;
cnOptions.Authentication = AuthenticationLevel.Packet;
//cnOptions.Authority = myDomain;

//cnOptions.Timeout = new TimeSpan(0,0,10);
//cnOptions.Username = userName;
//cnOptions.Password =密码;

ManagementScope myScope = new ManagementScope(sServerPath,cnOptions);

myScope.Connect();


1)我的帐户在两台测试机器的管理员组下。用户名和密码相同。两台计算机都在同一个域中。 


2)我尝试使用客户端计算机中的DCOMcnfg和wmimgmt.msc进行更改。 Windows防火墙已关闭



  • 在我授予我的用户帐户所有访问权限(全部勾选)后,它会一直提示我
    Access_Denied(0x80070005)
  • 然后,我添加服务器端计算机名称并为其授予所有访问权限。这次没有错误,但检索到的数据来自本地机器。
  • 最后,我删除了机器名称的访问权限并使用我自己的管理员帐户添加

3)然后,我在代码中添加cnOptions的UserName和Password。然后,它会给
RPC服务器不可用(0x800706BA)。 当我为其添加权限时发生了同样的错误。


4)对于Windows防火墙,我试试" ; netsh firewall REMOTEADMIN ENABLE ",但它回复"服务尚未启动"。所以,我承认防火墙已经停止。


现在,我已经删除了我所做的所有更改以及我给出的每个权限。任何指南??



解决方案

您好GargoyleXxX,


您更有可能获得在
http://forums.asp.net
上更有效地回应ASP.NET问题,您可以在这里与ASP.NET专家联系


I would like to say i am new with asp.net and IIS. I have developed web application with C#.net. However, the remote connection is troubling me when i moved it to IIS7.0 in windows server 2008. The authentication in IIS is using Windows Authentication, ASP.Net Impersonate = disable. Client side for connection is windows server 2003.

My Code:

//initialise the variables

machineName = a;
myDomain = "NTLMDOMAIN:domain";
userName = "admin";
password = "password";

cnOptions = new ConnectionOptions();
string sServerPath = @"\\" + machineName + @"\Root\CIMV2";  
cnOptions.Impersonation = ImpersonationLevel.Impersonate;
cnOptions.EnablePrivileges = true;
cnOptions.Authentication = AuthenticationLevel.Packet;
//cnOptions.Authority = myDomain;  

//cnOptions.Timeout = new TimeSpan(0, 0, 10);
//cnOptions.Username = userName;
//cnOptions.Password = password;

ManagementScope myScope = new ManagementScope(sServerPath, cnOptions);

myScope.Connect();

1)My account is under administrator group for both tested machine. Username and password are same. Both machine are in same domain. 

2)I try to change with the DCOMcnfg and the wmimgmt.msc in client machine. Windows firewall is closed

  • After i granted my user account with all access (all ticked), it keeps prompt me with Access_Denied (0x80070005).
  • Then, i add the Server side machine name and grant all access for it. No error this time, but the data retrieved is from local machine.
  • Finally, i remove the access for machine name and add back with my own admin account 

3)Then, i add the UserName and Password for the cnOptions in the code. Then, it give error with RPC Server is unavailable (0x800706BA). The same error occurred when i add the authority for it.

4) For the windows firewall, i try " netsh firewall REMOTEADMIN ENABLE", but it reply with "The service has not been started". So, i admit that the firewall is stopped.

Now, i have removed all changes i made and every permissions i gave. Any guide for this??

解决方案

Hi GargoyleXxX,

You are more likely to get more efficient responses to ASP.NET issues at http://forums.asp.net where you can contact ASP.NET experts.


这篇关于远程WMI失败了,我无法弄清楚问题出在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆