失去了WMI ...无论如何都会崇拜任何可以提供帮助的人:) Sharon [英] At lost with WMI... Will worship anyone that can help in anyway :) Sharon

查看:41
本文介绍了失去了WMI ...无论如何都会崇拜任何可以提供帮助的人:) Sharon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我正试图从远程服务器调用我的.exe应用程序。这是代码:


ManagementClass processClass = new ManagementClass(" \\\\"
>
+" RemoteServerName"

+

" \\root \\CIMV2:Win32_Process");


//返回一个包含输入参数列表的对象

方法

ManagementBaseObject inParams = processClass.GetMethodParameters


(" Create");


//设置参数

inParams [" CommandLine"] =" C: \\SomeFolder\\Startup.exe" + \""

+

" C:\\SomeFolder \\someconfig.xml" +" \"" ;;


InvokeMethodOptions options = new InvokeMethodOptions();

options.Timeout = new TimeSpan(0,0,0 ,30);


ManagementBaseObject outParams = processClass.InvokeMethod(" Create",

inParams,

选项);

string return_code = outParams [" ReturnValue"]。ToString();

当我运行它时,它在一个名为的有效域帐户下运行:

someDomain / someAccount,我从outParams获得返回代码

(return_code)的8。在msdn上看:
http://msdn.microsoft.com/library/de...32_process.asp

它告诉我值为Unknown Failure。


我尝试过很多东西,查看权限,最后用上面的

代码成功调用我的应用程序。我得到它的工作



远程机器上授予someDomain / someAccount完全管理员权限,它就像一个魅力。


问题是我的合作。不允许我在该计算机上授予此帐户admin

权限。这没有意义,因为它不应该是b $ b需要管理员访问权限,只要它具有对

exe文件夹,winnt文件夹的读/执行权限,

远程机器上的文件和设置文件夹。


有人可以告诉我这是什么问题吗?为什么我需要在远程服务器上对该帐户进行

管理访问才能获得
工作?


任何建议都是非常感谢!


提前致谢


Sharon

Hi everyone,

I''m trying to invoke my .exe application from a remote server. Here is
the code:

ManagementClass processClass = new ManagementClass ("\\\\"

+"RemoteServerName"
+
"\\root\\CIMV2:Win32_Process");

//returns back an object that contains a list of input parameters for
the method
ManagementBaseObject inParams = processClass.GetMethodParameters

("Create");

//set the parameters
inParams ["CommandLine"] = "C:\\SomeFolder\\Startup.exe" + " \""
+
"C:\\SomeFolder\\someconfig.xml" + "\"";

InvokeMethodOptions options = new InvokeMethodOptions();
options.Timeout = new TimeSpan(0,0,0,30);

ManagementBaseObject outParams = processClass.InvokeMethod ("Create",
inParams,

options);
string return_code = outParams ["ReturnValue"].ToString();
When I run this, it runs under a valid domain account called:
someDomain/someAccount, I get a return code from the outParams
(return_code) of "8". Looking on msdn:
http://msdn.microsoft.com/library/de...32_process.asp
it tells me the value is "Unknown Failure".

I''ve tried many things, looking at permissions and finally the above
code to invoke my application successfully. I got it working by
granting someDomain/someAccount full administrator priviliges on the
remote machine and it worked like a charm.

The problem is my co. is not allowing me to grant this account admin
privileges on that machine. This doesn''t make sense as it shouldn''t
need admin access, as long as it has read/execute permissions on the
exe folder, winnt folder, and documents and settings folder on the
remote machine.

Can someone please tell me what the problem is? Why do I need
administrative access for that account on the remote server for it to
work?

Any suggestions would be much, much appreciated!

Thanks in advance

Sharon

推荐答案

调用WMI底层方法通常需要管理访问权限。

毕竟,你不会想要一些流氓网络用户随意重启

你的PC上你,好吗?

干杯,

彼得

-

联合创始人,Eggheadcafe。 com开发人员门户网站:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


" ri ******* @ hotmail.com"写道:
Invoking WMI underlying methods normally does require Administrative access.
After all, you wouldn''t want some rogue network user arbitrarily rebooting
your PC on you, would you?
Cheers,
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ri*******@hotmail.com" wrote:
大家好,

我正在尝试从远程服务器调用我的.exe应用程序。这是代码:

ManagementClass processClass = new ManagementClass(" \\\\"

+" RemoteServerName"
+
" \\root\\CIMV2:Win32_Process");

