Copy files with RoboCopy

Server Administration

Robocopy is a tool provided by Microsoft that provides a robust way to move files. It comes built in to Windows 7, Windows 8, Server 2008, Server 2008 R2, and Server 2012. It can also be downloaded for Server 2003. If you’ve ever had a problem with file names being too long or copy jobs getting stuck waiting for input using Windows Explorer, you’ll love Robocopy.

Copy Data *without* Attributes

If I just want to copy data from one place to another, and I don’t care about dates or file permissions being copied with the data, I’ll use the following command because it’s so easy to remember. The /e switch tells Robocopy to copy subdirectories even if they’re empty.

robocopy /e

Copy Data *with* Attributes

If I DO care about file permissions and other attributes being copied to the file destination, I use Robocopy with the following switches. I typically like using this if I am moving data from one file server to another.

robocopy /e /dcopy:t /copyall /r:1 /w:1 /v /tee /log:copylog.txt

Here is a breakdown of what the switches do:

  • /dcopy:t copies the directory time stamps.
  • /copyall copies all file information including NTFS permissions and owner information.
  • /r:1 specifies the number of times Robocopy will attempt to copy the file. In this case, it will try once.
  • /w:1 specifies how long Robocopy will wait between retries. In this case, it will wait one second before retrying.
  • /v shows verbose output when you run the Robocopy command.
  • /tee will cause Robocopy to write output to the console and to the log file.
  • /log:copylog.txt tells Robocopy to save the log to a file called copylog.txt.

Copy Data that has Changed

 

If you’ve already run Robocopy once and just want to copy new or changed data, simply add the /xo switch to the end of your Robocopy command.

For more information, check out the TechNet article.

How to Activate KMS and MAK Keys

PC, Server Administration

How to Activate KMS Key for Windows 7 on the KMS Host

  1. Login to your KMS server and open an administrative command prompt.
  2. Type slmgr -ipk <licensekey> and press Enter to apply the KMS license key.
  3. Activate the key by typing slmgr -ato and pressing Enter.

Windows 7 should now be activated on the network and desktops should automatically activate with the KMS key you applied to the host.

If you would like to check how many computers have activated themselves against the KMS host, you can log on to the KMS server and run slmgr /dli.

How to Install KMS Key for Office 2010

  1. Logon to the KMS Server and open an Administrative Command Prompt.
  2. Type slmgr.vbs /ipk <productkey> and press Enter.
  3. Type smlgr.vbs /ato [bfe7a195-4f8f-4f0b-a622-cf13c7d16864] and press Enter. The string \”bfe7a195-4f8f-4f0b-a622-cf13c7d16864\” is the Office 2010 activiation ID.

How to Activate MAK Keys for Windows 7 on Laptops

  1. Logon to the laptop and open an adminstrative command prompt.
  2. Type slmgr.vbs /ipk <MAK_Key> and press Enter.
  3. Type slmgr.vbs -ato to activate the key.

How to Install MAK Key for Office 2010

  1. Open an Office application on the laptop.
  2. When the activation prompt opens, click on the “change product key” link.
  3. Enter the MAK key and activate

 

Lag Moving Windows Across Monitors in Windows 7 VMWare Virtual Machine

PC, Virtualization

This issue mainly affects Windows 7 machines with multiple displays in a VMWare View/thin client environment. When a user tries to drag a screen to a second monitor, there is a noticeable lag or jitter as the screen moves across monitors. To fix the issue, do the following:

        1. Power off the affected machine (make sure that the machine isn’t set to always power on in VMWare View!).
        2. Activate SSH on the host that the machine is on.
        3. Start a putty session to the host logging in as root.
        4. Change directories to /vmfs/volumes/
        5. Open the .vmx file in a text editor.
        6. At the bottom of the .vmx file, add the line: mks.poll.headlessRates = "1000 100 2"
        7. Save the changes to the .vmx file.
        8. Power the virtual machine back on, close the putty session, and turn SSH back off on the host.

If the steps above work to fix the affected machine’s problem, they can also be performed on the linked clone template. Then, when the machines are recomposed, they will read the new configuration that eliminates the lag. It should be noted, however, that this fix can increase CPU usage on the hosts.

For the KB Article, go here: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2010359

Back Screen with Cursor upon Login with PCOIP Thin Clients

PC

This seems to be an issue with PCOIP thin clients using Windows 7 and dual screens. After logging in to the machine, a black screen with appear with only a cursor. To fix this, you will need to update the display driver.

  1. Click Start and right-click Computer. Select Manage.
  2. Click Device Manager and expand the display adapters node.
  3. Right click on the display adapter and select “Update driver software…”
  4. Select “Browse my computer for driver software”, then “Let me pick from a list of device drivers on my computer.”
  5. Select the driver that makes the most sense. For example, if you have recently upgraded the virtual hardware to support 3D, select a 3D driver.
  6. Click Next.
  7. After the driver has installed, click Close.

Install Exchange 2010 Service Pack 2 Error

Server Administration

In Exchange 2010, you get an error

Setup previously failed while performing the action Install. You can resume setup by performing the action “BuildToBuildUpgrade.”

To fix this, do the following:

    1. Open regedit.
    2. Navigate to HKLM\Software\Microsoft\Exchangeserver\v14. Under the appropriate role (depending on your setup, it could be AdminTools, MailboxRole, or ClientAccessRole).
    3. Delete the watermark and action keys.

Exchange 2010 Kerberos Error when Opening Exchange Management Console

Uncategorized

When opening the Exchange Management Console, you may get the following error if the time on the Exchange server is out of sync with the domain controller:

The following error occurred when trying to connect to the specified Exchange Server ‘server.org’: The attempt to connect to http://myserver.org/PowerShell using “Kerberos” authentication failed: Connecting to the remote server failed with the following error: Access is denied.

To fix this error, simply open a command prompt and run net time /set to resync the Exchange server’s clock with the domain controller.

If the Exchange server is a virtual machine, you might also want to check and make sure the virtual machine’s time is not being synced with the host, otherwise, you will run into intermittent issues with Kerberos authentication.

Retrieve the GUID of Installed Programs

Server Administration

Here’s how to retrieve the GUID of installed programs in Windows. This can be useful in situations where the Event Viewer lists the GUID of a program causing issues, but not the name.

  • Open a command prompt as Administrator.
  • Type the command:wmic product get > C:\\InstalledPrograms.txt
  • The output of this command will be saved in a text file at C:\\InstalledPrograms.txt.