Qlik Sense Cmdlet for PowerShell. Sokkorn CHEAV

Similar documents
POWERSHELL. Introduction COMP2101 Winter 2019

Integrate Viper business antivirus EventTracker Enterprise

Release notes for version 3.7.2

Executing PowerShell Agent Commands

Developing Microsoft Azure Solutions (70-532) Syllabus

Executing PowerShell Agent Commands

Powershell: Introduction and Practical Uses. Presentation URL:

Install and upgrade Qlik Sense. Qlik Sense 3.0 Copyright QlikTech International AB. All rights reserved.

Install and upgrade Qlik Sense. Qlik Sense 3.2 Copyright QlikTech International AB. All rights reserved.

Deploying an IVR Web Application

FIMS V You will need to know all of the following items before customizing the script and setting up the schedule.

Monitor Qlik Sense sites. Qlik Sense Copyright QlikTech International AB. All rights reserved.


Building Powerful Workflow Automation with Cherwell and PowerShell

When Will Client Computer Backups Be Backed-up Online?

Qlik Sense Desktop. Qlik Sense September 2018 Copyright QlikTech International AB. All rights reserved.

PDF, Notification, Print, and more with Autodesk Vault Job Processor via powerjobs

Developing Microsoft Azure Solutions (70-532) Syllabus

PowerShell provider for BizTalk Server 2013

Technical White Paper Information Map. Taking Action on Information Map Insights

Plan and deploy Qlik Sense. Qlik Sense February 2018 Copyright QlikTech International AB. All rights reserved.

vsphere plug-in Qlik Sense 3.0 Copyright QlikTech International AB. All rights reserved.

Plan and deploy Qlik Sense. Qlik Sense September 2017 Copyright QlikTech International AB. All rights reserved.

Plan and deploy Qlik Sense. Qlik Sense April 2018 Copyright QlikTech International AB. All rights reserved.

Plan and deploy Qlik Sense. Qlik Sense November 2017 Copyright QlikTech International AB. All rights reserved.

Updated after review Removed paragraph mentioned java source code.

PowerShell. Scripting in Windows Environments Gergő Ládi

Qlik Sense Desktop. Qlik Sense February 2018 Copyright QlikTech International AB. All rights reserved.

EZDRM Bitmovin Configuration Encoding

Qlik NPrinting February 2019

UCON 3.0 Automatic Backup Feature

Plan Qlik Sense deployments. Qlik Sense June 2017 Copyright QlikTech International AB. All rights reserved.

Developing Microsoft Azure Solutions (70-532) Syllabus

0. Introduction On-demand. Manual Backups Full Backup Custom Backup Store Your Data Only Exclude Folders.

Qlik NPrinting September 2018 Release Notes

VMware Horizon Session Recording Fling:

Interact2 Help and Support

SharePoint 2010 and 2013 Auditing and Site Content Administration using PowerShell

Powershell. Working with Objects COMP2101 Winter 2018

Installation Guide. Qlik Sense Copyright QlikTech International AB. All rights reserved.

Qlik NPrinting release notes

vsphere plug-in Qlik Sense Copyright QlikTech International AB. All rights reserved.

DRA PowerShell Usage and Examples

Microsoft Exam

Qlik Sense Certification Exam Study Guide

1. Click on "IaaS" to advance to the Windows Azure Scenario. 2. Click to configure the "CloudNet" Virtual Network

Update Offline Address Book Exchange 2010 Error Couldn Find Database

Security Considerations

How To Move MDaemon To A Different Installation Path Or A Different Installation Path On A New Server

When Powerful SAS Meets PowerShell TM

License Metrics for Qlik Sense

Migrating to the latest version of XenApp. Alfons Steger, Senior Systems Engineer CE Rob Sanders, Product Specialist Desktop Virtualisation EMEA

Monitor Qlik Sense sites. Qlik Sense November 2017 Copyright QlikTech International AB. All rights reserved.

AWS Tools for Microsoft Visual Studio Team Services: User Guide

System requirements for Qlik Sense. Qlik Sense September 2018 Copyright QlikTech International AB. All rights reserved.

QlikView 12 SR1 Release notes

Archiving s in Microsoft Outlook 2016

Updating Skype for Business Phone Firmware from Microsoft Skype for Business Server. Table of Contents

Magento Optimizer Extension

