IPower Switch Control With a Script

Some customers have requested information on how to control ports on our IP Power Switches such as Part No. 32657, 32658 and 32652 without the need of the web interface. This is a useful function if you want to reboot one device/machine on one port using a small program/script. First of all you have to download the correct scripts for the corresponding part number, these can be found in the web download section.

There are two supplied scripts, one for “ON” and one for “OFF”.

This is the functional part of the script:

Set HttpReq = CreateObject(“MSXML2.ServerXMLHTTP”)
HttpReq.Open “GET”, “http://admin:admin@192.168.3.154:80/?cmd=1&p=A3&s=1“, False
HttpReq.send

So, to control the port you need to set the http address of the web interface which is used to control the units, this is located in the manual for each IPower Switch.
Do not edit “cmd=1” however you will need to edit ‘P=’ and ‘S=’ to set which port you would like to turn on or off.

P = The port number on the device, eg:A3, which you want to switch ON/OFF.
S = Port state, (1 = On, 0 = Off)

So, with two simple amendments to the script, the chosen port can now be controlled. You now need to create a task which will run the program at your chosen time or date.

Scheduling a task:

Using these scripts you can schedule a task to tell the iPower switch to turn specific ports off or on at a certain time. Please note that this requires your machine to be on at the scheduled time/date in order to run the command.

1. First you need to go to the Task Scheduler program, this is located in the Control Panel under “Administrative Tools”.

2. Click on “Create Basic Task” and it will bring up the window for scheduling your task.

2

3. Name your task, for example “Turn Port 3 On”, and add an optional description.

3

4. Set the frequency you want the task to trigger, for example when you turn your computer on or at a specific time each day.

4

5. Next you need to set when you want the task to trigger, for example if it is set to daily you can choose the time and date.

5

6. On the following window you need to choose “Start a Program”

6

7. Here you need to click “Browse” and select either the “IPOWER_ON” or “IPOWER_OFF” script.

7

8. When you click “Next” you will be taken to the summary page, if everything is correct simply click “Finish” and your scheduled task will be created. You can create as many tasks as you require using the same method as above.

And there you have it, as long as  your IPower Socket is on your network you will be able to control it and switch on or off without any further intervention.