Tuesday, August 9, 2011

Useful commands for Windows administrators

Managing a Windows 2000 Active Directory with about 100 servers, over 1500 computers and 35 sites, the following commands often helped me answer questions or solve problems.
Most commands are "one-liners", but for some I had to make an exception and go to the right directory first.

These commands could all be used in batch files, though some may need some "parsing" with FOR /F to retrieve only the required substrings from the displayed information.

Notes: (1) Commands that use external, or third party, or non-native utilities contain hyperlinks to these utilities' download sites.
(2) Replace command arguments displayed in italics with your own values.
(3) Commands or utilities that require Windows Server 2003 are marked bright blue.
Warning: Most commands on this page are very powerful tools.
Like most powerful tools they could cause a lot of damage in the hands of insufficiently skilled users.
Treat these commands like you would (or should) treat a chainsaw: with utmost care. Do not use them if you do not fully understand what they do or how they do it.
Any damage caused using these commands is completely your own responsibility.

How many users are logged on/connected to a server?

Sometimes we may need to know how many users are logged on to a (file) server, like maybe when there is a performance degradation.
At the server's console itself, with native commands only:

    NET SESSION | FIND /C "\\"

Remotely, with the help of SysInternals' PSTools:

    PSEXEC \\servername NET SESSION | FIND /C "\\"

By replacing FIND /C "\\" by FIND "\\" (removing the /C switch) you'll get a list of logged on users instead of just the number of users.




Friday, April 8, 2011

Getting Sound to work with Windows Server 2003 and Virtual PC 2007

Getting Sound to work with Windows Server 2003 and Virtual PC 2007

While I've read that the audio device which Virtual PC uses is not officially supported under Windows 2003 Server, I did find a blog entry which somewhat explained how to get it working. I offer my version of what worked based on my trial and errors with the original blog.

1. Either mount the ISO or load the Windows XP product CD so you can access it via your Windows 2003 VPC

2. Create a folder on your VPC desktop called "sound" (we just need it for a bit)

3. On the CD, navigate to the i386 directory and locate the following file: WDMA_CTL.IN_

4. Copy the WDMA_CTL.IN_ file to the "sound" directory you just created on your VPC desktop

5. Go back to the CD and navigate to the Driver.CAB file - inside there you will find a file called ctlsb16.sys you want to Extract that to your "sound" folder.

6. Get thee to a command prompt (dunno why I wanted to say that) and navigate to your "sound" folder

7. From the command prompt type "Extract WDMA_CTL.IN_ WDMA_CTL.INF" (without the quotes - did I really need to include that?)

8. Now you should be able to install the drivers for the virtual SB 16 device on the VPC - but wait there's more!

9. You may need to go to the Control Panel - select Sound and Audio Devices and enable the sound service - This will require a reboot and then you should be able to hear audio on your Windows 2003 VPC.