abstract administering applications and servers when not connected to the network can be a nightmare, especially when only a few people manage the application. just imagine going out for an evening on the town and then you’re paged at one o’clock in the morning with an alarming message that your application has gone down. for companies without virtual private networks (vpn) the task is even more difficult because now you must come to the office to rescue your application. microsoft’s .net framework provides easily accessible assemblies to read and modify imperative information about any given machine, and most importantly it also provides backwards compatibility to read and modify machines, which are not .net framework enabled. in this article, eric rockenbach shows us how to create a cpu console administration tool and appropriate secuirty scheme for any machine on our network. article when not connected to the network, administering applications and servers can be a nightmare, especially when only a few people manage the application. just imagine going out for an evening on the town and then you're paged at one o'clock in the morning with an alarming message that your application has gone down. for companies without virtual private networks (vpn) the task is even more difficult because now you must come to the office to rescue your application (vpn allows remote access of machines when both machines have the correct software installed). microsoft's .net framework provides easily accessible assemblies to read and modify imperative information about any given machine, and most importantly, it also provides backwards compatibility to read and modify machines which are not .net framework enabled. in this article we see how to create a cpu console administration tool and appropriate security scheme for any machine on our network. system requirements • server: windows 2000, iis 5.0, .net framework, (server hosting the cpu console application) • machine to be checked: windows 2000, nt • user's workstation: ie 5.0+, admin group of machine, admin group of server, win 2000 login account assumptions this article is designed to combine different elements of the .net framework to meet an important business challenge. we do not assume exposure to the assemblies mentioned, but having exposure to the .net framework will be helpful, especially when expanding on this article's functionality. designing an online cpu console implementing a cpu console over an entire network can be challenging - not only because of the cost of license fees for every machine, but also because the software must be installed on possible mission critical machines, in which domain administrators might not be allowed to install un-trusted software. in addition, the console must be open to the web, which means authentication and ssl on every machine, plus an open port, which is not a secure configuration to say the least. the challenge is to keep servers protected, yet still be able to administer these over the web for disconnected users. the sample application we develop demonstrates how the .net framework provides an elaborate library for administering events, processes, and services. .net handles the majority of the low level code that developers write to view system resources. we utilize .net's ability to use the installed framework on one machine to gain access and information about another machine that does not have the .net framework installed. one of the most impressive features of the .net framework is its extensive robust security model. many of .net's classes now provide properties that we can "get" or "set" to administer runtime security. .net also houses a complete assembly system.security, which features nothing but security settings and preferences. our cpu console application will capitalize on proper and efficient usage of windows 2000 role based security in conjunction with .net's inherent impersonation based security. we will authenticate the user in iis utilizing their windows 2000 account and domain, but you will still have to encrypt data from your browser through conventional ssl methods. microsoft's asp.net authenticated impersonation security model.
a web control library (a library of custom aspx controls) is preferred because of its excellent reusability benefits. building an online cpu console users may have a variety of domains and machines that they need to connect to. consider what features will integrate best over a web interface, given that time may be of the essence to users. our online cpu console consists of two projects: a web control library, which houses the core classes, and an asp.net web application, which calls the web control library .dll. the web control library contains three custom web control class files: services, processes and events. asp.net web application contains three web forms that call the custom web controls. let's take a look at the architecture of the code available for download. wroxcontrollib our web control library contains ready-to-use custom web controls which in turn access events, processes, and services of any pc.
eventlog.cs - custom control displaying all events in any given log (application, system, or security), and replicates the windows event viewer.
process.cs - custom control displaying all processes currently running on a machine, and also stops processes chosen by the client. process.cs replicates the process panel of the task manager.
services.cs - custom control displaying all services installed on any machine. similar to windows service console, services.cs also allows a user to start and stop a service.
wroxcpuconsole an asp.net web application that requests custom web controls in the wroxcontrollib.dll. included in this project are the security settings allowing impersonation after iis user authentication.
vw_eventlog.aspx -requests the eventlog.cs custom control.
vw_process.aspx -requests the process.cs custom control.
vw_service.aspx -requests the services.cs custom control.
web.config - web configuration file supports asp.net's impersonation based identity and windows authentication.