Hello,
I have to monitor a remote server for functions such as CPU
Utilization etc. I am using System.Manageme nt namespace for the same.
But when I try to execute the following code, it gives
System.Unauthor izedAccessExcep tion though the user which I have provided is a
valid domain user having administratice rights on that computer.
Code:
//Build an options object for the connection
ConnectionOptio ns options = new ConnectionOptio ns();
options.Usernam e = "User1";
options.Passwor d = "MyPassword ";
//Make a connection to a remote computer using these options
ManagementScope scope = new ManagementScope ("\\\\Server1\\ root\\cimv2",
options);
scope.Connect() ;
Can any one help me out for this?
Thanks,
Sushi 3 6182
"sushi" <su***@discussi ons.microsoft.c om> wrote in message
news:29******** *************** ***********@mic rosoft.com... Hello,
I have to monitor a remote server for functions such as CPU Utilization etc. I am using System.Manageme nt namespace for the same.
But when I try to execute the following code, it gives System.Unauthor izedAccessExcep tion though the user which I have provided is a valid domain user having administratice rights on that computer.
Code:
//Build an options object for the connection ConnectionOptio ns options = new ConnectionOptio ns(); options.Usernam e = "User1"; options.Passwor d = "MyPassword ";
//Make a connection to a remote computer using these options ManagementScope scope = new ManagementScope ("\\\\Server1\\ root\\cimv2", options); scope.Connect() ;
Can any one help me out for this?
Thanks,
Sushi
How did you spell this Username?
options.Usernam e = "User1";
It should be of the form domain\user for downlevel domains or,
user@domain
Willy.
PS. System.Manageme nt and WMI questions are better answered in:
microsoft.publi c.dotnet.framew ork.wmi
Ya, i had given domain\username itself.
Sushi
"Willy Denoyette [MVP]" wrote: "sushi" <su***@discussi ons.microsoft.c om> wrote in message news:29******** *************** ***********@mic rosoft.com... Hello,
I have to monitor a remote server for functions such as CPU Utilization etc. I am using System.Manageme nt namespace for the same.
But when I try to execute the following code, it gives System.Unauthor izedAccessExcep tion though the user which I have provided is a valid domain user having administratice rights on that computer.
Code:
//Build an options object for the connection ConnectionOptio ns options = new ConnectionOptio ns(); options.Usernam e = "User1"; options.Passwor d = "MyPassword ";
//Make a connection to a remote computer using these options ManagementScope scope = new ManagementScope ("\\\\Server1\\ root\\cimv2", options); scope.Connect() ;
Can any one help me out for this?
Thanks,
Sushi
How did you spell this Username? options.Usernam e = "User1"; It should be of the form domain\user for downlevel domains or, user@domain
Willy. PS. System.Manageme nt and WMI questions are better answered in: microsoft.publi c.dotnet.framew ork.wmi
"sushi" <su***@discussi ons.microsoft.c om> wrote in message
news:A4******** *************** ***********@mic rosoft.com... Ya, i had given domain\username itself.
Sushi
Try with "machinename\ad ministrator" where machinename is the name of the
server you want to connect with.
If this works, you need to make sure your domain user has appropriate rights
(remote enable)to access the WMI namespace, use wmimgmt.msc and check the
security settings.
Willy. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Anthony |
last post by:
We have begun to use OEM to monitor/manage our Oracle Databases; we
have quite a few SQL Server databases as well and we would like to use
OEM to monitor those databases as best as possible (As much as the
product allows us to). Does anybody out there have any experience
with this and if so would you mind offering some tips on how to use
OEM for this or if you can point me to some good articles/doc/papers
that tells you how to use OEM...
|
by: David Wagner |
last post by:
Hi,
I am looking at wanting to configure and manage some
Performance Monitor logs through a C# application.
Specifically, I want to be able to define and configure
named performance log configurations and be able to start
and stop the logging through my application. I have done
some digging, but have not been able to figure how I would
do this from C#.
|
by: Joannes Vermorel |
last post by:
I would like to implement an MarshalByRef object similar to
System.Threading.Monitor. The interface would look like
class RemoteMonitor : MarshalByRef
{
public void Enter(object obj, Guid threadID) { ... }
public void Exit(object obj, Guid threadID) { ... }
}
Let assume that each remote Threads has its unique identifier, I would like
|
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.
|
by: Perecli Manole |
last post by:
I am having some strange thread synchronization problems that require me to
better understand the intricacies of Monitor.Wait/Pulse.
I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock block
protecting a resource. Thread 2 and 3 also have a SyncLock block protecting
the same resource and after executing some code in their blocks they both do
a Monitor.Pulse to hand of the locked resource back to thread 1.
While thread 1 has...
| |
by: brogdon |
last post by:
I'm attempting to build an ASP.NET (VB) application that will do
server-side printing of PDF files. I have used a Process object to
launch Adobe's AcroRd32 program with the /t switch which causes it to
open an Acrobat Reader window and silently send the document I want
printed to a local network printer:
Dim psiInfo As ProcessStartInfo = New ProcessStartInfo
(pathtoadobe, "/t " + filename + " " + printername)
psiInfo.CreateNoWindow =...
|
by: Rui |
last post by:
Can I write a windows service in .NET that monitors what happens on a server?
(e.g.. which applications where started, what files where accessed, registry
changes,...)
|
by: sklett |
last post by:
I've installed my server application on our server (win2k3, 64Bit version)
and when I try to attach to the process from my Win2k client machine I'm
getting an error stating I need to use the 64 bit version of Debugging
Monitor.
I've checked my visual studio installation directory and I ONLY have the x86
version.
I've also checked on my VS2k5 CD and can't find it.
Do any of you know where these files can be obtained?
|
by: adlloyd |
last post by:
Hi all,
I've got 4 servers running several instances (about 12) of an application. This application receives information from and external source and uploads it to a remote SQL Server database (the databases are then viewed by our customers through a web interface).
The problem is that recently, and as we've been adding more customers i.e. more application instances, our local area network and Internet connection appear to have slowed down...
|
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,...
|
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...
| |
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...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |