# Disable or enable device by scripting

**URL:** <https://forum.inductiveautomation.com/t/disable-or-enable-device-by-scripting/6301>\
**Category:** General Discussion\
**Created:** [April 23, 2013, 9:13am UTC](https://forum.inductiveautomation.com/t/disable-or-enable-device-by-scripting/6301 "2013-04-23T09:13:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alicia.lopez](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@alicia.lopez](https://forum.inductiveautomation.com/u/alicia.lopez)\
**Post date:** [April 23, 2013, 9:13am UTC](https://forum.inductiveautomation.com/t/disable-or-enable-device-by-scripting/6301/1 "2013-04-23T09:13:04Z")

</div>

Is there any way to enable or disable a device in the gateway based on scripting?

Thank you!

Alicia

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [April 23, 2013, 1:31pm UTC](https://forum.inductiveautomation.com/t/disable-or-enable-device-by-scripting/6301/2 "2013-04-23T13:31:54Z")

</div>

Assuming you are talking about a device in Ignition's OPC-UA Server, you can use the IA Scripting Module to do this:

> [@](#):
>
> system.device.setDeviceEnabled(String dsName, Boolean enabled)

You can download the module for free from the [Module Marketplace](http://www.inductiveautomation.com/modulemarket/moduledetail?14&moduleId=46) and you can find out more about the available functions in the [forum post](http://www.inductiveautomation.com/forum/viewtopic.php?f=88&t=8823) about it.
