Page 1 of 1

32-bit or 64-bit for plugins

Posted: Tue Jun 27, 2023 8:30 am
by DuncanClarke
I wrote a plugin in Powershell to report the Network Category on our Windows servers. However, this script doesn't appear to run correctly on all servers. Some it works fine but most it reports as Critical because it failed to ruin, giving the error:
Get-NetConnectionProfile : Provider load failure
At C:\\Program Files (x86)\\Nagios\\NCPA\\plugins\\CheckNetworkCategory.ps1:5 char:11
+ Switch ($(Get-NetConnectionProfile).NetworkCategory)
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_NetConnectionProfile:root/StandardCi...nnectionProfile) [Get-NetConn
ectionProfile], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041013,Get-NetConnectionProfile

Network Category is NOT set to DomainAuthenticated
Doing a quick search, it appears this may be due to hte plugin running in a 32-bit shell rather than a 64-bit one. Any idea how I can get this to work?

https://stackoverflow.com/questions/281 ... -powershel

Re: 32-bit or 64-bit for plugins

Posted: Tue Jun 27, 2023 12:19 pm
by DuncanClarke
I have also found this, which requires an update to the config file on every managed server followed by restarting the NCPA listener service.

If anyone has any better solutions, I'm all ears, as editing that file on every server and restarting is not ideal.

viewtopic.php?p=278036