2019-07-22 09:59:47 -04:00
|
|
|
Import-IcingaLib provider\enums;
|
2019-07-22 09:53:07 -04:00
|
|
|
|
2019-07-22 09:23:21 -04:00
|
|
|
function Get-IcingaWindows()
|
2019-07-22 04:01:11 -04:00
|
|
|
{
|
|
|
|
|
$WindowsInformations = Get-CimInstance Win32_OperatingSystem;
|
|
|
|
|
|
2019-07-22 09:53:07 -04:00
|
|
|
$OSProductSuite = @();
|
|
|
|
|
$ProviderEnums.WindowsOSProductSuite.Keys | Where-Object {
|
|
|
|
|
$_ -band $WindowsInformations.OSProductSuite
|
|
|
|
|
} | ForEach-Object {
|
|
|
|
|
$OSProductSuite += $ProviderEnums.WindowsOSProductSuite.Get_Item($_);
|
|
|
|
|
};
|
|
|
|
|
|
2019-07-22 04:01:11 -04:00
|
|
|
$windows_datails = @{};
|
2019-07-22 09:23:21 -04:00
|
|
|
$windows_datails.Add(
|
|
|
|
|
'windows', @{
|
|
|
|
|
'metadata' = @{
|
|
|
|
|
'Version' = $WindowsInformations.Version;
|
|
|
|
|
'CurrentTimeZone' = $WindowsInformations.CurrentTimeZone;
|
|
|
|
|
'InstallDate' = $WindowsInformations.InstallDate;
|
|
|
|
|
'SystemDevice' = $WindowsInformations.SystemDevice;
|
|
|
|
|
'SystemDirectory' = $WindowsInformations.SystemDirectory;
|
|
|
|
|
'BuildType' = $WindowsInformations.BuildType;
|
|
|
|
|
'BuildNumber' = $WindowsInformations.BuildNumber;
|
|
|
|
|
'OSArchitecture' = $WindowsInformations.OSArchitecture;
|
|
|
|
|
'NumberOfUsers' = $WindowsInformations.NumberOfUsers;
|
|
|
|
|
'OSType' = @{
|
|
|
|
|
'raw' = $WindowsInformations.OSType;
|
|
|
|
|
'value' = $ProviderEnums.WindowsOSType[[int]$WindowsInformations.OSType];
|
|
|
|
|
};
|
|
|
|
|
'OSProductSuite' = @{
|
|
|
|
|
'raw' = $WindowsInformations.OSProductSuite;
|
2019-07-22 09:53:07 -04:00
|
|
|
'value' = $OSProductSuite;
|
2019-07-22 09:23:21 -04:00
|
|
|
};
|
|
|
|
|
'ProductType' = @{
|
|
|
|
|
'raw' = $WindowsInformations.ProductType;
|
|
|
|
|
'value' = $ProviderEnums.WindowsProductType[[int]$WindowsInformations.ProductType];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
'language' = @{
|
|
|
|
|
'CountryCode' = $WindowsInformations.CountryCode;
|
|
|
|
|
'OSLanguage' = $WindowsInformations.OSLanguage;
|
|
|
|
|
'Locale' = $WindowsInformations.Locale;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
2019-07-22 04:01:11 -04:00
|
|
|
|
|
|
|
|
return $windows_datails;
|
|
|
|
|
}
|