dschingis
Goto Top

PRTG: Powershellskript Berechtigung

Hallo zusammen,

ich möchte in PRTG ein eigenes Skript einbinden, dass folgendes vergleicht:
Aktuelles Datum mit lastwritetime eines Ordners. Mein Skript funktioniert problemlos, wenn ich es in der Powershell ausführe.

Jetzt habe ich es in PRTG eingebunden und musste feststellen, dass mein PS-Skript nur Ergebnisse an PRTG liefert, wenn ich lokale Ordner prüfen lasse wie z.B. c:\Temp. Wenn ich jedoch z.B. \\server\Verzeichnis eingebe, kommt nichts zurück.
Zu Testzwecken habe ich eine Freigabe mit Berechtigung "jeder" angelegt - es kommt auch ein Wert zurück.....

Also d. h. mein Problem ist die Berechtigung auf die vorhandenen Verzeichnisse...

Wie kann ich mein Powershell skript als Admin über Prtg ausführen?
Ich möchte ja nicht meine Freigaben anpassen....

In PRTG ist ja ein adminaccount für meine Gruppe hinterlegt...... Aber ich glaube das hat nix mit Ausführen von Skripten zutun....
Das Skript wird auf einem Probe-Server ausgeführt.

Content-Key: 263431

Url: https://administrator.de/contentid/263431

Printed on: April 23, 2024 at 11:04 o'clock

Member: Dani
Dani Feb 14, 2015 updated at 10:02:40 (UTC)
Goto Top
Moin,
poste bitte dein Powershellskript. Du wirst einen kl. Anfängerfehler gemacht haben... zu 99%. face-smile


Gruß,
Dani
Mitglied: 114757
114757 Feb 14, 2015 at 11:04:07 (UTC)
Goto Top
Siehe:
http://www.paessler.com/manuals/prtg/exe_script_advanced_sensor
Define the Windows user account that the sensor uses to run the executable or script file. Choose between:

Use security context of probe service : Run the selected file under the same Windows user account the probe is running on. By default, this is the Windows system user account (if not manually changed).
Use Windows credentials of parent device : Use the Windows user account defined in the settings of the parent device this sensor is created on. Please navigate to parent device settings of this sensor to change these Windows credentials.
Für Netzwerkzugriff auf ein Share muss das Script entweder mit einem Account ausgeführt werden welcher Zugriff auf das Share hat ("Jeder" bedeutet nicht das der System-Account des Nodes Zugriff hat, im Gegenteil), oder man bindet im Powershell-Script das Laufwerk mit entsprechenden Credentials ein.

Gruß jodel32
Member: Dschingis
Dschingis Feb 15, 2015 at 09:18:19 (UTC)
Goto Top
Hi,
@Dani: Leider kann ich das Script erst am Montag posten face-wink.
Kannst du mir evtl. ein Korrektes Beispiel zeigen?

@jodel: In den Sensor-Settings ist schon ein Domänenadmin hinterlegt.
Laut PRTG wird der Benutzer der Sensor-Settings verwendet. Oder verstehe ich das falsch?

Gruß

Dschingis
Member: Dschingis
Dschingis Feb 17, 2015 at 09:18:11 (UTC)
Goto Top
"Use Windows credentials of parent device" war die Lösung! Vielen Dank!

Beim Erstellen eines Exchange Powershell sensors bekomme ich noch folgenden Fehler:

The Sensor can not connect to the Device using Remote-PowerShell. Ensure that remote management is enabled on the
Exchange Server and the username and password is correct. See http://kb.paessler.com/knowledgebase/en/topic/54353
for details. Connecting to remote server "Servername" failed with the following error message : WinRM cannot
process the request. The following error occurred while using Kerberos authentication: The computer vmsst107.kvbw.lcoal
is unknown to Kerberos. Verify that the computer exists on the network, that the name provided is spelled correctly, and
that the Kerberos configuration for accessing the computer is correct. The most common Kerberos configuration issue is that
an SPN with the format HTTP/"servernmae" is not configured for the target. If Kerberos is not required, specify the
Negotiate authentication mechanism and resubmit the operation. For more information, see the about_Remote_Troubleshooting Help topic.

Wenn ich Powershellskripte auf dem Probe-Server ausführe geht alles....
Also d.h. die Remotepowershell ist am Exchange aktiv.
Hierbei handelt es sich um den Exchange Datenbanksensor vom Hersteller
Mitglied: 114757
114757 Feb 17, 2015 updated at 09:25:11 (UTC)
Goto Top
vmsst107.kvbw.lcoal
Der hat genug Kohle dafür aber einen Schreibfehler face-wink