Friday, March 08, 2013

10 Windows 7 commands every administrator should know

1: System File Checker

Malicious software will often attempt to replace core system files with modified versions in an effort to take control of the system. The System File Checker can be used to verify the integrity of the Windows system files. If any of the files are found to be missing or corrupt, they will be replaced. You can run the System File Checker by using this command:
sfc /scannow

2: File Signature Verification

One way to verify the integrity of a system is to make sure that all the system files are digitally signed. You can accomplish this with the File Signature Verification tool. This tool is launched from the command line but uses a GUI interface. It will tell you which system files are signed and which aren’t. As a rule, all the system files should be digitally signed, although some hardware vendors don’t sign driver files. The command used to launch the File Signature Verification tool is:
sigverif

3: Driverquery

Incorrect device drivers can lead to any number of system problems. If you want to see which drivers are installed on a Windows 7 system, you can do so by running the driverquery tool. This simple command-line tool provides information about each driver that is being used. The command is:
driverquery
If you need a bit more information, you can append the -v switch. Another option is to append the -si switch, which causes the tool to display signature information for the drivers. Here’s how they look:
driverquery -v
driverquery -si

4: Nslookup

The nslookup tool can help you to verify that DNS name resolution is working correctly. When you run nslookup against a host name, the tool will show you how the name was resolved, as well as which DNS server was used during the lookup. This tool can be extremely helpful when troubleshooting problems related to legacy DNS records that still exist but that are no longer correct.
To use this tool, just enter the nslookup command, followed by the name of the host you want to resolve. For example:
nslookup dc1.contoso.com

5: Ping

Ping is probably the simplest of all diagnostic commands. It’s used to verify basic TCP/IP connectivity to a network host. To use it, simply enter the command, followed by the name or IP address of the host you want to test. For example:
ping 192.168.1.1
Keep in mind that this command will work only if Internet Control Message Protocol (ICMP) traffic is allowed to pass between the two machines. If at any point a firewall is blocking ICMP traffic, the ping will fail.

6: Pathping

Ping does a good job of telling you whether two machines can communicate with one another over TCP/IP, but if a ping does fail, you won’t receive any information regarding the nature of the failure. This is where the pathping utility comes in.
Pathping is designed for environments in which one or more routers exist between hosts. It sends a series of packets to each router that’s in the path to the destination host in an effort to determine whether the router is performing slowly or dropping packets. At its simplest, the syntax for pathping is identical to that of the ping command (although there are some optional switches you can use). The command looks like this:
pathping 192.168.1.1

7: Ipconfig

The ipconfig command is used to view or modify a computer’s IP addresses. For example, if you wanted to view a Windows 7 system’s full IP configuration, you could use the following command:
ipconfig /all
Assuming that the system has acquired its IP address from a DHCP server, you can use the ipconfig command to release and then renew the IP address. Doing so involves using the following commands:
ipconfig /release
ipconfig /renew
Another handy thing you can do with ipconfig is flush the DNS resolver cache. This can be helpful when a system is resolving DNS addresses incorrectly. You can flush the DNS cache by using this command:
ipconfig /flushdns

8: Repair-bde

If a drive that is encrypted with BitLocker has problems, you can sometimes recover the data using a utility called repair-bde. To use this command, you will need a destination drive to which the recovered data can be written, as well as your BitLocker recovery key or recovery password. The basic syntax for this command is:
repair-bde <source> <destination> -rk | rp <source>
You must specify the source drive, the destination drive, and either the rk (recovery key) or the rp (recovery password) switch, along with the path to the recovery key or the recovery password. Here are two examples of how to use this utility:
repair-bde c: d: -rk e:\recovery.bek
repair-bde c: d: -rp 111111-111111-111111-111111-111111-111111

9: Tasklist

The tasklist command is designed to provide information about the tasks that are running on a Windows 7 system. At its most basic, you can enter the following command:
tasklist
The tasklist command has numerous optional switches, but there are a couple I want to mention. One is the -m switch, which causes tasklist to display all the DLL modules associated with a task. The other is the -svc switch, which lists the services that support each task. Here’s how they look:
tasklist -m
tasklist -svc

10: Taskkill

The taskkill command terminates a task, either by name (which is referred to as the image name) or by process ID. The syntax for this command is simple. You must follow the taskkill command with -pid (process ID) or -im (image name) and the name or process ID of the task that you want to terminate. Here are two examples of how this command works:
taskkill -pid 4104
taskkill -im iexplore.exe

Thursday, November 08, 2012

How to remove Active Desktop Recovery screen



  1. Go to Run and type regedit
  2. Now navigate to this path –HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components
  3. You would find a key named DeskHtmlVersion
  4. Right click the key and select Modify
  5. Under the label Base, select the radio button Decimal
  6. Change Value data to 0
  7. Click OK
