Ok...can anybody provide me with a sample code for the following:

Its in java .It enables the server to detect the presence or absence of a keyboard or a hdd on a client m/c on a lan.The server is a winNT server.
Clients run WinXP.

If not the code can anyone even tell me how do i doit on my own,like which
funcn/class should i use,and where can i get more required info on this.

The easiest way to interact with the hardware using windows is using the windows APIs. Read about JNI (which will be used to implement the winAPI) ... and read about winAPI in msdn library.