Hi,
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
acoount.
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,
5))
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
errorCode)
at System.Management.ManagementObject.InvokeMethod(St ring
methodName, ManagementBaseObject inParameters, InvokeMethodOptions
options)
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.
Ger.