PowerShell Task Engine state in Circuit | Qntrl | Circuit | Online Help

PowerShell Engine

These states are used to perform any actions in the Windows machines of a private network using PowerShell commands.

 

There are six states available in the PowerShell Task Engine for performing different operations.
  1. PowerShell Engine
  2. Install WindowsApp
  3. Uninstall WindowsApp
  4. Start Service
  5. Stop Service
  6. Restart WindowsServer

Almost all the operations can be performed using the PowerShell Engine state, but in order to facilitate reusability, some frequently used operations are provided as separate states.

Prerequisite

  • An active Bridge agent. Refer here to install and configure Bridge.

  • Create necessary Credentials for the applications to be connected by PowerShell Task Engine.

For more details about the PowerShell Engine module in Bridge, the keys, and its description click here.

Example Use Case: During the asset allocation process, the installation of the Windows OS for employees can be carried out through the PowerShell Engine state. Using PowerShell Engine the system administrator can establish a connection with the employee's machine and execute remote commands to install OS, and other software and to start/stop services.

Let us see how to configure the PowerShell Engine Task in Builder View and Code View.

1. PowerShell Engine

Executes an attached PowerShell script file on the Windows machine in a private network.

Builder View

For associating the state to a circuit:

  1. In Builder View, drag and drop the PowerShell Engine state from the left pane into your circuit or click the required state in your circuit.

  2. In the Configuration section, update the common state field attributes. 

  3. In Bridge ID, click and select the bridge to be configured to the state from the drop-down list.

  4. Under the Add Configuration section, fill in the following fields:

    1. Credential ID - Click and select the credential from the dropdown list. The Credential ID of all the credentials created for the SSH module type will be displayed in the list.

    2. Script ID - Select the name of the script to be executed. To create a new script file, navigate to Scripts.

    3. Host - Enter the hostname of the machine in which the shell command has to be executed.

  5. Under the Variable section, click Add, the field will expand and allow you to add variables that have to be executed in the PowerShell script. Enter a variable name and its param value.

  6. Under Add Credentials section, click Add to enter the credentials of any Windows machine that has to be connected through PowerShell script. 

    1. Var name - Give a name for the credential.

    2. Name- Select the credential name from the dropdown list, that has to be connected through the PowerShell script. To remove an added variable or credential, hover over the line below the fields and click 'Remove'. 

  7. In the Error Handling section, you can select and configure error handling settings. For additional details, refer to the Error Handling in the circuit states.

  8. In the Input/Output section, enter the required paths. To learn more about I/O paths, click here. 
      

Code view

In Code View, the JSON to execute a PowerShell command and perform a PowerShell task in Circuit is given below:
"Windows OS Installation": {
      "type": "powershell_engine",
      "next": "Licence Key Activation-Windows",
      "start": true,
      "bridge_id": "bridge-employee onboarding",
      "payload": {
            "credential_id": "PWSH Credential for OS installation",
            "script_id": "Script-OSinstall",
            "host": "localhost",
            "variables": {
                  "os_filename": "windows.iso"
            },
            "credentials": [
             {
                  "variable": "Windows_SK01",
                  "credential_id": "psh_cred_5"
             }
            ]
      }
}

2. Install WindowsApp  

This state allows users to install apps in the Windows machines using PowerShell.


This state can be configured in Builder View by entering the MSI file location of the app to be installed in the MSI Filepath field under the Add Configuration section in addition to the common field attributes.

 

   

In Code View, the JSON to install a Windows app using PowerShell task in circuit is given below:

"Install an Application": {
      "type": "install_windows_app",
      "next": "End",
      "start": true",
      "bridge_id": "bridge-employee onboarding",
      "payload": {
            "credential_id": "PWSH Credential for OS installation",
            "host": "localhost",
            "msi_file_path":"C:\\Users\\Administrator\\Downloads\\tortoisehg-5.8.0-x64.msi"
      }
}

3. Uninstall WindowsApp  

An existing app can be uninstalled from the Windows machine using this state.


To uninstall an app from the Windows machine, in Builder View, under Add Configuration, in App Name, enter the name of the app to be uninstalled from the Windows machine along with the common state field attributes.

In Code View, the JSON to uninstall a Windows app using a PowerShell task in circuit is given below:
"Uninstall Windows App": {
       "type": "uninstall_windows_app",
       "next": "End",
       "start": true,
       "bridge_id": "<bridge_name>",
       "payload": {
        "credential_id": "<credential_name>",
        "host": "<host_name>",
        "app_name": "<application_name>"
       }
}

