You can find some background here:
https://bst.cloudapps.cisco.com/bugsearch/bug/CSCun28885
https://supportforums.cisco.com/discussion/12538621/uccx-cuic-dashboard-timeout
https://supportforums.cisco.com/discussion/12934891/uccx-tomcat-session-timeout-values-can-not-be-updated-cscun28885
From some email exchanges it looked like every 4 hours or AM someone would need to:
- Kill Internet Explorer
- Start Internet Explorer back up.
- Navigate to the CUIC dashboard permalink.
- Login to the CUIC dashboard.
Powershell script to stop IE, start IE, navigate to a web page and log in:
#====================
# Script closes instances of IE,
# opens a new visible instance,
# navigates to a URL
# and logs into CUIC
# NOTE: user name and password stored here in clear text
#
# WebMaxtor
# 03/28/2016
#====================
# Edit this $Url to be the URL or IP address of the site to launch
# This could be the CUIC logon page or a dashboard permalink
# This assumes there will be no challenge to accept certificates
# Typical CUIC logon page URL below as example
$Url = 'https://uccx01.demo-domain.com:8444/cuic/Login.htmx'
# Edit this to be the username
$Username='rmaslanka3'
# Edit this to the corresponding password
$Password='12345'
# Close IE to eliminate timed out reports
#
# option 1:
# Get-Process iexplore | Foreach-Object { $_.CloseMainWindow() }
#
# option 2:
#(New-Object -COM "Shell.Application").Windows() |
# ? { $_.Name -like "*Internet Explorer*" } |
# % { $_.Quit() }
#
# option 3:
Get-Process iexplore | Stop-Process
# Wait a few seconds to be safe for processes stop if need be
while ($IE.Busy -eq $true)
{
Start-Sleep -Milliseconds 2000;
}
# Start a visible Internet Explorer instance
$IE = New-Object -com internetexplorer.application;
$IE.visible = $true;
$IE.navigate($url);
# Wait a few seconds and then log on
while ($IE.Busy -eq $true)
{
Start-Sleep -Milliseconds 2000;
}
# fill in the form and click submit button
$IE.Document.getElementById('j_username').value = $Username
$IE.Document.getElementByID('j_password').value=$Password
$IE.Document.getElementById('cuesLoginSubmitButton').Click()
Windows Batch file to make running powershell script easier:
@ECHO OFF
PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}"
The beauty of the batch file is if the powershell script and the batch file are named the same except for the file extension (i.e. MyFile.bat and MyFile.ps1) and reside in the same folder, you can just click the BAT file and you are off and running.
There are multiple methods to close IE via powershell and I can't be sure what will work best in your environment so be sure to test the three options or come up with your own.
The final step was then calling the BAT file from Window's Scheduled Tasks on a regular basis to ensure the report was not effected by the Tomcat inactivity timer.
thanks using this at work and its awesome!
ReplyDelete