This should do the trick. If the screen doesn’t go then try restarting your PC for the changes to take effect.

Monday, October 15, 2012

Event ID 1111 - Terminal Services Printer Redirection



I came across an issue with a remote user on a Mac that had a local printer attached and was trying to use printer redirection across rdp to our Win2k8 terminal server and rdp'ing from there to her office pc.  At one point it was working but then "stopped" all of a sudden.  Both x86 and x64 drivers were installed correctly on the ts box and her workstation.  Nothing stood out in the ts event viewer, but on her workstation I was getting a ton of event 1111 termservdevices errors like the one below:


Curious that her printer, the MFC7840W, was looking for an HP 4350 PS driver.  After reading more about the ntprintsubs.inf file and about the PrinterMappingINFName registry key, I was lead to theTerminal Server Printer Redirection Wizard Tool at MS kb239088.

Overview

The Terminal Server Printer Driver Redirection Wizard will help you troubleshoot and replace print drivers that were unsuccessfully redirected. This tool automates the process found in the Microsoft Knowledge Base article KB239088 entitled “Windows 2000 Terminal Services Server Logs Events 1111, 1105, and 1006” http://support.microsoft.com/?id=239088.

This tool will scan a server’s System Event Log and detect all events with Event ID 1111 and Source ‘TermServDevices.’ The tool will then scan the server’s registry for installed Version 3 MINI drivers, and prompt you to substitute an installed Version 3 MINI driver for each of the printers that failed printer redirection. Any changes will be written to a file named NTPrintSubs.inf which is where custom redirected printer mappings are stored.

Since the issue appeared to be her office workstation and not the terminal server, I extracted the package to a local folder on her pc and ran it.  After a few seconds of scanning the registry it found the issue with incorrect printer driver mappings between the HP 4350 PS and the MFC-7840W.  After a quick reboot, she was able to redirect her print jobs to her remote printer.  Good resource to know.

Friday, October 05, 2012

Cannot start Microsoft Office Outlook. MapI32.DLL is corrupt or the wrong version.

Office 2003 is compatible with Windows 7. However since you are having problems, try the following:

Rename MSMAPI32.dll to MSMAPI32.old.
Then try and start Outlook again.

The file path is C:\Program Files\Common Files\System\MSMAPI\1033 or do a search for MAPI32.dll.

If the rename doesn't help, then run fixmapi.exe - it's in one of the office folders or use search (use
advanced options for looking in hidden files and folders).


Wednesday, August 01, 2012

Rules do not work automatically


One of my rules which I have configured in Outlook does not work automatically. However, it does run fine when I choose “Run Rules Now…” manually. I don’t do anything fancy with the rule as all it does is moving the message to another folder.
How do I get this rule to run automatically?
This usually indicates a corruption of either the rule or within the mailbox. It could also indicate a corruption in the send/receive settings file (srs-file) of Outlook.

Reset srs-file

Resetting the send/receive settings can be achieved by renaming the srs-file of your profile to .old. You can find the srs-file for your mail profile in;
  • Windows Vista and Windows 7:
    C:\Users\%username%\AppData\Roaming\Microsoft\Outlook
  • Windows XP:
    C:\Documents and Settings\%username%\Application Data\Microsoft\Outlook
To easily locate the folders for you, you can also use OutlookTools (free!)

Fix corruption when using a POP3 or IMAP account

When you use a POP3 or IMAP account and the above fix doesn’t work, you can reset your rules and test your mailbox for corruptions with the steps below.
  1. Start with deleting the rule via;
    • Outlook 2007 and previous
      Tools-> Rules and Alerts…
    • Outlook 2010
      File-> Manage Rules & Alerts
  2. Determine the location of your pst-file;
    • Outlook 2007 and previous
      File-> Data File Management…
    • Outlook 2010
      File-> Account Settings-> Account Settings-> tab Data Files
  3. Close Outlook and run scanpst.exe against your pst-file to check it for errors
  4. Start Outlook again
  5. Recreate your rule.
Note: To force a deletion of all your rules at once, start Outlook with the /cleanrulesswitch;
  • Windows XP
    S
    tart-> Run; outlook.exe /cleanrules
  • Windows Vista and Windows 7
    Start-> type; outlook.exe /cleanrules
(note the space in the command)

Fix corruption when using an Exchange account

If you are within an Exchange environment, you can see if it works when you disable Cached Exchange Mode and then recreate the rule. If it does work now, locate the ost-file for your mail profile and rename it to .old and then enable Cached Exchange Mode again.
To determine the location of your ost-file and/or turn off Cached Exchange Mode;
  1. Right click on the root of your mailbox-> Properties-> button Advanced…-> tab Advanced
  2. Here you can enable/disable Cached Exchange Mode
  3. Click here on the button Offline Folder Settings… to see the location of your ost-file.

