Code Monkey home page Code Monkey logo

servicenow-ieautomation's Introduction

ServiceNow-IEAutomation

This repository is a collection of PowerShell scripts I made to be able to automate the logging of tickets in Service-Now via an Internet Explorer COMObject.

Use

Store in a central location ideally using a DNS Name for the server its on so if the location changes you will not need to update multiple scripts or processes that call them

Process of script

The Process of the scripts are fairly simple:

  • Open IE as a COMObject
  • Reteieve password for account to login to Service-Now
  • Browse to Service-Now Website
  • Retrieve login fields
  • Enter login information
  • Using Service Now Favourite bar click on the button required using HTML CLASS attribute
  • Fill out the information in the ticket
  • Click submit

Pre Setup Instructions

Securely reteieve password back to clear text

As we are entering credentials into the website we need a password to be retrieved in clear text. This can be done any way you want but I use the PowerShell credential encryption. This is setup as follows (for a service account that doesn't have login rights):

  1. Login to server

  2. Setup a scheduled task in the following way: - Account -> Service Account Script will run as - Action -> Powershell.exe -executionpolicy bypass -file - Script file
    #Enter the password
    $Password = "PASSWORD"
    #Enter Location of the output file
    $PasswordFile = "C:\Password.txt"
    $Password | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString | Out-File $PasswordFile

  3. Run the scheduled task

  4. Look for C:\Password.txt and copy it to the location of the script

  5. The script then retrieves the Password with the following $Password = Get-Content $PSScriptRoot\Password.txt | Convertto-securestring $password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))

Setting up correct web tags

When first setting these scripts up the HTML Tags may need to be changed to work with your companies Serivce-Now environment as I assume they are not the same everywhere.

The main one that will definitely need to be changed is the FavouriteBar ClassIDs. This tag is the elements tag and you can look for it by searching the scripts for GetElementsByClassName

servicenow-ieautomation's People

Contributors

joedibleyprh avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.