470,561 Members | 1,642 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,561 developers. It's quick & easy.

Security Problems accessing System.Management.dll from a Windows Service


I have a problem with a Windows Service that I have created accessing
System.Management.dll on a W2k3 environment. The Service runs fine on
an XP machine but the same Service causes an error once it tries to
access System.Management.Dll. The service is run using a Domain Admin

The code is trying to set permissions for a file and looks like this:
Dim objFile As New ManagementObject(New
ManagementPath("Win32_LogicalfileSecuritySetting=' " + _
FolderPath.Replace("\", "\\") + "'"))

Dim options As New InvokeMethodOptions(Nothing, New TimeSpan(0, 0, 0,

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

It is the last line where the following error happens:

"MESSAGE: Not found

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

I added a strong name to the Service and added the approriate
permissions using the Runtime Security Policy tool. Then I got the
same error when I run the service on XP as I did with W2K3.

I would really appreciate any help on this.

Thank in advance.

Jul 21 '05 #1
0 1701

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

116 posts views Thread by Mike MacSween | last post: by
10 posts views Thread by Jayme Pechan | last post: by
7 posts views Thread by Magdelin | last post: by
8 posts views Thread by =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.