Error: App Deploy Toolkit Main requires Administrator rights to function. Please re-run the deployment script as an Administrator.

Topics: Archive - General
Aug 27, 2014 at 5:11 PM
Hello,

Currently doing a deployment leveraging PSAppDeployToolkit, which for most part has been going well however on a subset of systems I am receiving an error code 0x1(1) - Incorrect Function - Action Failed.

Has anyone encountered this and/or know of a workaround? I am enclosing a copy of the Toolkit log. The error is misleading as the process is reunning as an Administrator.

[26-08-2014 08:36:57] [Initialization] ----------------------------------------------------------------------------------------------------------
[27-08-2014 08:36:54] [Initialization] Microsoft_Outlook201xJunkEmailAdd-in_1.0_x86_EN_01 setup started.
[27-08-2014 08:36:54] [Initialization] Script [C:\Windows\ccmcache\8\AppDeployToolkit\AppDeployToolkitExtensions.ps1] dot-source invoked by [C:\Windows\ccmcache\8\AppDeployToolkit\AppDeployToolkitMain.ps1]
[27-08-2014 08:36:54] [Initialization] Script [C:\Windows\ccmcache\8\AppDeployToolkit\AppDeployToolkitMain.ps1] dot-source invoked by [C:\Windows\ccmcache\8\Deploy-Application.ps1]
[27-08-2014 08:36:54] [Initialization] Microsoft_Outlook201xJunkEmailAdd-in_1.0_x86_EN_01 script version is [1.0.0]
[27-08-2014 08:36:54] [Initialization] Deploy Application script version is [3.1.4]
[27-08-2014 08:36:54] [Initialization] The following non-default parameters were passed to [Deploy Application]: [-DeploymentType Install]
[27-08-2014 08:36:54] [Initialization] App Deploy Toolkit Main script version is [3.1.4]
[27-08-2014 08:36:54] [Initialization] App Deploy Toolkit Extensions version is [1.0.0]
[27-08-2014 08:36:54] [Initialization] PowerShell version is [2.0 x64]
[27-08-2014 08:36:54] [Initialization] PowerShell host is [ConsoleHost version 2.0]
[27-08-2014 08:36:54] [Initialization] OS version is [Microsoft Windows 7 Enterprise 64-bit 6.1.7601]
[27-08-2014 08:36:54] [Initialization] Hardware platform is [Physical]
[27-08-2014 08:36:54] [Initialization] Computer name is [xxxxxxxxxxx]
[27-08-2014 08:36:54] [Initialization] Current user is [xxxxxxxxxxxx]
[27-08-2014 08:36:54] [Initialization] Current Culture is [en-US] and UI language is [EN]
[27-08-2014 08:36:54] [Initialization] Deployment type is [Installation]
[27-08-2014 08:36:54] [Initialization] Running as [rlesnefsky] in user context.
[27-08-2014 08:36:54] [Initialization] Installation is running in [Interactive] mode.
[27-08-2014 08:36:54] [Initialization] Error: App Deploy Toolkit Main requires Administrator rights to function. Please re-run the deployment script as an Administrator. ()
[27-08-2014 08:36:54] [Initialization] Displaying Dialog Box with message: [Error: App Deploy Toolkit Main requires Administrator rights to function. Please re-run the deployment script as an Administrator. ()]...
[27-08-2014 08:36:56] [Initialization] Dialog Box Response: OK
[27-08-2014 08:36:56] [Initialization] Microsoft_Outlook201xJunkEmailAdd-in_1.0_x86_EN_01 Installation completed with exit code [1].
[27-08-2014 08:36:56] [Initialization] ----------------------------------------------------------------------------------------------------------

Thank you.
Coordinator
Sep 1, 2014 at 8:57 PM
The toolkit is failing because it's detecting that it's not being run as administrator. Can you run this line of code and let me know if it returns true or false:

([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
Oct 30, 2014 at 11:58 PM
Sorry for the delay in responding. It is returning false.
Developer
Oct 31, 2014 at 7:09 AM
Based on your result, if you are truly running as an Admin, then that account is not in the Administrators group. Can you run the below lines of code and tell us what it returns? Below method will check the process's access token to see if it has the Admin SID on it. Any account that is elevated will have this SID on it's access token so this will definitively tell us if you are running with Admin privileges or not.

[System.Security.Principal.WindowsIdentity]$CurrentProcessToken = [System.Security.Principal.WindowsIdentity]::GetCurrent()
[System.Security.Principal.SecurityIdentifier]$BuiltInAdministrators = 'S-1-5-32-544'
[boolean]$IsAdmin = [boolean]($CurrentProcessToken.Groups -contains $BuiltInAdministrators)
Write-Output $IsAdmin
Developer
Nov 4, 2014 at 1:10 AM
Not sure if you've had a changes to test the above piece of code, but the latest 3.5.0 toolkit is using above method to detect admin rights. Let us know if any issues.