473,511 Members | 15,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to monitor and manage remote server

Hello,

I have to monitor a remote server for functions such as CPU
Utilization etc. I am using System.Management namespace for the same.

But when I try to execute the following code, it gives
System.UnauthorizedAccessException 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
ConnectionOptions options = new ConnectionOptions();
options.Username = "User1";
options.Password = "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
Nov 17 '05 #1
3 6165

"sushi" <su***@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
Hello,

I have to monitor a remote server for functions such as CPU
Utilization etc. I am using System.Management namespace for the same.

But when I try to execute the following code, it gives
System.UnauthorizedAccessException 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
ConnectionOptions options = new ConnectionOptions();
options.Username = "User1";
options.Password = "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.Username = "User1";
It should be of the form domain\user for downlevel domains or,
user@domain

Willy.
PS. System.Management and WMI questions are better answered in:
microsoft.public.dotnet.framework.wmi


Nov 17 '05 #2
Ya, i had given domain\username itself.

Sushi

"Willy Denoyette [MVP]" wrote:

"sushi" <su***@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
Hello,

I have to monitor a remote server for functions such as CPU
Utilization etc. I am using System.Management namespace for the same.

But when I try to execute the following code, it gives
System.UnauthorizedAccessException 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
ConnectionOptions options = new ConnectionOptions();
options.Username = "User1";
options.Password = "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.Username = "User1";
It should be of the form domain\user for downlevel domains or,
user@domain

Willy.
PS. System.Management and WMI questions are better answered in:
microsoft.public.dotnet.framework.wmi


Nov 17 '05 #3

"sushi" <su***@discussions.microsoft.com> wrote in message
news:A4**********************************@microsof t.com...
Ya, i had given domain\username itself.

Sushi


Try with "machinename\administrator" 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.
Nov 17 '05 #4

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

Similar topics

0
1514
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...
2
1038
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...
4
1986
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...
8
1796
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...
12
5239
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...
1
4188
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...
4
1522
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,...)
0
1173
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...
3
2224
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...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
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...
0
7349
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,...
0
7506
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...
1
5063
isladogs
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...
0
4734
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...
0
3219
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...
0
1572
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 ...
0
445
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...

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.