Remove cached passwords on Windows

Windows caches your user names and passwords entered for network shares, drives etc. That’s fine until there’s an incorrect password or username in the cache, and you want to remove it.

The utility to delete cached credentials is hard to find. It stores both certificate data and also user passwords.

Open a command prompt, or enter the following in the run command:

rundll32.exe keymgr.dll, KRShowKeyMgr


Powershell, WmiObject and a corrupt repository

For Windows Vista, Windows 7, Windows Server 2008, and Windows Server 2008 R2, you can run winmgmt /verifyrepository from a command prompt. For Older OS like Windows XP and Windows Server 2003 run: WmiDiag tool with the checkconsistency option. For example: WmiDiag checkconsistency

If repository is found to be inconsistent, for Vista and newer, run from elevated command prompt:
Winmgmt /salvagerepository

Note this command will take the content of the inconsistent repository and merge it into the rebuilt repository if it is readable

If the above doesn’t work, then run:
Winmgmt /resetrepository

Note this will reset repository to the initial state when the OS was first installed


Change the time zone in Windows 7

By default, the time zone in Windows 7 is set to  -8:00 Pacific Time (US & Canada). There are multiple ways to change the time zone. This post shows you two ways to change the time zone in Windows 7.

Solution 1:

  1. Right click on the clock, at the right bottom of your screen, and click on Adjust Date/Time.
  2. Click on the Change time zone button
  3. Select the correct time zone and click OK. If you are in a region with DST, make sure you have checked the “Automatically adjust clock for Daylight Saving Time” checkbox.

Solution 2:

  1. Click the Windows Orb and type “cmd” in de Search box. Press Enter.
  2. Type TZUTIL /L and press Enter. TZUTIL is a tool in Windows 7 which lets you set the time zone from the command line.
  3. From the output of the command TZUTIL /L (which is quite a long list 🙂 ), record the time zone you want to change to.
  4. Type TZUTIL /S “time zone . So, in case you want to change the time zone to (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna, you should type:  TZUTIL /S “W. Europe Standard Time”.

For more information about TZUTIL, just type TZUTIL and press Enter.

Using PowerShell as the Shell on Windows Server Core

With PowerShell becoming one of the most important tools in a Windows administrator’s tool bag as well as really becoming the best prompt to use on Windows Server Core, I thought it was about time I documented how to change the command prompt that opens when you log into Server Core with a PowerShell prompt.

To complete this requires two steps:

  1. Enable/Install PowerShell on the Windows 2008 R2 Server Core computer
  2. Update the HKLMSoftwareMicrosoftWindows NTCurrentVersionWinLogonShell registry key replacing cmd.exe with PowerShell.exe

To enable PowerShell run SCONFIG from the command prompt and then select menu options 4 then 2. This will require the computer to be rebooted

Once rebooted login and in the CMD prompt type PowerShell. At the PowerShell prompt type:


Having completed above log off and back on and a powershell prompt will open instead.


How to Use Nslookup to Verify MX record configuration

As I have been installing, configuring, and testing our Microsoft Exchange Server I have had to test the DNS system to ensure our domain is registared and working properly. This is something that all system administrators should know how to do, but the exact syntax is often forgotten.
This operation can be done on Windows 7 and Windows Server 2003/2008 R2. There are similar options if you are doing this from Linux.

  1. Open a Command Prompt (Start, Run, cmd, [Enter])
  2. Type nslookup.
  3. Server (The DNS server that you want to use. This is optional.)
  4. Set q=mx (This sets the query type to “MX” {Mail Exchanger}.)
  5. (The domain name you want to lookup the mail exchanger to.)


Windows Update WUAUCLT Command Line Switches

The command line switches to WUAUCLT — the Windows Update Automatic Updates client — are documented, just not very coherently. There’s quite a few of them, but the only ones I need regularly are the ones to force update checks. They work with Windows 2000 Server and Windows Server 2003, though they make work on other versions.

Continue reading Windows Update WUAUCLT Command Line Switches

Alternate Credentials

Launching Tools Using Alternate Credentials from a Command Prompt Window

One of the easiest ways to launch tools using alternate credentials is to first launch a Command Prompt with the credentials you want to use. Once the Command Prompt is launched using the alternate credentials, all subsequent commands and tools run from that Command Prompt start using the elevated credentials you provided. Continue reading Alternate Credentials