4. Start Service  

The state helps to start a service in the backend Windows server.

To configure a Start Service in Builder View, fill in the common field attributes, and under Add Configuration, in Service Name, enter the name of the service that has to be initiated in a Windows machine.    
  

In Code View, the following JSON is used to start a service using PowerShell engine task in circuit:
"Start App Management Service": {
      "type": "start_service",
      "next": "End",
      "start": true,
      "bridge_id": "bridge-employee onboarding",
      "payload": {
            "credential_id": "pwsh_cred_5",
            "host": "localhost",
            "service_name": "AppMgmt"
      }
}

5. Stop Service  
A service running in the backend Windows server can be stopped with this state.


For associating the Stop Service state in Builder View, fill in the common state field attributes. Under Add Configuration, in the Service Name field, enter the name of the service that has to be stopped in the Windows machine.

 

In Code View, the following JSON is used to stop a service using PowerShell engine task in circuit:
"Stop a Service": {
    "type": "stop_service",
    "next": "End",
    "start": true,
    "bridge_id": "<bridge_name>",
    "payload": {
          "credential_id": "<credential_name>",
          "host": "<host_name>",
          "service_name": "<service_name>"
    }
}
  

5. Restart Windows Server  

This state is used to restart the Windows server operating system which stops all running processes and services on the server, followed by a complete system reboot. It is often done to apply system updates, resolve issues, or perform routine maintenance tasks.

 

To configure the state in Builder View, under Add Configuration, select the Credential ID and enter the Host name of the Windows machine that has to be restarted.

 

In Code View, the following JSON is used to restart a Windows server:
"Restart WindowsW10": {
      "type": "restart_windows_server",
      "next": "End",
      "start": true,
      "bridge_id": "<bridge_name>",
      "payload": {
            "credential_id": "<credential_name>",
            "host": "host_name>"
      }
}









Next: AD Task






    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION





                          Quick Links Workflow Automation Data Collection
                          Web Forms Enterprise Begin Data Collection
                          Interactive Forms Workplace Data Collection App
                          CRM Forms Customer Service Accessible Forms
                          Digital Forms Marketing Forms for Small Business
                          HTML Forms Education Forms for Enterprise
                          Contact Forms E-commerce Forms for any business
                          Lead Generation Forms Healthcare Forms for Startups
                          Wordpress Forms Customer onboarding Order Forms for Small Business
                          No Code Forms Construction RSVP tool for holidays
                          Free Forms Travel
                          Prefill Forms Non-Profit

                          Intake Forms Legal
                          Mobile App
                          Form Designer HR
                          Mobile Forms
                          Card Forms Food Offline Forms
                          Assign Forms Photography
                          Mobile Forms Features
                          Translate Forms Real Estate Kiosk in Mobile Forms
                          Electronic Forms

                          Notification Emails for Forms Alternatives Security & Compliance
                          Holiday Forms Google Forms alternative  GDPR
                          Form to PDF Jotform alternative HIPAA Forms
                          Email Forms
                          Encrypted Forms
                          Embeddable Forms
                          Secure Forms
                          Drag and Drop form builder
                          WCAG


                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • PowerShell Engine

                                                                                                                In Bridge, the PowerShell Engine module is used to perform actions in any Windows machines in the client's network using PowerShell script. Prerequisite While creating Credentials, select the type Powershell and provide the User Name and Password of ...
                                                                                                              • SSH Engine

                                                                                                                SSH Engine module in Bridge is used to perform actions in clients network/client's machine by executing a command/script in Linux/UNIX OS. Prerequisite While creating Credentials for SSH Engine, choose the credential type as SSH. Click here to learn ...
                                                                                                              • Task Engine

                                                                                                                In Qntrl, while public APIs can be configured and executed directly through Webhooks, the client's internal APIs that are exposed only to the local network can be executed using the Task Engine module in Bridge. The Task Engine configured in bridge ...
                                                                                                              • DB Engine

                                                                                                                DB Engine is used to connect with the database in the client's machine or client's network and perform READ/INSERT/UPDATE operations in the database. The DB Engine configured in bridge can be utilized in the following two distinct modules within ...
                                                                                                              • SSH Engine

                                                                                                                SSH Engine state is configured to connect to a client's machine or network and remotely execute commands or scripts on the client's Linux/UNIX operating system. Prerequisite Bridge must be installed and should be active. To learn how to install and ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources