Made sure that the teamcityagent is run as Administrator.