473,700 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Security Problems accessing System.Manageme nt.dll from a Windows Service

Ger
Hi,

I have a problem with a Windows Service that I have created accessing
System.Manageme nt.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.Manageme nt.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 ManagementObjec t(New
ManagementPath( "Win32_Logicalf ileSecuritySett ing='" + _
FolderPath.Repl ace("\", "\\") + "'"))

Dim options As New InvokeMethodOpt ions(Nothing, New TimeSpan(0, 0, 0,
5))

Dim outparams As ManagementBaseO bject =
objFile.InvokeM ethod("GetSecur ityDescriptor", Nothing, options)


It is the last line where the following error happens:

"MESSAGE: Not found

STACK TRACE: at System.Manageme nt.ManagementEx ception.ThrowWi thExtendedInfo( ManagementStatu s
errorCode)
at System.Manageme nt.ManagementOb ject.InvokeMeth od(String
methodName, ManagementBaseO bject inParameters, InvokeMethodOpt ions
options)
at Permissions_Ser vice.MgmtModule .AddRoleToFolde r(String
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.
Nov 20 '05 #1
0 866

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

Similar topics

0
1936
by: Ger | last post by:
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:
2
14041
by: Paul Gronka | last post by:
I've got a VB.NET windows application (written in VS .NET 2003) that makes a call to WMI for retrieving the MAC Address from the client's PC. It works on 4 out of the 5 PC's tested so far. All the workstations are DELLs running XP SP1a with the 1.1 .NET Framework. The following line of code generates an exception on the one PC: Dim oMac As New System.Management.ManagementClass("Win32_NetworkAdapterConfiguration") The error it...
116
7517
by: Mike MacSween | last post by:
S**t for brains strikes again! Why did I do that? When I met the clients and at some point they vaguely asked whether eventually would it be possible to have some people who could read the data and some who couldn't but that it wasn't important right now. And I said, 'sure, we can do that later'. So now I've developed an app without any thought to security and am trying to apply it afterwards. Doh!, doh! and triple doh!
10
1778
by: Jayme Pechan | last post by:
I wrote a very simply web application and I'm having all sorts of problems with the security getting in the way. All the web application does is load an out-of-process COM server that is running as a service. The code is here written for both a WinForm C# application (which works correctly) and a Web application (which does not work correctly): // C# application xtapisvrLib.XtapiConfig x = new xtapisvrLib.XtapiConfigClass(); ...
8
1807
by: Manfred Braun | last post by:
Hello All! I am writing a management application, which has to access remote machines registry via System.Diagnostics.EventLog.CreateEventSource . For each machine, I connect to, I create a DirectoryEntry and connect to that machine specifying credentials. That's becauase the running user does not has the right permissions . The application is written in C# and the action taken is done with threads from the threadpool.
7
1984
by: Magdelin | last post by:
Hi, My security team thinks allowing communication between the two IIS instances leads to severe security risks. Basically, we want to put our presentation tier on the perimeter network and the business tier inside the fire wall or internal network. The biz tier will be developed and deployed as web services on IIS. I know microsoft recommends this architecture but I am not able to convince my security team. They say IIS is vulnerable...
2
2247
by: KaNos | last post by:
Hello world, I've made a webservice (c# v2) to install in a server IIS 6 on a Windows 2000 last SP. We can use the webservice in local, throw the pages wich present the methods, with a windows mode connection (<authentication mode="Windows"/>) if impersonate is false (<identity impersonate="false"/>). Note that i use the administrator user to be sure. But when I change impersonate element (<identity impersonate="true"/>) a system...
1
1858
by: Ian | last post by:
I am developing a .NET Web Service that acts as a thin calling layer for a larger object. Thus the larger object runs in the context of the web service that is calling it, and is therefore subject to the security restrictions of the Web Server the web service is run through. All well and good. At the end of the main method call of the larger object, it instantiates and calls (through a RCW) a method of a legacy COM object that writes...
0
1532
by: jacorona | last post by:
Hello all, I have found a problem accesing a web service hosted in IIS 5.0 in a W2K box. The web service site is configured to accept both integrated windows authentication and client certificates. I have a WinForm 2.0 client application and when it presents a certificate it works fine, but when it tries to access the web service using integrated security it times out. Both accesses are via an https: uri. Moreover, an .aspx page in the...
8
13336
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= | last post by:
Hi, I created a web service and hosted it in Windows Services. It is working fine. Now I am trying to implement the X509 certificates for message layer security. But it is throwing the following exception: An unhandled exception of type 'System.ServiceModel.Security.SecurityNegotiationException' occurred in mscorlib.dll
0
8645
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9214
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8925
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7810
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4404
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4657
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3089
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.