473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

VB.Net WMI Windows Server 2003

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.
Nov 20 '05 #1
10 3448
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.

Nov 20 '05 #2
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.

Nov 20 '05 #3
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.

Nov 20 '05 #4
Ger
The exact error code I get is "NotFound"! My service is running as a
Domian Admin account.

Could it be anything to do with policies?

Appreciate the help.

Ger.
"Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message news:<Oh**************@TK2MSFTNGP09.phx.gbl>...
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.

Nov 20 '05 #5
The domain admin account should be able to perform this action.

NotFound management exception indicates that the management object you are
trying to work with does not exist. which is not explaining well as with
normal exe you are able to .

Did you run normal exe under domain admin as well?

--
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...
The exact error code I get is "NotFound"! My service is running as a
Domian Admin account.

Could it be anything to do with policies?

Appreciate the help.

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

news:<Oh**************@TK2MSFTNGP09.phx.gbl>...
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.

Nov 20 '05 #6
Ger
Yes it does seem like the service is having problems finding the
management object but this is strange as I run the normal exe under
Domain Admin too. I will check if I can use the WMI object directly
instead of using the managemnet object to see if this may help.

Thanks.

Ger.

"Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message news:<ud**************@TK2MSFTNGP10.phx.gbl>...
The domain admin account should be able to perform this action.

NotFound management exception indicates that the management object you are
trying to work with does not exist. which is not explaining well as with
normal exe you are able to .

Did you run normal exe under domain admin as well?

--
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...
The exact error code I get is "NotFound"! My service is running as a
Domian Admin account.

Could it be anything to do with policies?

Appreciate the help.

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

news:<Oh**************@TK2MSFTNGP09.phx.gbl>...
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.

Nov 20 '05 #7
Ger
Hello Again,

I have pulled out as much error information that I can get. Maybe this
may help to solve the problem.

MESSAGE: Not found

STACK TRACE:
at System.Management.ManagementException.ThrowWithExt endedInfo(ManagementStatus
errorCode)
at System.Management.ManagementObject.InvokeMethod(St ring
methodName, ManagementBaseObject inParameters, InvokeMethodOptions
options)
at Permissions_Service.MgmtModule.AddRoleToFolder(Str ing
FolderPath, String[] SIDsToAdd)

ERROR CODE:-2147217406

ERROR INFORMATION:
{System.Management.ManagementBaseObject}
ClassPath: {System.Management.ManagementPath}
Container: Nothing
Item: <cannot view indexed property>
Properties: {System.Management.PropertyDataCollection}
Qualifiers: {System.Management.QualifierDataCollection}
Site: Nothing
SystemProperties: {System.Management.PropertyDataCollection}

GET TYPE:
[System.RuntimeType]: {System.RuntimeType}
Assembly: {System.Reflection.Assembly}
AssemblyQualifiedName: "System.Management.ManagementException,
System.Management, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
Attributes: 1056769
BaseType: {System.RuntimeType}
DeclaringType: Nothing
DefaultBinder: {System.DefaultBinder}
Delimiter: "."c
EmptyTypes: {Length=0}
FilterAttribute: {System.Reflection.MemberFilter}
FilterName: {System.Reflection.MemberFilter}
FilterNameIgnoreCase: {System.Reflection.MemberFilter}
FullName: "System.Management.ManagementException"
GUID: {System.Guid}
HasElementType: False
IsAbstract: False
IsAnsiClass: True
IsArray: False
IsAutoClass: False
IsAutoLayout: True
IsByRef: False
IsClass: True
IsCOMObject: False
IsContextful: False
IsEnum: False
IsExplicitLayout: False
IsImport: False
IsInterface: False
IsLayoutSequential: False
IsMarshalByRef: False
IsNestedAssembly: False
IsNestedFamANDAssem: False
IsNestedFamily: False
IsNestedFamORAssem: False
IsNestedPrivate: False
IsNestedPublic: False
IsNotPublic: False
IsPointer: False
IsPrimitive: False
IsPublic: True
IsSealed: False
IsSerializable: True
IsSpecialName: False
IsUnicodeClass: False
IsValueType: False
MemberType: TypeInfo
Missing: {System.Reflection.Missing}
Module: {System.Reflection.Module}
Name: "ManagementException"
Namespace: "System.Management"
ReflectedType: Nothing
TypeHandle: {System.RuntimeTypeHandle}
TypeInitializer: Nothing
UnderlyingSystemType: {System.RuntimeType}

