Add local Windows Server inventory collection and validation; include core package

This commit is contained in:
2026-10-30 11:24:40 -07:00
parent 967b2bd46a
commit f65ade9fff
35 changed files with 2200 additions and 56 deletions

View File

@@ -0,0 +1,11 @@
function Get-SamsaraServices {
param($Result)
Invoke-SamsaraRead $Result 'Windows services' {
# Do not query PathName: it can include secret-bearing command arguments.
$Result.data = @(Get-CimInstance -ClassName Win32_Service -Property Name,DisplayName,State,StartMode,StartName,ProcessId -ErrorAction Stop | ForEach-Object {
[pscustomobject]@{ name = [string]$_.Name; display_name = [string]$_.DisplayName
state = [string]$_.State; startup = [string]$_.StartMode; account = [string]$_.StartName; pid = [int]$_.ProcessId }
})
}
$Result.limitations += 'All visible service states are inventoried, including running services. Executable command lines and credentials are not collected; service accounts do not prove consumers.'
}