Monday, July 23, 2012

How To Use Remote Installation Service to Install Windows Server 2003 on Remote Computers

This step-by-step article describes how to use Remote Installation Service (RIS) to install Windows Server 2003 on remote computers.
You can use RIS to remotely set up new Microsoft Windows Server 2003-based computers by using a RIS network shared folder as the source of the Windows Server 2003 files. You can install operating systems on remote boot-enabled client computers. Client computers are connected to the network, and are then started by using a Pre-Boot eXecution Environment (PXE)-capable network adapter or remote boot disk. The client then logs on with a valid user account.
RIS Hardware Requirements
The following is the minimum hardware that is required for the RIS server:
  • The server must meet the minimum hardware requirements for the version of Windows Server 2003 that is installed.
  • A four gigabyte (GB) drive that is dedicated to the RIS directory tree on the RIS server.
  • A 10 or 100 megabit per second (Mbps) network adapter that supports TCP/IP. 100 Mbps is preferred.

  • NOTE
  • : Dedicate a whole hard disk or partition specifically to the RIS directory tree. SCSI-based disk controllers and disks are preferred.

  • The drive on the server on which you will install RIS must be formatted with the NTFS file system. RIS requires a lot of disk space, and you cannot install it on the same drive or partition on which Windows Server 2003 is installed. Make sure that the chosen drive contains enough free disk space for at least one full set of the installation files for the operating system you plan to remotely install.
Client Hardware Requirements
The following list describes the minimum hardware that is required for RIS client computers:
  • Meet the minimum operating system hardware requirements.
  • PXE DHCP-based boot ROM version 1.00 or later network adapter, or a network adaptor that is supported by the RIS boot disk.

  • NOTE
  • : Always contact the manufacturer of your network adapter to obtain the latest version of the PXE DHCP-based boot ROM.
Software Requirements
Several network services must be active and available for RIS. You can install the following services either on the RIS server or on other servers that are available on the network:
  • Domain Name System (DNS Service)
  • Dynamic Host Configuration Protocol (DHCP)
  • Active Directory "Directory" service
Prerequisites for Client Installations
Make sure that the client computer's network adapter has been set as the primary boot device in the computer BIOS. If the network adapter is configured as the primary boot device, the client requests a network service boot from the RIS server on the network when the client starts. After the client contacts the RIS, the client is prompted to press the F12 key to download the Client Installation Wizard. Do not press F12 unless you need a new operating system installation or access to maintenance and troubleshooting tools.
After the client operating system has been installed by using RIS, you can ignore the prompt to press F12 during future client computer startups. You can also reset the client BIOS so that the primary boot device is the floppy disk drive, the hard disk, or the CD-ROM drive.
To use the remote boot disk to start the installation, insert the boot disk into the floppy disk drive, and then start the client computer. The floppy disk drive must be set as the primary boot device in the client BIOS. After the computer starts from the disk, you are prompted to press F12 to start the network service boot process. You must remove the boot disk after you press F12 and before the text-mode portion of the operating system installation completes.
NOTE: You may have to press F12 on some Compaq computers during startup. In this case, you must press F12 on the Compaq startup screen, and then press F12 again when you are prompted by the RIS server.
Install Windows Server 2003 RIS
  1. Click Start, point to Control Panel, and then click Add or Remove Programs.
  1. Click Add/Remove Windows Components.
  1. Click to select the Remote Installation Services check box, and then click Next.

  1. NOTE
  2. : If you are prompted for the Windows Server 2003 installation files, put the Windows Server 2003 CD-ROM in the CD-ROM drive, and then click OK. After you do so, you may receive a message with options for upgrading the operating system. Click No.
  1. Click Finish, and then click Yes to restart your computer.
Set Up RIS
  1. Log on as a user with administrative privileges.
  1. Click Start, click Run, type risetup.exe, and then click OK to start the RIS Setup Wizard.
  1. When the "Welcome" screen appears, click Next.
  1. Type the drive letter and folder in which the RIS files are stored, and then click Next. For example, you might typeE:\RemoteInstall, and then click Next.
  1. After the RIS Setup Wizard copies the files, you are be prompted to enable or disable the RIS service, and the options are:
  • Respond to client computers requesting service
  • . If you select this option, RIS is enabled, and it will respond to client computers that are requesting service.
  • Do not respond to unknown client computers
  • . If you select this option, RIS only responds to known client computers.
  1. Click Respond to client computers requesting service, and then click Next.
  1. You are then prompted for the location of the client operating system installation files. Put the client operating system CD-ROM in the server CD-ROM drive, and then click Next.

  1. NOTE
  2. : Microsoft only supports the use of Microsoft media when creating a client operating system image. The use of non-Microsoft media is not supported.
  1. Type the folder name for the client operating system installation files on the RIS server, and then click Next.
  1. Type a friendly description for the operating system image. This is displayed to users after they start a remote client and run the Client Installation Wizard.
  1. Click Next, click Finish, and then click Done.
