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

PRTG Network Monitor

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

Free Download

Top Tags


View all Tags

dnscmd.exe environment variable in powershell

Votes:

0

Your Vote:

Up

Down

Hello experts,

I am trying to implement a prtg script in which I am using dnscmd.exe in order to get the dns server insights but I am getting this error in the sensor logs.

dnscmd : The term 'dnscmd' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or 
if a path was included, verify that the path is correct and try again.
At C:\Program Files (x86)\PRTG Network Monitor\custom 
sensors\EXEXML\Sensor-Server.ps1:279 char:50
+ $queriesrecieved = Invoke-Command -ScriptBlock {(dnscmd  /statistics 
00000002  | ...
+                                                  ~~~~~~
    + CategoryInfo          : ObjectNotFound: (dnscmd:String) [], CommandNotFo 
   undException
    + FullyQualifiedErrorId : CommandNotFoundException
 

Can any experts help me in this....I know there is something related to the environment variable.... Please help.

dns prtg wmi

Created on Nov 26, 2015 5:48:44 PM by  frank_albert (0) 1

Last change on Nov 27, 2015 12:22:12 PM by  Torsten Lindner [Paessler Support]



2 Replies

Votes:

0

Your Vote:

Up

Down

Hi Frank,

In your script, did you provide the full path to the dnscmd.exe ?

Created on Nov 27, 2015 7:56:12 AM by  PRTG Tools Family [prtgtoolsfamily.com] (13,263) 3 4



Votes:

0

Your Vote:

Up

Down

Hello,

Thanks for the reply....

The problem got solved.........

I added the environment variable path of the dnscmd.exe

$env:Path = $env:Path + ';C:\windows\sysnative'

Created on Nov 27, 2015 12:25:59 PM by  frank_albert (0) 1



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.