tirsdag den 8. juli 2014

WSUS 2012 Post deployment task failing

After installing Windows Server Update Services Role on a Server 2012. When trying to launch the post deployment tasks from Server Manager, you will find that this fails.
Also if you are trying to deploy the role from PowerShell.

When digging into this issue I found that the post deployment tasks looks for a file called UpdateServices-Services.xml located in Windows\System32\ServerManager\ComponentConfiguration\
When reading through this file it turned out that it is missing a value for "Contentdirectory"
Here is the XML part with the error

<?xml version="1.0" encoding="utf-16"?><INSTANCE CLASSNAME="ServerComponent_UpdateServices_Services"><PROPERTY NAME="ContentDirectory" TYPE="string"></PROPERTY><PROPERTY NAME="ContentLocal" TYPE="boolean"><VALUE>true</VALUE></PROPERTY></INSTANCE>

After correcting the XML and specifying a value post deployment taks finished correctly.

<?xml version="1.0" encoding="utf-16"?><INSTANCE CLASSNAME="ServerComponent_UpdateServices_Services"><PROPERTY NAME="ContentDirectory" TYPE="string"><VALUE>D:\WSUS</VALUE></PROPERTY><PROPERTY NAME="ContentLocal" TYPE="boolean"><VALUE>true</VALUE></PROPERTY></INSTANCE>

HOWEVER - after reproducing the error on a new virtual server I found a more straight forward solution to this. The good news is, that in WSUS v6 (2012 version) There is a utility that can be used to fix this.
The utility is called wsusutil.exe
To correct the post-deployment task error run the utility and specify the folder or instance that you want to use

If using WID:
wsusutil postinstall CONTENT_DIR=D:\WSUS  (Or another folder)
For installations using SQL Server:
wsusutil postinstall CONTENT_DIR=C:\WSUS INSTANCE_NAME=databaseServer[\instanceName]

This util will update the above mentioned XML file, after running this command relauch the post deployment task.