Tag: windows

Robocopy: How to copy files to a another drive, or server – only if they have changed?

With the robocopy, we can use the below syntax to copy everything from “x:\source” to “\\server\x\dest” including sub-directories:

robocopy x:\source \\server\x\dest /e /r:0 /w:0

Robocopy will look for the date and time stamp of each file. If the file has not changed, it will skip it.

Usage of parameters is as follows:

/e – This will include sub-folders, even if empty

/r:0 – Retry on failure zero times. No retries in this example. It will keep restarting the copy on failure

/w:0 – The number of seconds to wait between failures

Above won’t do is delete files on the destination if they have been deleted on the source. This can be attained by using /purge option:

robocopy X:\source \\server\X\dest /e /r:0 /w:0 /purge

Note: Usage of /purge will delete files on the destination. If you have an empty directory in source, you will end up with an empty directory on the destination.

-WintelAdmin

Filed under: Storage (EMC/NetApp), Windows(2003/2008/2012)Tagged with: , , , , , , ,

How to manually rebuild Performance Counters for Windows?

To rebuild all Performance counters including extensible and third-party counters in Windows, type the below commands at a command prompt.

cd\windows\system32

lodctr /R

Ensure that the counters are not disabled in the registry

The counters may be disabled via registry settings. Please check the following registry locations to ensure that the counters have not been disabled.

HKLM\System\CurrentControlSet\Services\%servicename%\Performance

%servicename% represents any service with a performance counter. For example: PerfDisk, PerfOS, etc.

There may be registry keys for “DisablePerformanceCounters” in any of these locations. This value should be set to 0. If the value is anything other than 0 the counter may be disabled.

A value of 1 means the counter is disabled.
A value of 2 means the 32-bit counter is disabled.
A value of 4 measn the 64-bit counter is disabled.

Thanks
WintelAdmin

Filed under: Windows(2003/2008/2012)Tagged with: , , , ,

How to Enable and disable NICs from command line?

Often when you are troubleshooting an issue with Windows Operating System, you would use the Command Prompt and there are scenarios were you would need to disable one of the NIC using command line, I often need this while troubleshooting with imaging issue. I’ve got the handy command.

C:\>wmic nic get name, index

you will find the output like
1 Broadcom NetLink (TM) Gigabit Ethernet
2 Broadcom NetLink (TM) Gigabit Ethernet #2
3 WAN Miniport (L2TP)
4 WAN Miniport (PPTP)
5 WAN Miniport (PPPOE)
6 WAN Miniport (IP)
7 Intel(R) WiFi Link 5100 AGN
8 WAN Miniport (Network Monitor)

Now, if you wish to disable “Broadcom NetLink (TM) Gigabit Ethernet #2”

Please execute the below command

C:\>wmic path win32_networkadapter where index=2 call disable

This should now disable the NIC “Broadcom NetLink (TM) Gigabit Ethernet #2”

Thanks
WintelAdmin

Filed under: Windows(2003/2008/2012)Tagged with: , , , , , ,

EMC Powerpath license registration

I was supposed to register EMC powerpath in one of the servers and I did not have an proper idea to do so. I did not have the key with myself.

Then after a lots of googling I found the command to check the EMC powerpath registration status.

C:\Users\administrator>powermt check_registration
There are no license keys now registered.

Then I logged into another server, executed the same command and got the key.

C:\Users\administrator>powermt check_registration

Key XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
Product: PowerPath
Capabilities: All

I then used the same key for the server using the command.

C:\Users\administrator>emcpreg -add XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
Success: License added

I succeeded in registration.

Filed under: Storage (EMC/NetApp), Windows(2003/2008/2012)Tagged with: , ,

How to change the SID and computer name of a cloned virtual machine?

In my daily life, I couldn’t imagine not having VMware Workstation to create labs or test case scenarios. On many occasions, I clone a vm in minutes to test something, but I often find that the SID remains the same. A simple utility exists that enables you to quickly change the SID and the computer name of a cloned virtual machine.

The utility is called NewSID v4.10 and is available for download free of charge.

After you download the application, extract the file to a drive and open a command prompt. Next, browse to the applicable directory.

Next, run the auto option to create a new SID and rename the computer. It takes a few minutes for the process to complete and the computer to reboot. When you log in to the computer again, the SID is brand new and the computer (Figure D) is automatically renamed.

newsid.exe /a [newcomputername]

Filed under: Windows(2003/2008/2012)Tagged with: , ,

How do I delete an orphaned share?

An orphaned share is one that the directory it shares has been deleted. If you delete a directory in Explorer that is shared any shares will automatically removed. If you delete by a different method, such as from the command prompt then the share will be left and it may result in messages in the System Event Log of the form:

You can manually update the registry to remove these “rogue” shares.

