VB.Net WMI Windows Server 2003 [英] VB.Net WMI Windows Server 2003

查看:52
本文介绍了VB.Net WMI Windows Server 2003的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在托管Windows Server 2003的

计算机上使用VB.Net的管理基础对象时遇到问题。我正在尝试设置文件

权限来自Windows服务。这些文件可以在

本地计算机上或网络上的某个位置上运行。我使用管理基础

对象来设置这些权限,当在Windows机器上运行windows

服务时,这些权限非常有效。但是,当在Windows Server 2003计算机上运行该服务时,我会收到错误。


执行以下代码时会抛出异常

meassge ofNot Found!


Dim outparams As ManagementBaseObject =

objFile.InvokeMethod(" GetSecurityDescriptor",没什么,选项)


我不确定这个问题是否特定于在Windows Server 2003机器上运行Windows服务

或者是否正常可执行文件还有

产生相同的结果。


任何帮助或建议都会非常感激。


种类问候。


Ger。

解决方案

如果代码在XP中按预期工作,它应该在w2k3还

..请确保w2k3机器上存在你试图调用

方法的文件对象。


是的,是的是值得的,看看问题是否正常使用

exe。


-

Sarika Sharma [MSFT]

WMI测试工程师

此帖子提供As Is;没有保证,也没有授予任何权利。

使用包含的脚本样本须遵守
http://www.microsoft.com/info/cpyright.htm

请不要直接发送电子邮件这个别名。此别名仅适用于

新闻组。


" Ger" < GE ******* @ hotmail.com>在消息中写道

新闻:1a ************************* @ posting.google.co m ... < blockquote class =post_quotes>我在托管Windows Server 2003的机器上使用VB.Net的管理基础对象时遇到问题。我正在尝试从Windows服务设置文件
权限。这些文件可能会在本地计算机上或网络上的某个位置上运行。我使用管理基础
对象设置这些权限,当Windows服务在XP机器上运行时,这些权限非常有效。但是,当该服务在Windows Server 2003计算机上运行时,我收到错误。

当执行以下代码时,将引发一个异常,其中包含&/找不到!

Dim outparams As ManagementBaseObject =
objFile.InvokeMethod(" GetSecurityDescriptor",Nothing,options)

我不确定这个问题是不是特定于在Windows Server 2003计算机上运行Windows服务或者正常的可执行文件也会产生相同的结果。

任何帮助或建议都将非常感谢亲切的问候。

Ger。



嗨Sarika,


当我从w2k3中的普通可执行文件运行它时,我的代码工作正常。

问题似乎源于代码执行的事实

从Windows服务。任何想法?


谢谢,


Ger。


" Sarika Sharma [MSFT] " < SA ***** @ online.microsoft.com>在消息新闻中写道:< ut ************* @ TK2MSFTNGP11.phx.gbl> ...

如果代码在XP中按预期工作,它应该表现得很好正确地在w2k3中也是
。请确保w2k3机器中存在您尝试调用
方法的文件对象。

是的,看看问题是否与正常的 exe。

-
Sarika Sharma [MSFT]
WMI测试工程师
此帖子提供As Is。没有保证,也没有授予任何权利。
使用包含的脚本样本须遵守
http://www.microsoft.com/info/cpyright.htm
请不要直接向此别名发送电子邮件。此别名仅用于
新闻组。


" Ger" < GE ******* @ hotmail.com>在消息中写道
新闻:1a ************************* @ posting.google.co m ...

我在托管Windows Server 2003的机器上使用VB.Net的管理基础对象时遇到问题。我正在尝试从Windows服务设置文件
权限。这些文件可能会在本地计算机上或网络上的某个位置上运行。我使用管理基础
对象设置这些权限,当Windows服务在XP机器上运行时,这些权限非常有效。但是,当该服务在Windows Server 2003计算机上运行时,我收到错误。

当执行以下代码时,将引发一个异常,其中包含&/找不到!

Dim outparams As ManagementBaseObject =
objFile.InvokeMethod(" GetSecurityDescriptor",Nothing,options)

我不确定这个问题是不是特定于在Windows Server 2003计算机上运行Windows服务或者正常的可执行文件也会产生相同的结果。

任何帮助或建议都将非常感谢。

亲切的问候。

Ger。



确切的错误是什么你得到的代码是什么?


你的服务是什么?


-

Sarika Sharma [MSFT ]

WMI测试工程师

该帖子提供As Is;没有保证,也没有授予任何权利。

使用包含的脚本样本须遵守
http://www.microsoft.com/info/cpyright.htm

请不要直接发送电子邮件这个别名。此别名仅适用于

新闻组。


" Ger" < GE ******* @ hotmail.com>在消息中写道

新闻:1a ************************** @ posting.google.c om ...

嗨Sarika,

当我从w2k3中的普通可执行文件运行它时,我的代码工作正常。
问题似乎源于代码正在存在的事实从Windows服务执行
。任何想法?

谢谢,

Ger。

Sarika Sharma [MSFT]" < SA ***** @ online.microsoft.com>在消息中写道



news:< ut ************* @ TK2MSFTNGP11.phx.gbl> ...

如果代码在XP中按预期工作,它也应该在w2k3
中正确运行。请确保w2k3计算机中存在您尝试调用
方法的文件对象。

是的,看看问题是否为
重新编译是值得的正常的exe。

-
Sarika Sharma [MSFT]
WMI测试工程师
此帖子提供As Is。没有保证,并且不授予
权利。使用包含的脚本样本须遵守
http: //www.microsoft.com/info/cpyright.htm
请不要直接向此别名发送电子邮件。此别名仅用于
新闻组。


" Ger" < GE ******* @ hotmail.com>在消息中写道
新闻:1a ************************* @ posting.google.co m ...

