lordmilko / PrtgAPI

C#/PowerShell interface for PRTG Network Monitor
MIT License
305 stars 38 forks source link

How to use API PRTG PowerShell #138

Closed soron59 closed 4 years ago

soron59 commented 4 years ago

Hello,

I have already posted the message on the PRTG forum but I am told to do it here: Hi Team,

I start in PRTG API and I want to use the power shell to add equipment

I tried to test clone equipment but I can't. I manage to connect to the server and retrieve information and even create a new sensor in a device already created.

equipment I want to clone: Name: 192.168.50.149 IP: 192.168.50149 ID:3225 (URL for ID: http://127.0.0.1/device.htm?id=3225&tabid=1)

IP for the new devices: 192.168.50.150

DestinationId 2229 is my groupe (http://127.0.0.1/group.htm?id=2229&tabid=1)

Code powershell: $newDevice = Get-Device -Id 3225 | Clone-Objet -DestinationId 2229 "192.168.50.149.clone" "192.168.50.150"

when I execute the code I get an error message on "Clone-Object" which did not recognize

Can you tell me where my error is?

My Error:

PS C:\Users\Administrateur.WIN-6SJG0LHDDHR> $newDevice =Get-Device -Id 3225 |Clone-Objet -DestinationId 2229 "192.168.50.149.clone" "192.168.50.150"

get-device 1 | get-sensor -Status Up

Clone-Objet : Le terme «Clone-Objet» n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou programme exécutable. Vérifiez l'orthographe du nom, ou si un chemin d'accès existe, vérifiez que le chemin d'accès est correct et réessayez. Au caractère Ligne:1 : 34

Thank you this work

lordmilko commented 4 years ago

Hi @soron59,

The command is called Clone-Object not Clone-Objet

soron59 commented 4 years ago

ho fuc** translate thank for help me