Inedo / inedox-windows

Windows extension for Otter and BuildMaster.
BSD 3-Clause "New" or "Revised" License
7 stars 4 forks source link

Ensure-RegistryValue did not work due to authorization access #45

Closed pcamelio closed 6 years ago

pcamelio commented 6 years ago

Hello

I ran the following Plan Windows::Ensure-RegistryValue

    (
        Name: AllowTelemetry,
        Value: 0,
        Kind: DWord,
        Hive: LocalMachine,
        Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection
    );

And I have got the following error

Unhandled exception: System.UnauthorizedAccessException: Impossible d'écrire dans la clé de Registre.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Inedo.Agents.InedoAgentClientBase.<SendMessageAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Inedo.Agents.InedoAgentClientBase.<ExecuteCommandAsync>d__26`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Inedo.Otter.Service.PlanExecuter.OtterPlanExecuter.<PerformExecution>d__49.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Inedo.Otter.Service.PlanExecuter.OtterPlanExecuter.<Inedo-ExecutionEngine-Executer-IExecutionHostEnvironment-ExecuteActionAsync>d__53.MoveNext()

The agent - 2.0.8 - is running with Windows account (local admin rights). I have the same problem on the otter server itself. - setup without the Agent -

I modified the registry authorization, but the problem is still present.

I try with an other registry value


Windows::Ensure-RegistryValue
(
    Name: EnableRemoteManagement,
    Value: 1,
    Kind: DWord,
    Hive: LocalMachine,
    Key: SOFTWARE\Microsoft\WebManagement\Server
);
```unsuccessfully
pcamelio commented 6 years ago

I have found that I made a big mistake in the syntax.

Windows::Ensure-RegistryValue
(
    Name: EnableRemoteManagement,
    Value: 1,
    Kind: DWord,
    Hive: LocalMachine,
    Key: SOFTWARE\Microsoft\WebManagement\Server
);

have to be write:

(
    Name: EnableRemoteManagement,
    Value: 1,
    Kind: DWord,
    Hive: LocalMachine,
    Key: SOFTWARE\Microsoft\WebManagement\Server\**EnableRemoteManagement**
);
pcamelio commented 6 years ago

You should write documentation in French :)