472,794 Members | 2,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,794 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 3381
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: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.