# Icinga-for-Windows: specify username for service

**URL:** <https://community.icinga.com/t/icinga-for-windows-specify-username-for-service/13454>\
**Category:** Icinga for Windows\
**Tags:** icinga-for-windows, director\
**Created:** [April 11, 2024, 6:49am UTC](https://community.icinga.com/t/icinga-for-windows-specify-username-for-service/13454 "2024-04-11T06:49:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![InformatikKFM](https://community.icinga.com/letter_avatar_proxy/v4/letter/i/2acd7d/32.png) [@InformatikKFM](https://community.icinga.com/u/InformatikKFM)\
**Post date:** [April 11, 2024, 6:49am UTC](https://community.icinga.com/t/icinga-for-windows-specify-username-for-service/13454/1 "2024-04-11T06:49:38Z")

</div>

Hello,

is it is possible to specify the username, which runs the windows service for icinga-for-windows. i’ve the problem, that i want to install ifw on multiple domain controllers and a domain controller does not have local users, so that the installation on a second domain controller overwrites the password in Active-Directory from the first installation.

My Installation-Command is:

& $ScriptFile ` -ModuleDirectory 'C:\Program Files\WindowsPowerShell\Modules\'`  
-InstallCommand ‘{“IfW-AgentVersion”:{“Values”:[“2.14.0”]},“IfW-ParentAddress”:{“Values”:{“XXX”:[“XXX”]}},“IfW-Hostname”:{“Selection”:“5”},“IfW-ParentZone”:{“Values”:[“master”]},“IfW-StableRepository”:{“Values”:[“[https://XXX/IcingaForWindows/icinga\_stable/ifw.repo.json"]},“IfW-InstallJEAProfile”:{“Selection”:“1”},“IfW-Connection”:{“Selection”:“0”},“IfW-ParentNodes”:{“Values”:["XXXX](https://XXX/IcingaForWindows/icinga_stable/ifw.repo.json%22%5D%7D,%22IfW-InstallJEAProfile%22:%7B%22Selection%22:%221%22%7D,%22IfW-Connection%22:%7B%22Selection%22:%220%22%7D,%22IfW-ParentNodes%22:%7B%22Values%22:%5B%22XXXX)”]}}’ `  
-IcingaRepository ‘XXX/IcingaForWindows/icinga\_stable/ifw.repo.json’

Regards

---

<div class="post-metadata">

**Author:** ![rivad](https://community.icinga.com/user_avatar/community.icinga.com/rivad/32/5852_2.png) [@rivad](https://community.icinga.com/u/rivad)\
**Post date:** [April 12, 2024, 9:18am UTC](https://community.icinga.com/t/icinga-for-windows-specify-username-for-service/13454/2 "2024-04-12T09:18:11Z")

</div>

IMHO it was the other way around and domain controllers only have local users?

If the installation works, I think you can later change the service and choose the user you like.

---

<div class="post-metadata">

**Author:** ![cstein](https://community.icinga.com/user_avatar/community.icinga.com/cstein/32/7745_2.png) [@cstein](https://community.icinga.com/u/cstein)\
**Post date:** [May 6, 2024, 3:20pm UTC](https://community.icinga.com/t/icinga-for-windows-specify-username-for-service/13454/3 "2024-05-06T15:20:23Z")

</div>

Hello,

basically there is a native way to provide a user, but for the password it is a little more complicated. The reason behind is that in general I don’t feel well by placing a password as plain-text on the shell.

To change the user on the install command, add this to your install JSON

```json
"IfW-AgentUser":{"Values":["NT Authority\\NetworkService"]}

```

and replace the user with the proper one.

For the password, it is a little more complicated. I would recommended using Read-Host for the password input. How ever, this will not work in automated workloads.

```powershell
[SecureString]$Password = Read-Host -AsSecureString;
Set-IcingaInternalPowerShellServicePassword -Password $Password;

```

In case you want to automate it, you can run it like this:

```powershell
Set-IcingaInternalPowerShellServicePassword -Password (ConvertTo-IcingaSecureString 'mysecretpassword');

```

I hope this helps!

If course you have to place the `Set-IcingaInternalPowerShellServicePassword` before running your Install-Icinga command, but after the Framework is installed.