UiPath Orchestrator Azure Installation

The power of PowerShell

How to Archive s in Outlook 2007

The KBackup Handbook. Martin Koller

70-532: Developing Microsoft Azure Solutions

Integrate Malwarebytes EventTracker Enterprise

Auto Start Analyzer after AppPool Recycle by IIS

Using the Bluemix CLI IBM Corporation

Using SQLCover with SQL Release PowerShell cmdlets

Microsoft Official Course

Product Page:

70-532: Developing Microsoft Azure Solutions

FileMaker Exam FM1-306 Developer Essential for FileMaker 12 (Beta) Version: 6.0 [ Total Questions: 198 ]

Tools for Running Administrative Tasks in IIS Executing Scripts for Administrative Tasks Managing IIS Tasks

GRASP. Installation Manual Step-By-Step v1.3 for GRASP Installer version

Troubleshoot Qlik Sense using logs. Qlik Sense September 2018 Copyright QlikTech International AB. All rights reserved.

Documentation on File Management for website

: 10961C: Automating Administration With Windows PowerShell

2016 Braindump2go Valid Microsoft Exam Preparation Materials:

2018 GLOBALSCAPE TRAINING OVERVIEW

Bash Check If Command Line Parameter Exists

Microsoft Windows PowerShell v2 For Administrators

Additional Management Tools and Interfaces

Getting Started with the Ed-Fi ODS and Ed-Fi ODS API

Azure Learning Circles

Guidance for Admin Tool

Upgrade, Backup, Restore, and Reset Guide for Access Gateway Enterprise Edition

HEIRES: Heidelberg Remote Service. Release Notes for HEIRES Release 2016B Philipp Lehmann Heidelberg, 2016

Automating Administration with Windows PowerShell

Resilient & Ready. May 21 23, 2018

User Module. File Uploader APPLICATION NOTE

JOB SCHEDULING CHECKLIST

1. Introduction Minimum system requirements Basic Concept Server mode

Qlik Deployment Framework

System requirements for Qlik Sense. Qlik Sense June 2018 Copyright QlikTech International AB. All rights reserved.

Qlik Sense June 2017 release notes

Additional Management Tools and Interfaces

USER GUIDES OWNCLOUD WEB USER GUIDE. INTRODUCTION: This guide provides details on how to use owncloud via the web.

Automating Administration with Windows PowerShell 2.0

Article Number: 722 Rating: Unrated Last Updated: Thu, Jul 20, 2017 at 12:31 AM


Transcription:

Qlik Sense Cmdlet for PowerShell Sokkorn CHEAV

Table of Contents 1. Introduction...2 2. Why this document?...2 3. Tested Environment...2 4. Installation...2 6. Command Test Case...4 6.1 View a list of available commands... 4 6.2 View help for specific command... 4 6.3 Connect to Qlik Sense Server... 4 6.4 Import QVF... 5 6.5 Publish QVF... 5 6.6 Trigger Task... 6 6.7 Export QVF... 7 6.8 Auto Import and Publish App Using Window Task Schedule... 7 6.9 Archive QVF and delete backup files older than 7 days... 9 Page 1 of 10

1. Introduction Qlik-Cli is a PowerShell module that provides a command line interface for managing a Qlik Sense environment. The module provides a set of commands for viewing and editing configuration settings, as well as managing tasks and other features available through the APIs. You can find original Qlik-Cli in GitHub by click this link 2. Why this document? The main purpose of this document is to provide some of use case function where we can t find in GitHub. A common scenario: a. Triggering tasks from an external application b. Auto import and publish app to QMC c. Backup QVF 3. Tested Environment Below server environment has been successfully tested with 1. Windows Server 2016 Standard 2. Qlik Sense June 2017 4. Installation The installation of Qlik-Cli is very simple. Here is the step: 1. Download the package from here 2. Extract the package into [C:\Windows\System32\WindowsPowerShell\v1.0\Modules\Qlik-Cli] Page 2 of 10