TARGIT SITE:
{System.Reflection.RuntimeMethodInfo}
[System.Reflection.RuntimeMethodInfo]:
{System.Reflection.RuntimeMethodInfo}
Attributes: 147
CallingConvention: Standard
DeclaringType: {System.RuntimeType}
IsAbstract: False
IsAssembly: True
IsConstructor: False
IsFamily: False
IsFamilyAndAssembly: False
IsFamilyOrAssembly: False
IsFinal: False
IsHideBySig: True
IsPrivate: False
IsPublic: False
IsSpecialName: False
IsStatic: True
IsVirtual: False
MemberType: Method
MethodHandle: {System.RuntimeMethodHandle}
Name: "ThrowWithExtendedInfo"
ReflectedType: {System.RuntimeType}
Kind Regards,

Ger.
ge*******@hotmail.com (Ger) wrote in message news:<1a**************************@posting.google. com>...
Yes it does seem like the service is having problems finding the
management object but this is strange as I run the normal exe under
Domain Admin too. I will check if I can use the WMI object directly
instead of using the managemnet object to see if this may help.

Thanks.

Ger.

"Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message news:<ud**************@TK2MSFTNGP10.phx.gbl>...
The domain admin account should be able to perform this action.

NotFound management exception indicates that the management object you are
trying to work with does not exist. which is not explaining well as with
normal exe you are able to .

Did you run normal exe under domain admin as well?

--
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...
The exact error code I get is "NotFound"! My service is running as a
Domian Admin account.

Could it be anything to do with policies?

Appreciate the help.

Ger.
"Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message news:<Oh**************@TK2MSFTNGP09.phx.gbl>... > 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.

Nov 20 '05 #8
I'm going to take an educated guess here and suggest that its a OS path
error.

If you developed the app on a XP machine, then the physical path to the
OS in your program would read, for example:

C:\Windows

instead of

C:\WINNT

For the Y2k3

I think! Since I don't have 2003 Server, I don't know if it follows the
C:\WINNT family path. But if it does, then that is the issue and the only
two ways I'm aware of to resolve the issue would to be install 2003 Server,
VB.Net on it and then compile the program with the right path.

Also, although I'm not sure if this would work--much less compile
correctly -- you may want to change:

<Reference
Name = "System.Management"
AssemblyName = "System.Management"
HintPath =
"..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1 .0.3705\System.Management.
dll"
/>
in your apllication .Net Project file (not the vbproj) to read

<Reference
Name = "System.Management"
AssemblyName = "System.Management"
HintPath =
"..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0 .3705\System.Management.dl
l"
/>


"Ger" <ge*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
Yes it does seem like the service is having problems finding the
management object but this is strange as I run the normal exe under
Domain Admin too. I will check if I can use the WMI object directly
instead of using the managemnet object to see if this may help.

Thanks.

Ger.

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

news:<ud**************@TK2MSFTNGP10.phx.gbl>...
The domain admin account should be able to perform this action.

NotFound management exception indicates that the management object you are trying to work with does not exist. which is not explaining well as with
normal exe you are able to .

Did you run normal exe under domain admin as well?

--
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...
The exact error code I get is "NotFound"! My service is running as a
Domian Admin account.

Could it be anything to do with policies?

Appreciate the help.

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

news:<Oh**************@TK2MSFTNGP09.phx.gbl>...
> 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.

Nov 20 '05 #9
Ger
We have finally figured out the prolem. The System.Management.dll on
W2k3 Server does not automatically give permissions to "Local Service"
and "Network Sewrvice" accounts. This is automatically done with XP.

Thanks to all who have provided help.

Ger.
"Richard T. Edwards" <re****@pwpsquared.net> wrote in message news:<10*************@corp.supernews.com>...
I'm going to take an educated guess here and suggest that its a OS path
error.

If you developed the app on a XP machine, then the physical path to the
OS in your program would read, for example:

C:\Windows

instead of

C:\WINNT

For the Y2k3

I think! Since I don't have 2003 Server, I don't know if it follows the
C:\WINNT family path. But if it does, then that is the issue and the only
two ways I'm aware of to resolve the issue would to be install 2003 Server,
VB.Net on it and then compile the program with the right path.

Also, although I'm not sure if this would work--much less compile
correctly -- you may want to change:

<Reference
Name = "System.Management"
AssemblyName = "System.Management"
HintPath =
"..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1 .0.3705\System.Management.
dll"
/>
in your apllication .Net Project file (not the vbproj) to read

<Reference
Name = "System.Management"
AssemblyName = "System.Management"
HintPath =
"..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0 .3705\System.Management.dl
l"
/>


