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


How to inherit windows credentials from parent device in a batch script?

Votes:

0

Your Vote:

Up

Down

I wrote a batch script, and chose the option in security context: Use windows credentials of parent device. It gives an error: Access denied. Please check your Windows credentials. (code: PE095)

How can I include the credentials in the batch script?

batch batch-file custom-sensor prtg wmi

Created on Aug 15, 2019 9:50:44 AM by  fjollabe (0) 1



7 Replies

Votes:

0

Your Vote:

Up

Down

Hi there,

The security context means that the script is started with these credentials. If there are additional credentials needed within the script, you can use parameters to provide the information.

Please also take a look at this manual. It shows placeholder that can be used as parameters in the Command-line Parameters section.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Aug 15, 2019 3:25:11 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,

I tried using the script without any parameters and it is giving me Access denied error.

Note that in the script I'm trying to access a shared file in the domain. Then I tried this line: %host -UserName %windowsdomain\%windowsuser -Password "%windowspassword" and it still gives me the Access denied error.

Created on Aug 16, 2019 8:16:29 AM by  fjollabe (0) 1



Votes:

0

Your Vote:

Up

Down

Hi,

You can take a look at the detailed results by enabling "Write result to disk" in the sensor's "Settings" tab. With the next scan it will write one or several result-files into "C:\ProgramData\Paessler\PRTG Network Monitor\Logs (Sensors)" of your PRTG server (or on the Remote Probe if applicable). All files have the sensor's numeric ID in their filenames. The sensor ID can be found on the sensor's "Overview" tab.

Please note that handling access rights and parameters in a batch script can be very tricky. I would recommend to use the Powershell.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Aug 16, 2019 8:33:36 AM by  Birk Guttmann [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi,

I need more help with this issue please. Can you help me understand how prtg exe scripts are run with the inherited credentials? Where does the script run?

I am trying to access a file and compare text within it. The file is located in a network drive.

Thank you!

Created on Aug 16, 2019 11:23:53 AM by  fjollabe (0) 1



Votes:

0

Your Vote:

Up

Down

Hi there,

The script will run on the (Remote) Probe Server to which device is added. You can also find the manuals for the corresponding custom sensors under the following link.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Aug 16, 2019 1:30:28 PM by  Birk Guttmann [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Thank you, but that is quite generic and doesn't answer the primary question.

I still don't understand how the parameters are passed to the batch script, especially the parent device credentials.

Do I need to create a connection to the network drive in the script? How should it connect with the network drive with credentials inherited by the parent device?

Sorry for the long questions, I have gone through a lot of links and can't seem to make it work.

Created on Aug 16, 2019 1:44:44 PM by  fjollabe (0) 1



Votes:

0

Your Vote:

Up

Down

Hi there,

Please note, that PRTG can only run scripts on the corresponding Probe servers. If you need to run commands on an external server, you need to use something like invoke-command in Powershell.

Please take a look at this link for some more information about remote Powershell scripting.


Kind regards,
Birk Guttmann, Tech Support Team

Created on Aug 19, 2019 2:42:01 PM by  Birk Guttmann [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.