Archive for the ‘Windows Server 2003 / 2008’ Category

Server 2008 R2: KMS Error 0xC004F050 Invalid product key

December 13, 2013 Leave a comment

Recently I had an issue with installing a server 2012 R2 KMS key on a Server 2008 R2 KMS host:

Error: 0xC004F050 The Software Licensing Service reported that the product key is invalid.


However I installed the kms hotfix kb2757817 for Server 2012 support but this was not sufficient. You really need to watch out for the correct hotfix which is kb2885698.

Server 2012 KMS support:
Server 2012 R2 KMS support:

Make sure that you install the correct hotfix 🙂


DFS mapping error: Refers to a location that is unavailable

February 20, 2013 2 comments

Last week I experienced some strange behaviors with offline files in combination with DFS. In most environments is DFS really common and used for network mappings, roaming profile, homedrive,.. .

The initial issue was that users experienced random access issues to DFS mappings which solved themselves after some time.

Users get an error like: Drive x refers to a location that is unavailable. It could be on a hard drive on this computer, or on a network. Check to make sure that the disk is properly inserted, or that you are connected to the Internet or your network, and then try again. If it still cannot be located, the information might have been moved to a different location.


In the beginning I thought that this was an issue with one of the DFS Namespace servers. Mostly are random access denied issues caused due a permission difference on one of the DFS roots.

When the issue occurred I started trying to access the DFS share through different locations:

  • client could not connect to “\\\dfsroot”
  • client could connect to “\\domain\dfsroot”
  • client could connect to “\\DCA\dfsroot”
  • client could connect to “\\DCB\dfsroot”

Apparently only the “\\\” was not accessible. So I also enabled show hidden files and protected files and then I saw that only the Homedrive of the user was available because this was made offline. But what I really found strange was that “\\domain\dfsroot” was just working. I discovered that on desktops the access issue was not happening because offline files were not enabled on the desktops.

After some research on the Internet that Offline Files does not distinguish DFS paths from UNC paths:  Technet blog

So what happens on Windows 7 client: Offline files sync in the background and there is by default a slow-link detection mechanism.

  • If the offline file feature discovers that the network is slow it will work offline (Slow-Link mode)
  • Offline file feature thinks that \\ is the fileserver so it will break the communication to \\
  • All other DFS mappings based on \\ become unavailable
  • The DFS mappings will become online again if the offline file feature detects fast network again

There is not really a nice solution for this but here are some possible solutions:

  • Disable Slow-Link mode via Group Policies (it will not solve mapping issue when the client really lose it’s connection for a short time)
  • Use UNC paths as network mappings
  • Map network drives as \\Domain\dfsroot (A bit cheating with DFS : so without .com)

I don’t know yet if the offline file feature on Win8/Server 2012 can work with DFS paths.

WSUS 3.0: The wuauclt Utility

January 21, 2012 Leave a comment

WSUS uses a cookie on client computers to store various types of information, including computer group membership when client-side targeting is used. By default, this cookie expires an hour after WSUS creates it. If you are using client-side targeting and change group membership, use this option in combination with detectnow to expire the cookie, initiate detection, and have WSUS update computer group membership.


wuauclt.exe /resetauthorization /detectnow

List of all Wuauclt options:


WSUS 3.0: Windows Update PowerShell Module

January 21, 2012 Leave a comment

The PSWindowsUpdate module allows you to manage WSUS configuration via Powershell.

The Module can be installed manualy by downloading Zip file and extract in:

You may receive the following Security warning:
Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your computer. Do you want to run C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PSWindowsUpdate\PSWindowsUpdate.psm1?

You need to be very careful running stuff you pulled down from the internet. If you’ve reviewed the script and found it to be trustworthy, you can remove its origin information by UNBLOCKING it from the properties dialog box in Explorer (Select the object in explorer, right click, select properties, unclick BLOCKED). 

Find long NTFS File Paths

December 7, 2011 2 comments

Long Path Tool is very useful if you are having problems with deleting or moving files that have file paths with more then 256 characters. This tool is free to determine file paths that are too long. You need to have a licensed version if you want to delete files or copy files with this tool. I make mostly a mapping to a folder with long file paths and delete them manually.


Backup and Restore NTFS permissions with icacls

December 7, 2011 Leave a comment

Icacls is a simple command line utility to backup and restore or apply new NTFS permissions. I use this tool mostly to back-up NTFS permissions before I make major changes on the current NTFS ACLs. This command line utility is available on Server 2003 SP2 or higher, also available on server 2008 & Windows 7.

To get help or get examples just type icacls in command prompt.

Example: Backup NTFS permissions

icacls “D:\HomeTest” /save “c:\Temp\ntfsbackup.txt” /t /c

In this example we backup all permissions of “D:\HomeTest” and save them in “c:\Temp”. The /T switch allows it to get also the permissions of sub folders, the /C switch allows it to continue even if errors occurs.

Example: Restore NTFS permissions

icacls d:/ /restore c:\Temp\ntfsbackup.txt

It is not necessary to mention the destination folder because this is already included in the backup file which very important to know. It’s sufficient to specify the destination drive.

From my experience it’s possible to back-up a complete drive like “e:/” but you can’t restore without specifying a drive letter, so my advice is always specify a folder instead of a complete drive.

More info: Technet

Powershell: Clear TsProfilePath in Active Directory

May 6, 2011 Leave a comment

Last week I had an odd issue in powershell when I was creating a script to clear the “Terminal Services profile” for a list of users. The following error appeard when I tried to clear the Terminal services path via “Get-QADUser test_user | Set-QADUser -TsProfilePath $null”:

Set-QADUser : The specified directory service attribute or value does not exist. (Exception from HRESULT: 0x8007200A)

After a little reaserach I found a topic on Powergui with similar problems. It turns out that there might be a problem between ADSI and powershell for the “Terminal Services profile” settings when you try to clear these settings.  Fortunly a member of the Powergui made already a workaround with ADSI and PSBase.

Add or remove the following lines in the underneath script to clear the HomeDrive, HomeDirectory and the Profilepath.

$objADSI.psbase.InvokeSet(“TerminalServicesHomeDrive”, “”)
$objADSI.psbase.InvokeSet(“TerminalServicesHomeDirectory”, “”)
$objADSI.psbase.InvokeSet(“TerminalServicesProfilePath”, “”)

This example clears the “Terminal services profile path” for the samaccountname column in accounts.csv :

#This script will clear the Terminal Services Profile Path based on a csv file

$imported = Import-Csv "C:\Input\Accounts.csv"

$imported | ForEach-Object {
get-qaduser $_.Samaccountname | Modify-DirectoryObject

function Modify-DirectoryObject {
begin {$count=0}
process {
$objADSI = [ADSI]$_.Path
$objADSI.psbase.InvokeSet("TerminalServicesProfilePath", "")
end {"objects were modified"}