MUST READ: a. If you download package from point 4.1 and has same Tested Environment, no issue occur. b. If you download package from original GitHub and has same Tested Environment, the PowerShell will not work. To overcome the issue, you must amend script in file Qlik-Cli.psm1 by adding $result = Invoke-WebRequest -Uri "https://ipaddress/resource" below line [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy Page 3 of 10

6. Command Test Case 6.1 View a list of available commands Get-Help Qlik 6.2 View help for specific command Get-Help Connect-Qlik 6.3 Connect to Qlik Sense Server Connect-Qlik Page 4 of 10

6.4 Import QVF # Step 1: Connect to Qlik Sense Server (start session) # Step 2: Import QVF Import-QlikApp -file "C:\myQVF\Executive Dashboard.qvf" -name "Executive Dashboard" -upload 6.5 Publish QVF # Step 1: Connect to Qlik Sense Server (start session) # Step 2: Publish QVF Publish-QlikApp -id "8c6b1568-7bb0-47bc-a9c9-a90b18b56975" -stream "Executive" -name "Executive Dashboard" Page 5 of 10

6.6 Trigger Task # Step 1: Connect to Qlik Sense Server (start session) # Step 2: Trigger task Start-QlikTask "Reload task of Operations Monitor" -wait Wait-QlikExecution Page 6 of 10

6.7 Export QVF # Step 1: Connect to Qlik Sense Server (start session) # Step 2: Export QVF # Sample export using app id Export-QlikApp -id "8c6b1568-7bb0-47bc-a9c9-a90b18b56975" -filename "C:\myQVF\myExportApp - Operations Monitor.qvf" # Sample export using app name $QVF_Name_In_QMC = "License Monitor" Export-QlikApp -id $(Get-QlikApp -filter "name eq '$QVF_Name_In_QMC'").id -filename "C:\myQVF\myExportApp - $QVF_Name_In_QMC.qvf" 6.8 Auto Import and Publish App Using Window Task Schedule # Step 1: Connect to Qlik Sense Server (start session) # Step 2: Import Qlik Sense App # - In QMC will show "myhelpdeskmanagement" under Apps name Import-QlikApp -name "myhelpdeskmanagement" -file "C:\myQVF\Helpdesk Management.qvf" -upload # Step 3: Publish Qlik Sense App to Stream # - "Support" is a stream name Publish-QlikApp -id $(Get-QlikApp -filter "name eq 'myhelpdeskmanagement'").id -stream $(Get- QlikStream -filter "name eq 'Support'").id -name "myhelpdeskmanagement" Copy script into notepad and save as Import_n_Publish.ps1 Create Task Schedule Page 7 of 10

Add Action a. Action : Start a program b. Program/Script : PowerShell.exe c. Add arguments (optional) : -ExecutionPolicy Bypass C:\myQVF\Import_n_Publish.ps1 Page 8 of 10

6.9 Archive QVF and delete backup files older than 7 days Scenario: 1. Everyday we want to export QVF from QMC into a backup folder and name it something like YYYYMMDD License Monitor.qvf 2. We want to create a backup directory automatically if it not exists. Ex. C:\QVF_Backup 3. We want to delete QVF files where age older than 7 days Page 9 of 10

Below command will handle above scenario: #========================================================================= # Use Case: # 1. Everyday we want to export QVF from QMC into a backup folder # and name it something like YYYYMMDD License Monitor.qvf # 2. We want to create a backup directory automatically if it # not exists. Ex. C:\QVF_Backup # 3. We want to delete QVF files where age older than 7 days #------------------------------------------------------------------------- # Step 1: Declare global variables $Path_Backup = "C:\QVF_Backup" $Today = Get-Date -format "yyyymmdd" # Step 2: Create backup directory if it not exist If(!(test-path $Path_Backup)) { New-Item -ItemType Directory -Force -Path $Path_Backup } # Step 3: Connect to Qlik Sense Server (start session) # Step 4: Only Export and Delete old QVF if reload task FinishedSuccess $GetTaskStatus = $(Get-QlikTask -filter "name eq 'Reload License Monitor'").status If ($GetTaskStatus -eq "FinishedSuccess") { #Export QVF $QVF_Name_In_QMC = "License Monitor" Export-QlikApp -id $(Get-QlikApp -filter "name eq '$QVF_Name_In_QMC'").id -filename "$Path_Backup\$Today - $QVF_Name_In_QMC.qvf" #Delete files older than 7 days Get-ChildItem $Path_Backup -Recurse Where-Object { $_.LastWriteTime -lt (Get- Date).AddDays(-7) } Remove-Item } Copy script into notepad and save as Archive_QVF.ps1 Create Task Schedule (please refer to 6.8) Page 10 of 10