//返回一个包含
输入参数列表的对象方法
ManagementBaseObject inParams = processClass.GetMethodParameters

(" Create");

//设置参数
inParams [" CommandLine" ] =" C:\\SomeFolder \\Startup.exe" + \""
+
" C:\\SomeFolder \\someconfig.xml" +" \"" ;;

InvokeMethodOptions options = new InvokeMethodOptions();
options.Timeout = new TimeSpan(0,0,0,30);

ManagementBaseObject outParams = processClass.InvokeMethod(" Create",
inParams,

options);

string return_code = outParams [" ReturnValue" ] .ToString();

当我运行它时,它运行在一个名为:
someDomain / someAccount的有效域帐户下,我从outParams获得返回码
(return_code )8。在msdn上看:
http://msdn.microsoft.com/library/de...32_process.asp

它告诉我值为Unknown Failure。

我已经尝试了很多东西,查看权限,最后是上面的代码来成功调用我的应用程序。我通过
在远程机器上授予someDomain / someAccount完全管理员权限来实现它,它就像一个魅力。

问题是我的同事。不允许我在该计算机上授予此帐户admin
权限。这没有意义,因为它不应该需要管理员访问权限,只要它对
exe文件夹,winnt文件夹以及<上的文档和设置文件夹具有读/执行权限即可。远程机器。

有人可以告诉我这是什么问题吗?为什么我需要在远程服务器上对该帐户进行管理访问?

任何建议都会非常感激!
提前致谢

Sharon
Hi everyone,

I''m trying to invoke my .exe application from a remote server. Here is
the code:

ManagementClass processClass = new ManagementClass ("\\\\"

+"RemoteServerName"
+
"\\root\\CIMV2:Win32_Process");

//returns back an object that contains a list of input parameters for
the method
ManagementBaseObject inParams = processClass.GetMethodParameters

("Create");

//set the parameters
inParams ["CommandLine"] = "C:\\SomeFolder\\Startup.exe" + " \""
+
"C:\\SomeFolder\\someconfig.xml" + "\"";

InvokeMethodOptions options = new InvokeMethodOptions();
options.Timeout = new TimeSpan(0,0,0,30);

ManagementBaseObject outParams = processClass.InvokeMethod ("Create",
inParams,

options);
string return_code = outParams ["ReturnValue"].ToString();
When I run this, it runs under a valid domain account called:
someDomain/someAccount, I get a return code from the outParams
(return_code) of "8". Looking on msdn:
http://msdn.microsoft.com/library/de...32_process.asp
it tells me the value is "Unknown Failure".

I''ve tried many things, looking at permissions and finally the above
code to invoke my application successfully. I got it working by
granting someDomain/someAccount full administrator priviliges on the
remote machine and it worked like a charm.

The problem is my co. is not allowing me to grant this account admin
privileges on that machine. This doesn''t make sense as it shouldn''t
need admin access, as long as it has read/execute permissions on the
exe folder, winnt folder, and documents and settings folder on the
remote machine.

Can someone please tell me what the problem is? Why do I need
administrative access for that account on the remote server for it to
work?

Any suggestions would be much, much appreciated!

Thanks in advance

Sharon



感谢Peter的回应,非常感谢!


对不起,我没有提到以下内容:在我的开发和

验收服务器上,我不需要授予该帐户管理