"Ger" <ge*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
Yes it does seem like the service is having problems finding the
management object but this is strange as I run the normal exe under
Domain Admin too. I will check if I can use the WMI object directly
instead of using the managemnet object to see if this may help.

Thanks.

Ger.

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

news:<ud**************@TK2MSFTNGP10.phx.gbl>...
The domain admin account should be able to perform this action.

NotFound management exception indicates that the management object you are trying to work with does not exist. which is not explaining well as with
normal exe you are able to .

Did you run normal exe under domain admin as well?

--
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...
> The exact error code I get is "NotFound"! My service is running as a
> Domian Admin account.
>
> Could it be anything to do with policies?
>
> Appreciate the help.
>
> Ger.
>
>
> "Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message news:<Oh**************@TK2MSFTNGP09.phx.gbl>... > > 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.

Nov 20 '05 #10
Ger
We have finally managed to figure out the problem.
System.Management.dll does not have permission to the "Local Service"
and "Network Service" accounts automatically in W2k3 Server, but it
does in XP. Once I added these accounts my code runs fine.

Thanks to all who provided help.

Ger.
"Richard T. Edwards" <re****@pwpsquared.net> wrote in message news:<10*************@corp.supernews.com>...
I'm going to take an educated guess here and suggest that its a OS path
error.

If you developed the app on a XP machine, then the physical path to the
OS in your program would read, for example:

C:\Windows

instead of

C:\WINNT

For the Y2k3

I think! Since I don't have 2003 Server, I don't know if it follows the
C:\WINNT family path. But if it does, then that is the issue and the only
two ways I'm aware of to resolve the issue would to be install 2003 Server,
VB.Net on it and then compile the program with the right path.

Also, although I'm not sure if this would work--much less compile
correctly -- you may want to change:

<Reference
Name = "System.Management"
AssemblyName = "System.Management"
HintPath =
"..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1 .0.3705\System.Management.
dll"
/>
in your apllication .Net Project file (not the vbproj) to read

<Reference
Name = "System.Management"
AssemblyName = "System.Management"
HintPath =
"..\..\..\..\..\WINNT\Microsoft.NET\Framework\v1.0 .3705\System.Management.dl
l"
/>


"Ger" <ge*******@hotmail.com> wrote in message
news:1a**************************@posting.google.c om...
Yes it does seem like the service is having problems finding the
management object but this is strange as I run the normal exe under
Domain Admin too. I will check if I can use the WMI object directly
instead of using the managemnet object to see if this may help.

Thanks.

Ger.

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

news:<ud**************@TK2MSFTNGP10.phx.gbl>...
The domain admin account should be able to perform this action.

NotFound management exception indicates that the management object you are trying to work with does not exist. which is not explaining well as with
normal exe you are able to .

Did you run normal exe under domain admin as well?

--
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...
> The exact error code I get is "NotFound"! My service is running as a
> Domian Admin account.
>
> Could it be anything to do with policies?
>
> Appreciate the help.
>
> Ger.
>
>
> "Sarika Sharma[MSFT]" <sa*****@online.microsoft.com> wrote in message news:<Oh**************@TK2MSFTNGP09.phx.gbl>... > > 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.

Nov 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Nathan Sokalski | last post by:
I want to set up SQL Server on Windows XP Pro so that I can use the database capabilities of ASP and IIS. I am probably using some incorrect settings, but I am not sure what they are. Here is what...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
2
by: Ken Lindner | last post by:
I have a need to become familiar with SQL Server 2000 for work. Needless to say I am new to SQL Server any version, but not IT in general. My employer has provided me with the SQL Server 2000...
2
by: Vaap | last post by:
I did lot of googling to see if I can solve the SQL server not found problem while trying to run ASP.Net community starter kit from an XP machine to Windows 2003 server hosting SQL server 2000...
2
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
7
by: Cliff Harris | last post by:
I don't currently have an installation of Windows 2003 server, or I could answer this myself. After having a client install ASP.NET on Windows 2003, I then tried to find the aspnet_wp.exe process...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
0
by: Charles Leonard | last post by:
I am having yet another issue with Windows Server 2003. This time, the web service (a file import web service) appears to run except for one odd message: "ActiveX component can't create object". ...
3
by: Vinod R.Shenoy | last post by:
Hi All, Came across a post wherin you had helped somebody with a similar problem and was wondering if you could help us out with it. Our problem is , We have a development SQL Server 2000...
7
by: =?Utf-8?B?RWRkaWU=?= | last post by:
We have an odd situation with some of our single-threaded CPU-bound C++ programs. They run between 2 and 4 times faster on Windows XP than on windows Server 2003 on the same Xeon hyperthreading...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.