What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags


View all Tags

How to use API PRTG PowerShell

Votes:

0

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?

Thank you

I use this link: https://github.com/lordmilko/PrtgAPI/wiki/Object-Creation#device-creation-1

api powershell prtg

Created on Mar 18, 2020 9:43:00 AM



4 Replies

Votes:

0

Dear Flo,

the PrtgAPI is a user project by lordmilko, this is why there is no Paessler support for this. Other users might reply here in the knowledge base though.

Created on Mar 18, 2020 2:26:33 PM by  Arne Seifert [Paessler Support]



Votes:

0

Hi Flo,

As PrtgAPI is a third party product you should ask questions under the GitHub Issues page rather than ask on the Paessler forums

Are you able to advise what the exact error message you are getting is?

Created on Mar 18, 2020 8:03:34 PM



Votes:

0

Yes i have the error message

This Error is

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 + $newDevice =Get-Device -Id 3225 |Clone-Objet -DestinationId 2229 "192 ... + ~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Clone-Objet:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

I will post the error on Github;)

Created on Mar 19, 2020 8:15:22 AM



Votes:

1

The command is called Clone-Object. In the above error message it appears you have typed Clone-Objet, without the "c" in the word Object

Created on Mar 19, 2020 8:37:08 AM




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.