Skip to content

Commit 5530a84

Browse files
authored
Merge pull request #173 from Icinga:fix/update_windows_update_error_message
Fix: Fixes Windows Updates permission exception; Add KB
2 parents cd81195 + 157e387 commit 5530a84

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

doc/10-Knowledge-Base.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ For this reason you will find a list of Icinga knowledge base entries below. Ent
1313
| [IWKB000003](knowledgebase/IWKB000003.md) | The Icinga Agent service `icinga2` cannot be started/modified/added because it is marked for deletion. |
1414
| [IWKB000004](knowledgebase/IWKB000004.md) | Use-Icinga : The 'Use-Icinga' command was found in the module 'icinga-powershell-framework', but the module could not be loaded. For more information, run 'Import-Module icinga-powershell-framework' |
1515
| [IWKB000005](knowledgebase/IWKB000005.md) | powershell.exe : Failed to start service 'Icinga PowerShell Service (icingapowershell)'. |
16+
| [IWKB000006](knowledgebase/IWKB000006.md) | The user you are running this command as does not have permission to access the Windows Update ComObject "Microsoft.Update.Session". |

doc/knowledgebase/IWKB000006.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Icinga Knowledge Base - IWKB000006
2+
3+
## Short Message
4+
5+
The user you are running this command as does not have permission to access the Windows Update ComObject "Microsoft.Update.Session".
6+
7+
## Example Exception
8+
9+
[UNKNOWN]: Icinga Permission Error was thrown: WindowsUpdate
10+
11+
The user you are running this command as does not have permission to access the Windows Update ComObject "Microsoft.Update.Session".
12+
13+
## Reason
14+
15+
This issue is caused by calling [Invoke-IcingaCheckUpdates](https://icinga.com/docs/windows/latest/plugins/doc/plugins/14-Invoke-IcingaCheckUpdates/) over PowerShell Remote execution, with for example [check_by_powershell](https://github.com/Icinga/check_by_powershell).
16+
The Windows COM Object is rejecting every access to these information over remote connections, making it impossible to execute the plugin.
17+
18+
## Solution
19+
20+
Right now there is no solution available for this problem. Microsoft is not allowing to grant permission to these objects over remote connections, which makes it impossible to use them. In addition there is no proper alternative for fetching pending Windows Updates and Hotfixes.
21+
22+
A possible fix which is suggested online is to add a scheduled task, running the command after being triggered by our execution and afterwards fetching the result from the task. This solution requires more research, testing and development.

lib/icinga/exception/Icinga_IcingaExceptionEnums.psm1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
'Message' = 'The user you are running this command as does not have permission to access the requested Wmi-Object. To fix this, please add the user the Agent is running with to the "Remote Management Users" groups and grant access to the WMI branch for the Class/Namespace mentioned above and add the permission "Remote enable".';
1616
'IWKB' = 'IWKB000001';
1717
}
18-
WindowsUpdate = 'The user you are running this command as does not have permission to access the Windows Update ComObject "Microsoft.Update.Session". In order to fetch currently installed and pending updates, please grant the user the required permissions for fetching this information.';
18+
WindowsUpdate = @{
19+
'Message' = 'The user you are running this command as does not have permission to access the Windows Update ComObject "Microsoft.Update.Session".';
20+
'IWKB' = 'IWKB000006';
21+
}
1922
};
2023

2124
[hashtable]$Inputs = @{

0 commit comments

Comments
 (0)