Authorize RIS in Active Directory
After you install RIS, the RIS server must be authorized in Active Directory. Authorization determines control of which RIS servers can serve client computers on the network. If the RIS server is not authorized in Active Directory, client computers that request service cannot contact the RIS server.
NOTE: To authorize a RIS server in Active Directory, you must be logged on as an enterprise administrator or a domain administrator of the root domain.
  1. Click Start, point to Administrative Tools, and then click DHCP.
  1. In the left pane, right-click DHCP, and then click Manage Authorized Servers.
  1. If your server is not listed, click Authorize, type the name or the IP address of the RIS server, and then click OK.

  1. NOTE
  2. : If you are prompted to confirm the RIS server, verify the name and IP address, and then click OK.
  1. Click Close, and then quit the DHCP console.
Set User Permissions
With RIS, clients can install their own client operating system. The users must also be granted permissions for creating computer accounts in the domain. To make it possible for users to create computer accounts anywhere in the domain:
  1. Click Start, point to Administrative Tools, and then click Active Directory Users and Computers.
  1. In the left pane, right-click your domain name, and then click Delegate Control.
  1. In the Delegation of Control Wizard, click Next.
  1. Click Add.
  1. Type the name of the group that requires permission to add computer accounts to the domain, and then click OK.
  1. Click Next.
  1. Click to select the Join a computer to the domain check box, and then click Next.
  1. Click Finish.
Install Clients By Using RIS
This section describes how to install a client operating system on a computer that contains a network adapter that supports PXE DHCP-based boot ROM. To install a client operating system:
  1. Make sure that the network adapter is set as the primary boot device in the computer BIOS.
  1. Restart the client computer from the network adapter.
  1. When you are prompted to do so, press F12 to start the download of the Client Installation Wizard.
  1. At the "Welcome" screen, press ENTER.
  1. Type a user name that has permissions to add computer accounts to the domain, and then type the domain name and password for this user.
  1. Press ENTER.
  1. When you receive a warning message that states that all data on the client computer hard disk will be deleted, press ENTER.
  1. A computer account and a global unique ID for this workstation are displayed. Press ENTER to start Setup.
  1. If you are prompted to do so, follow the instructions on the screen to complete the client operating system installation.
Remote Installation Boot Disk Option
You can use the remote installation boot disk with computers that do not contain a network adapter that supports PXE DHCP-based boot ROM. The boot disk is designed to simulate the PXE startup process. 
Rbfg.exe is a utility for creating network installation disks, and it is located in the RemoteInstall\Admin folder on every RIS server.
Creating a Boot Disk By Using the Windows Remote Boot Disk Generator
To create a remote installation boot disk:
  1. Locate the drive:\RemoteInstall\Admin\I386 folder on the RIS server, where drive is the drive on which RIS is installed.
  1. Double-click the Rbfg.exe file.
  1. Put a floppy disk in the floppy disk drive, and then click Create Disk.
  1. When you prompted to create another disk, click No, and then click Close.
NOTE: To view a list of supported network adapters, click Adapter List. You cannot add network adapters to this list.

Monday, July 09, 2012

FSMO Roles Explained


The FSMO Roles

Within Active Directory not all Domain Controllers are equal some have certain roles assigned to them, these roles need to be performed by a single Domain Controller. These roles are called the FSMO roles (Flexible Single Master Operations). There are 5 roles 2 of which are forest wide and the other 3 are domain wide roles.
The 5 roles are as follows:

Schema master (forest wide):

The Schema Master controls all updates to the Schema within the forest.

Domain Naming Master (forest wide):

The Domain Naming Master role is responsible for the creation and deletion of domains in the forest.

PDC Emulator (domain wide):

The PDC emulator role provides backwards compatability for Windows NT backup domain controllers (BDCs), the PDC emulator advertises itself as the primary domain controller for the domain. It also acts as the domain master browser and maintains the latest password for all users within the domain.

Infrastructure Master (domain wide):

The Infrastructure Manager role is responsible for updating references from objects within its domain with objects in other domains.

RID Master (domain wide):

The RID Master manages the Security Identifier (SID) for every object within the domain.

Explaining DNS Concepts - DNS Servers-DNS Queries-DNS Records

3 types of DNS queries— recursive, iterative, and non-recursive 3 types of DNS servers— DNS Resolver, DNS Root Server and Authoritative Name...