This project is read-only.
1

Resolved

The parameter is incorrect

description

While running the install script for the first time you may get an error that says:
 
Exception calling "AddPrivileges" with "2" argument(s): "The parameter is incorrect"
At C:\Program Files\CloudInit\install.ps1:35 char:45
  • [CloudInit.LsaWrapperCaller]::AddPrivileges <<<< ($username, "SeServiceLogonRight")
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : DotNetMethodException
       
      Seems to happen only on the first run as the code that throws this error successfully runs the second time around. Not sure exactly what is happening. Until i get this bug fixed there are two work arounds.
       
  • Run the code a second time and it will successfully apply the changes
    $username = "$(hostname)\cloudinitservice"
    [System.Reflection.Assembly]::LoadFrom("<path to service>\CloudInit.exe")
    [CloudInit.LsaWrapperCaller]::AddPrivileges($username, "SeServiceLogonRight")
     
  • Manually give cloudinitservice LogonAsService rights with Local Security Policy Manager

comments

bwight4157 wrote Jan 27, 2012 at 8:47 PM

There's actually a third solution here. You can comment out those lines of code in the install script and use a different user for the service, provided the said user has LogonAsService Rights.

bwight4157 wrote Jan 27, 2012 at 9:43 PM

Looks like the solution could be here. I will make an update and see if this fixes the problem.
http://stackoverflow.com/questions/1147914/why-might-lsaaddaccountrights-return-status-invalid-parameter

bwight4157 wrote Jan 27, 2012 at 10:29 PM

Issue has been fixed with revision 13178. The downloads for version 1.2 have been updated to revision 13178 and now include the fix for this issue.

wrote Jan 27, 2012 at 10:30 PM

wrote Feb 13, 2013 at 10:37 PM

wrote May 16, 2013 at 2:29 AM

wrote May 16, 2013 at 2:29 AM

wrote Jun 14, 2013 at 8:11 AM