Tag archive for: WMI

How to get information about all the printers that are installed in my windows machine from a C# program via WMI

I need to create a windows service that is able to send some print jobs to one of the installed printers. As this is a windows service, it has to be able to find the printer with a preset printer name. This post details some prototyping codes that I had created to determine whether I am able to locate information of all the printers that are installed in the windows host where my windows service will run.

How to retrieve the username of the user who logged onto Windows from windows service

Recently, I have been tasked to write a .NET application that will prepare the operating system environment for a user who had logged on a Windows 7 machine. As a first step, the application should grab some settings from the network by providing the username of the user to a server application. The application will then prepare the operating system environment based on the settings received.