1. Start the registry editor (regedt32.exe)
2. Move to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares
3. There is an entry for each share
4. Click here to view image
5. Select the entry for the share you wish to delete and select Delete from the Edit menu.
6. Click Yes to the confirmation
7. If the share had special security set it will also have an entry under the Security sub-key so move to Security (under Shares), select the share value name and delete.

The simplest way to delete a share (orphaned or not) in Windows 2k3 is to manage the computer (right click “My Computer” and then connect to another if necessary), choose Shared Folders…Shares, then right click the share and choose “Stop Sharing”.

Filed under: Windows(2003/2008/2012)Tagged with: , , ,

Track User and Computer Sessions on Windows Server.

You can use Computer Management to track all connections to shared resources on a Windows Server 2008 R2 system. Whenever a user or computer connects to a shared resource, Windows Server 2008 R2 lists a connection in the Sessions node.

To view connections to shared resources, type net session at a command prompt or follow these steps:
1. In Computer Management, connect to the computer on which you created the shared resource.
2. In the console tree, expand System Tools, expand Shared Folders, and then select Sessions. You can now view connections to shares for users and computers.

The columns for the Sessions node provide the following important information about user and computer connections:
User The names of users or computers connected to shared resources. Computer names are shown with a $ suffix to differentiate them from users.
Computer The name of the computer being used.
Type The type of network connection being used.
# Open Files The number of files the user is actively working with. For more detailed information, access the Open Files node.
Connected Time The time that has elapsed since the connection was established.
Idle Time The time that has elapsed since the connection was last used.
Guest Whether the user is logged on as a guest.

Filed under: Windows(2003/2008/2012)Tagged with: , , ,

Black screen when I connect to my Windows server via RDP

Why do I get a black screen when I connect to my Windows server via RDP (Remote Desktop)?

This issue is a known Windows bug that occurs when the primary drive ( C: ) runs out of available free space. When this happens, Windows often overwrites control panel color settings for the desktop and login screen, resulting in the “blacked out” login screen and/or desktop.

When the login screen is black, you can often still access the normal Windows desktop, you just have to alt/tab through the various login screens:

When you first connect via RDP, there are two blanks you can tab through, the top one being the username (which should be Administrator,or, whatever you have set as your admin name), then, when you tab again, you will be in the password field. After entering the username and password, you should be able to Tab/Enter, and gain access to the system. If the system was just recently rebooted without warning, another screen (black) will pop up, asking why the server was rebooted. You can type anything here, and tab/enter again.

Filed under: Windows(2003/2008/2012)Tagged with: ,

Troubleshoot startup problems in Windows Server 2003.

A successful Windows startup includes of the following four phases:

1. Initial phase
2. Boot loader phase
3. Kernel phase
4. Logon phase

If a problem occurs during one of these phases, Windows may not start correctly and you may experience one of the following problems:

The computer stops responding (hangs).
You receive an error message.

If a startup problem occurs after you click Microsoft Windows Server 2003 from boot loader menu, files that the operating system needs may be missing or damaged.

Windows provides a variety of options that you can use to troubleshoot this issue, including Safe mode, the Recovery Console, and an Automated System Recovery. You may opt for the below listed options to recover your windows:

• The Last Known Good Configuration.

• Start the Computer in Safe Mode.

• Use Event Viewer to Identify the Cause of the Startup Problem.

• Use System Information to Identify the Cause of the Startup Problem.

• View the Safe Mode Boot Log File.

• Use Device Manager to Identify the Cause of the Startup Problem.

• Use System Configuration Utility (msconfig.exe).

• Isolate Problems by Using System Startup Options.

• Troubleshoot the System.ini File.

• Use the Microsoft Windows Recovery Console.

• Confirm That Your Hard Disk or File System Is Not Damaged.

• Use Automated System Recovery.

• Create an ASR Disk Set by Using Backup.

• Repair Your Installation of Windows.

• Use the Microsoft Product Support Services Web Site to Find a Solution.

Filed under: Windows(2003/2008/2012)Tagged with: , , ,

Windows Password Reset

Instructions:

• 1 Insert the BartPE disk.

•2 Restart your PC. Immediately start tapping “F8” or “Delete” until you get the BIOS screen. It will have a black background with white text.

•3 Highlight the “Boot” option with your arrow keys and press “Enter.” Select “Disc Drive” as the boot option and then press “F10.”

•4 Press “Yes” if it asks you to confirm the selection and then press “Enter” to reboot the PC.

•5 Click on the “Go” button when BartPE appears on the screen.

•6 Click on “Programs” > “Password Renew” > “Select Target Windows.”

•7 Select “My Computer” > “C” > “Windows” > “Renew Existing User Password” > “Administrator.” This instructs the program to reset the Admin password.

•8 Enter in a new Administrator password. Click on “Install” to set it. Remember this password and store it in a safe location.

•9 Press the “Eject” button on your disc drive and take out the disc.

•10 Restart your Windows Operating System computer. Your password is now reset.

Filed under: Windows(2003/2008/2012)Tagged with: , ,