Windows Checks using Background Service

Hello ,

I am trying to use windows checks as background service and I get the following error while trying to run Get-IcingaFrameworkServiceBinary

PS C:\Users\vagrant> $ServiceData = Get-IcingaFrameworkServiceBinary;
Do you provide a custom source of the service binary? (y/N):
Please enter the path you wish to install the service to (Defaults: "C:\Program Files\icinga-framework-service\"):
[Notice]: Waiting for lock on path "C:\Users\vagrant\AppData\Local\Temp\3\tmp_icinga2038597219.d" to be released before
trying to remove it
[Error]: Failed to remove items from path "C:\Users\vagrant\AppData\Local\Temp\3\tmp_icinga2038597219.d". Recurse is "Tr
ue", Force is "True": "System.IO.IOException: The process cannot access the file 'icinga-service.exe' because it is bein
g used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileInfo.Delete()
   at Microsoft.PowerShell.Commands.FileSystemProvider.RemoveFileSystemItem(FileSystemInfo fileSystemInfo, Boolean force

OS is Windows Server 2012 R2.

Icinga Agent Version:

PS C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework> Get-IcingaAgentVersion

Name Value

Mayor 2
Major 2
Fixes 5
Minor 13
Full 2.13.5

Icinga agent binary path

PS C:\Users\vagrant> Get-IcingaAgentBinary
C:\Program Files\ICINGA2\sbin\icinga2.exe

Seems like it creates a temp folder with icinga-service.exe and the power shell process locks the folder and then another process tries to delete it but it is unable.
I am following this documentation to download the binary:


Do You have any antivirus with active scan on that server? Maybe it locks the directory and don’t releases till the script finished the installation. I had the same problem with McAfee

I have disabled Windows defender but the issue is still there, there are no other antiviruses.

there is a patch update on github and it’s not a part of the official version that should fix the issue