Hello Erhard,
Thank you for the link, I've tried both workarounds of sections "I’m getting an 0x80041013 (“Provider not found”) or an 0x80041014 (“Component failed to initialize) error" and "I’m getting an error regarding provider registration" without success.
Furthermore, I've made new test with PowerShell locally on those devices : I've run the following command in normal and in elevated prompt :
Get-WmiObject -Query "SELECT UsedSpace FROM Win32_ShadowStorage"
I only get result in elevated prompts, in normal prompt I got the following error :
Get-WmiObject : Initialization failure
At line:1 char:1
+ Get-WmiObject -Query "SELECT UsedSpace FROM Win32_ShadowStorage"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
So I think this issue is related to UAC.
On our PRTG's server, I run successfully this command in a PowerShell prompt run-as with credentials I set in PRTG (where 'DEVICE' is the name of the remote server I try to monitor.) :
Get-WmiObject -Query "SELECT UsedSpace FROM Win32_ShadowStorage" -ComputerName DEVICE
I've tried to put It in a script :
param(
# must me a resolvable hostname (Netbios or DNS)
[Parameter(Position=0)]
[string]
$ComputerName = 'DEVICE',
# WMI query to be run on the server, must return only one value
[Parameter(Position=1)]
[string]
$Query = "SELECT UsedSpace FROM Win32_ShadowStorage",
# WMI result modifier
[Parameter(Position=2)]
[string]
$ResultModifier = "/1Gb"
)
# Error handling
trap{
# Return value 0 and error message
"0:$($_.ToString())"
exit 2
}
# run WMI query
$result = Get-WmiObject -Query $Query -ComputerName $ComputerName -ErrorAction Stop
# set and transfrom result
$PropName = $result | gm | where MemberType -eq Property | where name -NotMatch "__" | select -expand name
$result = Invoke-Expression "`$result.$PropName"
$result = Invoke-Expression "`$result$ResultModifier"
# Return result and error code
"$($result):Ok"
exit 0
But PRTG return "System Error: Initialization failure (code: PE022)"
Note that I've successfully run the script of my previous post on the same device, with same credentials.
This script run successfully in a PowerShell prompt run-as with credentials I set in PRTG, on the PRTG's server.
It seems that there is an issue with WMI related functionality handling by PRTG and UAC...
Regards
EDIT
It seems that the markup parser do not like my piece of code ^.^'
EDIT BY MOD: Fixed :)
Add comment