Deployments to Servers with User Account Control (UAC) Enabled

Ever since we upgraded to Octopus version on January 3, we’ve been unable to successfully deploy to any server with UAC enabled. The deployment fails at a point when one of our custom PowerShell scripts does an “import-module webadministration”. The service user is an admin on the server. When I log into the server as the admin user and run PowerShell as an administrator then run “import-module webadministration”, the script fails.

My question is, does the latest version fix this issue or should we roll back to a previous version.

So very old post but did anyone ever get back to you with a fix for this? I’m trying to run a Copy-Item script that whitelabels a site but getting stuff with the UAC problem …

Hi Gavin,

Thanks for reaching out. Could you help us with some info about your scenario?


Hi Dalmiro

I’m running Octopus 3.2.24 and the problem only seems to happen on Server 2008 with UAC running, Server 2012 works fine (with the same level of UAC).

The script I run is a batch file (not my choice!) which is a one liner xcopy, on the 2012 box it runs and copies six files, on the 2008 box it just looks to output the contents of the batch file to the console and do nothing (running locally gives access denied on both if not using elevated prompt)

Here is the snippet of the log with the server name and SHA’s removed.

               |       Success: WhiteLabel

13:28:54 Verbose | Octopus Server version: 3.2.24+Branch.master.Sha.
13:28:54 Info | Executing script on
13:28:58 Verbose | Octopus Deploy: Calamari version 3.1.31+Branch.master.Sha.
13:29:03 Verbose | Name Value
13:29:03 Verbose | ---- -----
13:29:03 Verbose | PSVersion 3.0
13:29:03 Verbose | WSManStackVersion 3.0
13:29:03 Verbose | SerializationVersion
13:29:03 Verbose | CLRVersion 4.0.30319.34209
13:29:03 Verbose | BuildVersion 6.2.9200.16481
13:29:03 Verbose | PSCompatibleVersions {1.0, 2.0, 3.0}
13:29:03 Verbose | PSRemotingProtocolVersion 2.2
13:29:03 Info | C:\Octopus\Applications\DevelopmentIntegration\Reviewer.Web\\WhiteLabel>xcopy /Y /U /S “.*” “…*”


Sorry for the delay here. This is very weird indeed. How are you calling the batch file from Octopus? If possible share a screenshot or the full snippet.

Would it be possible to make this a PS Script that uses copy-item?


Hi Dalmiro

It’s no problem, I had replaced the batch file with Copy-Item instead (direct in Octopus, didn’t trying with it being a .ps1 file). The full snippet of the batch file that wouldn’t work Server 2008 was:

cd $OctopusParameters['Octopus.Action[Deploy Website].Output.Package.InstallationDirectoryPath']
cd .\_client\$WhiteLabelFolder

Hi Gavin,

Glad to hear you found that workaround. I’d personally recommend you to use a Standalone Script Step, and select “Script inside a package” as the source. This way you can have the script in Source Control to track all its changes.

Best regards,