New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


Cannot get DFSRBacklog to work

Votes:

0

Your Vote:

Up

Down

Hi All, I am trying to get the above custom script to work and am having some problems. Hope you can help. I have configured the sensor to use the custom Get-DFSRBacklog.ps1 script but I am receiving:

XML: Structural error in xml file, 1 open items. -- JSON: The returned json does not match the expected structure (Invalid JSON.). (code: PE231)

I have saved the result to disk and am getting:

Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESS
DENIED))
At C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\Get-DFSRBa
cklog.ps1:99 char:32
+     $Namespaces = Get-WmiObject <<<<  -class __Namespace -namespace root -com
putername $computer | Where {$_.name -eq $namespace}
    + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedA 
   ccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.Pow 
   erShell.Commands.GetWmiObjectCommand
 
C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\Get-DFSRBackl
og.ps1 : MicrosoftDFS WMI Namespace does not exist on 'COMPUTERNAME'.  Run locally on 
a system with the Namespace, or provide computer parameter of that system to ru
n remotely.
At line:1 char:2
+ & <<<< 'C:\Program Files (x86)\PRTG Network Monitor\custom sensors\EXEXML\Get
-DFSRBacklog.ps1' -computer COMPUTERNAME; exit $LASTEXITCODE
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorExcep 
   tion
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorExceptio 
   n,Get-DFSRBacklog.ps1

(nb I have replaced the real computername with COMPUTERNAME above)

Reading up I have found that passing credentials may not work running this script so I have entered credentials in manually to the script but still receive the same errors.

The script works if I run it from the computer the PRTG probe is installed on, it JUST doesn't work when executed by PRTG.

Any help greatly appreciated.

access-is-denied dfs-r wmi

Created on Jun 19, 2015 12:41:42 PM by  Mike Orton (0) 1

Last change on Jun 19, 2015 12:46:54 PM by  Torsten Lindner [Paessler Support]



5 Replies

Votes:

0

Your Vote:

Up

Down

Hi Mike, We've been having the same issue for some time as well. We can manually run the PS1 file on the systems, and it reports back, typically, without issue. When running via PRTG or Kaseya script, it bombs-out with the aforementioned error.

If you manage to figure it out, please do tell. My coworker and I have some time scheduled over the coming weeks to hone-out a good solution for DFS/DFS-R monitoring - we're hopeful that the script will work...

Created on Aug 26, 2015 4:51:01 PM by  Matt Kopp (0)



Votes:

0

Your Vote:

Up

Down

This is actually from a long time ago. I'm struggling to remember exactly what we did but we did get it working.

We did find it worked more reliably adding in a section just before "Function Check-WMINamespace:

$username="domain\user.name"
$password="password"	
$secureString=convertto-securestring $password -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username,$secureString

Also one of the gotchya's we found was that PRTG uses x86 powershell. When testing we would automatically use x64 so the test was never a true test.

Make sure on the probe and server x86 powershell has the execution policies set to unrestricted.

Hope it helps.

Created on Aug 27, 2015 8:14:03 AM by  Mike Orton (0) 1

Last change on Jan 29, 2016 12:48:12 PM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi Matt

please check following

  • Is the PRTG running with the same user credentials as when you logon to start the ps1?
  • Are there any firewalls running on the local and remote machine?
  • As Mike said, check if the same powershell version is used.

I had the same Problem, but I tried to check a DFS between 2 different domains (subdomain) and altough I was logged on as a domain/schema admin on the prtg server (member of domain.local) I got the WMI error. As soon as I used the domaincontroller (dc01.subdomain.domain.local) of the subdomain as sensordevice, it worked. Or when I executed the ps1 script on the DC of the subdomain it worked as well.

maybe that helps cheers Thomas

Created on Aug 27, 2015 12:40:38 PM by  Thomas Umbricht (2,819) 3 3

Last change on Jan 29, 2016 12:48:24 PM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

We have run into the exact same problem.

I have ensured both x64 and x86 powershell are 'unrestricted' on both probe and target machine.

PRTG probe service is running under LOCALSYSTEM account. Could this be my issue?

All firewalls are turned off. I seem able to query other WMI items on the remote server successfully - just not DFSR!

I can also run this script locally on the remote server and it works, so I know the script is good.

@ mike.orton - did you manage the fix the problem? if so, what was the cause?

Created on Jan 28, 2016 3:59:29 PM by  miyo360 (0) 2



Votes:

0

Your Vote:

Up

Down

Hello,

Please configure the EXE/Script Sensor's or EXE/Script Advanced Sensor's Security Context to Use security context of probe service and configure the PRTG Probe Service of the respective probe to run with an account which has sufficient access/privileges to perform the queries/actions required by the sensor instead of LOCALSYSTEM. Does the sensor work then?

Best Regards,

Created on Jan 29, 2016 12:47:51 PM by  Luciano Lingnau [Paessler Support]



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.