我在托管Windows Server 2003的机器上使用VB.Net的管理基础对象时遇到问题。我正在尝试从Windows服务设置文件
权限。这些文件可能会在本地计算机上或网络上的某个位置上运行。我使用管理基础
对象来设置这些权限,当Windows
服务在XP机器上运行时,这些权限非常有效。但是,当该服务在Windows Server 2003计算机上运行时,我收到错误。

当执行以下代码时,将引发一个异常,其中包含&/找不到!

Dim outparams As ManagementBaseObject =
objFile.InvokeMethod(" GetSecurityDescriptor",Nothing,options)

我不确定这个问题是不是特定于在Windows Server 2003计算机上运行Windows服务或者正常的可执行文件也会产生相同的结果。

任何帮助或建议都将非常感谢。

亲切的问候。

Ger。



I am having problems using VB.Net''s Management base object on a
machine hosting Windows Server 2003. I am trying to set file
permissions from a Windows Service. These files may be loacted on a
local machine or somewhere on the network. I use the Management Base
Object to set these permissions which works perfectly when the windows
service is running on an XP machine. However, when the service is
running on a Windows Server 2003 machine I get an error.

When the following code is executed an exception is thrown with a
meassge of "Not Found"!

Dim outparams As ManagementBaseObject =
objFile.InvokeMethod("GetSecurityDescriptor", Nothing, options)

I am not sure if this problem is specific to running a Windows Service
on a Windows Server 2003 machine or if a normal executable would also
produce the same result.

Any help or suggestions would be greatly appreciated on this.

Kind Regards.

Ger.

解决方案

If the code works as expected in XP it should behave correctly in w2k3 also
.. Please make sure the fileobject on which you are trying to invoke the
method exists in w2k3 machine.

And yes it will be worth while to see if the problem repros with a normal
exe.

--
Sarika Sharma [MSFT]
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.

"Ger" <ge*******@hotmail.com> wrote in message
news:1a*************************@posting.google.co m...

I am having problems using VB.Net''s Management base object on a
machine hosting Windows Server 2003. I am trying to set file
permissions from a Windows Service. These files may be loacted on a
local machine or somewhere on the network. I use the Management Base
Object to set these permissions which works perfectly when the windows
service is running on an XP machine. However, when the service is
running on a Windows Server 2003 machine I get an error.

When the following code is executed an exception is thrown with a
meassge of "Not Found"!

Dim outparams As ManagementBaseObject =
objFile.InvokeMethod("GetSecurityDescriptor", Nothing, options)

I am not sure if this problem is specific to running a Windows Service
on a Windows Server 2003 machine or if a normal executable would also
produce the same result.

Any help or suggestions would be greatly appreciated on this.

Kind Regards.

Ger.



Hi Sarika,

My codes works fine when I run it from a normal executable in w2k3.
The problem seems to stem from the fact the code is being executed
from a windows service. Any Ideas?

Thanks,

Ger.

"Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message news:<ut*************@TK2MSFTNGP11.phx.gbl>...

If the code works as expected in XP it should behave correctly in w2k3 also
. Please make sure the fileobject on which you are trying to invoke the
method exists in w2k3 machine.

And yes it will be worth while to see if the problem repros with a normal
exe.

--
Sarika Sharma [MSFT]
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.

"Ger" <ge*******@hotmail.com> wrote in message
news:1a*************************@posting.google.co m...

I am having problems using VB.Net''s Management base object on a
machine hosting Windows Server 2003. I am trying to set file
permissions from a Windows Service. These files may be loacted on a
local machine or somewhere on the network. I use the Management Base
Object to set these permissions which works perfectly when the windows
service is running on an XP machine. However, when the service is
running on a Windows Server 2003 machine I get an error.

When the following code is executed an exception is thrown with a
meassge of "Not Found"!

Dim outparams As ManagementBaseObject =
objFile.InvokeMethod("GetSecurityDescriptor", Nothing, options)

I am not sure if this problem is specific to running a Windows Service
on a Windows Server 2003 machine or if a normal executable would also
produce the same result.

Any help or suggestions would be greatly appreciated on this.

Kind Regards.

Ger.



What is the exact error code you are getting?

What is your service runnning as?

--
Sarika Sharma [MSFT]
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.

"Ger" <ge*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...

Hi Sarika,

My codes works fine when I run it from a normal executable in w2k3.
The problem seems to stem from the fact the code is being executed
from a windows service. Any Ideas?

Thanks,

Ger.

"Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message


news:<ut*************@TK2MSFTNGP11.phx.gbl>...

If the code works as expected in XP it should behave correctly in w2k3 also . Please make sure the fileobject on which you are trying to invoke the
method exists in w2k3 machine.

And yes it will be worth while to see if the problem repros with a normal exe.

--
Sarika Sharma [MSFT]
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.

"Ger" <ge*******@hotmail.com> wrote in message
news:1a*************************@posting.google.co m...

I am having problems using VB.Net''s Management base object on a
machine hosting Windows Server 2003. I am trying to set file
permissions from a Windows Service. These files may be loacted on a
local machine or somewhere on the network. I use the Management Base
Object to set these permissions which works perfectly when the windows service is running on an XP machine. However, when the service is
running on a Windows Server 2003 machine I get an error.

When the following code is executed an exception is thrown with a
meassge of "Not Found"!

Dim outparams As ManagementBaseObject =
objFile.InvokeMethod("GetSecurityDescriptor", Nothing, options)

I am not sure if this problem is specific to running a Windows Service
on a Windows Server 2003 machine or if a normal executable would also
produce the same result.

Any help or suggestions would be greatly appreciated on this.

Kind Regards.

Ger.



这篇关于VB.Net WMI Windows Server 2003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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