2026-01-29 05:01:26 -05:00
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Apply `Set-IcingaAcl` to the common Icinga for Windows directories.
|
|
|
|
|
|
|
|
|
|
.DESCRIPTION
|
|
|
|
|
Convenience wrapper that calls `Set-IcingaAcl` for a pre-defined set of Icinga
|
|
|
|
|
directories (configuration, var, cache and PowerShell config directories).
|
|
|
|
|
Use this to consistently apply the same ACL rules to the standard locations.
|
|
|
|
|
|
|
|
|
|
.PARAMETER IcingaUser
|
|
|
|
|
The account or accounts to grant FullControl. Defaults to the value returned
|
|
|
|
|
by `Get-IcingaServiceUser`.
|
|
|
|
|
|
|
|
|
|
.OUTPUTS
|
|
|
|
|
None. Operates by calling `Set-IcingaAcl` which emits its own console output.
|
|
|
|
|
|
|
|
|
|
.NOTES
|
|
|
|
|
- Requires administrative privileges to change ACLs on system folders.
|
|
|
|
|
#>
|
2019-11-03 12:01:54 -05:00
|
|
|
function Set-IcingaUserPermissions()
|
|
|
|
|
{
|
2021-08-06 12:12:27 -04:00
|
|
|
param (
|
2026-01-29 05:01:26 -05:00
|
|
|
[string]$IcingaUser = (Get-IcingaServiceUser)
|
2021-08-06 12:12:27 -04:00
|
|
|
);
|
|
|
|
|
|
2026-01-29 05:01:26 -05:00
|
|
|
Set-IcingaAcl -Directory "$Env:ProgramData\icinga2\etc" -IcingaUser $IcingaUser;
|
|
|
|
|
Set-IcingaAcl -Directory "$Env:ProgramData\icinga2\var" -IcingaUser $IcingaUser;
|
|
|
|
|
Set-IcingaAcl -Directory (Get-IcingaCacheDir) -IcingaUser $IcingaUser;
|
|
|
|
|
Set-IcingaAcl -Directory (Get-IcingaPowerShellConfigDir) -IcingaUser $IcingaUser;
|
|
|
|
|
Set-IcingaAcl -Directory (Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath 'certificate') -IcingaUser $IcingaUser;
|
2019-11-03 12:01:54 -05:00
|
|
|
}
|