访问,一切正常(该帐户甚至没有给客户访问
,它只对这些文件夹和

文件具有读取和执行权限。但在生产中,我试图在这些文件夹和文件上给帐户提供权利

,类似于开发和接受,但是

调用机制不起作用。我发现了授予

帐户管理员访问权限,一切正常生产....

你能提供任何h注意或建议Peter?


非常感谢


Sharon


Peter Bromberg [C#MVP ]写道:
Thanks for the response Peter, really appreciated!

Sorry, I failed to mention the following: On my development and
acceptance servers, I didn''t need to grant that account administrative
access, and everything works fine (the account is not even given a
guest access, it just has read and execute access on those folders and
files. But in production, I''ve tried to give the account just rights
on those folders and files, similar to development and acceptance, but
the invoking mechanism does not work. I found out that granting that
account admin access, everything works fine in production....
Can you provide any hints or suggestions Peter?

Thanks so much

Sharon

Peter Bromberg [C# MVP] wrote:
调用WMI底层方法通常需要管理访问权限。
毕竟,你不会想要一些流氓网络用户随意重启你的电脑,你会你好吗?
干杯,
Peter
-
联合创始人,Eggheadcafe.com开发者门户网站:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

ri ******* @ hotmail。 COM"写道:
Invoking WMI underlying methods normally does require Administrative access.
After all, you wouldn''t want some rogue network user arbitrarily rebooting
your PC on you, would you?
Cheers,
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ri*******@hotmail.com" wrote:
大家好,

我正在尝试从远程服务器调用我的.exe应用程序。这是代码:

ManagementClass processClass = new ManagementClass(" \\\\"

+" RemoteServerName"
+
" \\root\\CIMV2:Win32_Process");

//返回一个包含
输入参数列表的对象方法
ManagementBaseObject inParams = processClass.GetMethodParameters

(" Create");

//设置参数
inParams [" CommandLine" ] =" C:\\SomeFolder \\Startup.exe" + \""
+
" C:\\SomeFolder \\someconfig.xml" +" \"" ;;

InvokeMethodOptions options = new InvokeMethodOptions();
options.Timeout = new TimeSpan(0,0,0,30);

ManagementBaseObject outParams = processClass.InvokeMethod(" Create",
inParams,

options);

string return_code = outParams [" ReturnValue" ] .ToString();

当我运行它时,它运行在一个名为:
someDomain / someAccount的有效域帐户下,我从outParams获得返回码
(return_code )8。在msdn上看:
http://msdn.microsoft.com/library/de...32_process.asp

它告诉我值为Unknown Failure。

我已经尝试了很多东西,查看权限,最后是上面的代码来成功调用我的应用程序。我通过
在远程机器上授予someDomain / someAccount完全管理员权限来实现它,它就像一个魅力。

问题是我的同事。不允许我在该计算机上授予此帐户admin
权限。这没有意义,因为它不应该需要管理员访问权限,只要它对
exe文件夹,winnt文件夹以及<上的文档和设置文件夹具有读/执行权限即可。远程机器。

有人可以告诉我这是什么问题吗?为什么我需要在远程服务器上对该帐户进行管理访问?

任何建议都会非常感激!
提前致谢

Sharon
Hi everyone,

I''m trying to invoke my .exe application from a remote server. Here is
the code:

ManagementClass processClass = new ManagementClass ("\\\\"

+"RemoteServerName"
+
"\\root\\CIMV2:Win32_Process");

//returns back an object that contains a list of input parameters for
the method
ManagementBaseObject inParams = processClass.GetMethodParameters

("Create");

//set the parameters
inParams ["CommandLine"] = "C:\\SomeFolder\\Startup.exe" + " \""
+
"C:\\SomeFolder\\someconfig.xml" + "\"";

InvokeMethodOptions options = new InvokeMethodOptions();
options.Timeout = new TimeSpan(0,0,0,30);

ManagementBaseObject outParams = processClass.InvokeMethod ("Create",
inParams,

options);
string return_code = outParams ["ReturnValue"].ToString();
When I run this, it runs under a valid domain account called:
someDomain/someAccount, I get a return code from the outParams
(return_code) of "8". Looking on msdn:
http://msdn.microsoft.com/library/de...32_process.asp
it tells me the value is "Unknown Failure".

I''ve tried many things, looking at permissions and finally the above
code to invoke my application successfully. I got it working by
granting someDomain/someAccount full administrator priviliges on the
remote machine and it worked like a charm.

The problem is my co. is not allowing me to grant this account admin
privileges on that machine. This doesn''t make sense as it shouldn''t
need admin access, as long as it has read/execute permissions on the
exe folder, winnt folder, and documents and settings folder on the
remote machine.

Can someone please tell me what the problem is? Why do I need
administrative access for that account on the remote server for it to
work?

Any suggestions would be much, much appreciated!

Thanks in advance

Sharon






对不起,我也听说过对于调用WMI方法,您需要授予该帐户的唯一访问权限是/ b
$ b读取并执行对相应文件和文件夹的访问权限

远程机器。或者我被误导了?


谢谢!


Sharon

sorry, also, I heard that for invoking WMI methods, the only access
that you need to grant to the account is
read and execute access on the appropriate file/s and folder/s on the
remote machine. Or was I misinformed?

Thanks!

Sharon


这篇关于失去了WMI ...无论如何都会崇拜任何可以提供帮助的人:) Sharon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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