Skip to content

Instantly share code, notes, and snippets.

Connect-QlikSense -TrustAllCertificates
#System Audit API
#$ResourceTypes = "AnalyticConnection", "App", "App.Object", "CompositeEvent", "ContentLibrary", "CustomPropertyDefinition", "DataConnection", "OdagLink", "OdagLinkUsage", "OdagRequest", "ReloadTask", "SchemaEvent", "Stream", "Tag"
$ResourceType = "App"
$QSAuditParameters = New-QSAuditParameters -ResourceType $ResourceType
$QSAuditCountParameters = New-QSAuditCountParameters -ResourceType $ResourceType
$AuditRuleCount = Add-QSSystemrule -AuditCountParametersObj $QSAuditCountParameters -SecurityAuditCountresources
$AuditResponse = Add-QSSystemrule -AuditParametersObj $QSAuditParameters -SecurityAudit
$AuditResponse
function Write-UTF8File
{
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[System.IO.FileInfo]$FilePath,
[Parameter(Mandatory = $true,
ValueFromPipeline = $true)]
[string[]]$String,
function Copy-QSReloadTasks {
param
(
[Parameter(Mandatory = $true)]
$SourceAppID,
[Parameter(Mandatory = $true)]
$DestinationAppID
)
#Get the Condensed Verion of the Reload Task
@Nillth
Nillth / GitHub_DownloadReleases_QSECM.ps1
Created November 10, 2022 10:32
Downloads the Latest Version & N-1 of Qlik Sense CM
$DownloadLocation = "\\nas\SharedData\Installers\QSEoW\"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]'Tls,Tls11,Tls12'
$Releases = Invoke-RestMethod "https://api.github.com/repos/qlik-download/qlik-sense-server/releases?per_page=100"
# Page2 Required to account for Nov21IR being behind the back catalog
$Releases += Invoke-RestMethod "https://api.github.com/repos/qlik-download/qlik-sense-server/releases?per_page=100&page=2"
$grouped = $Releases | Select-Object -Property *, @{
N = "version"; e = {
@Nillth
Nillth / QlikView-ManageCals-by-ADGroup.ps1
Created November 10, 2022 01:34
Gets members of a AD Group and assigns or removes CALs
#Requires -Modules @{ ModuleName="QlikView-CLI"; ModuleVersion="1.7.22237" }
#https://www.powershellgallery.com/packages/QlikView-CLI/
function Get-LDAPGroupMembers
{
[CmdletBinding(DefaultParameterSetName = 'GroupName')]
param
(
[Parameter(ParameterSetName = 'GroupPrefix')]
@Nillth
Nillth / SAML_Remove_RoleDescriptors.ps1
Created August 26, 2022 04:24
Cleans up a SAML IDP Metadata file to remove the RoleDescriptor nodes
<#
.NOTES
===========================================================================
Created on: 2022-08-26 2:21 PM
Created by: Marc Collins
Organization: Qlik Customer Success
Filename: SAML_Remove_RoleDescriptors.ps1
===========================================================================
.DESCRIPTION
Removes the RoleDescriptor nodes from a XML file and resaves
<#
.NOTES
===========================================================================
Created by: Marc Collins
Organization: Qlik CSE
Filename: QlikSense-Capabilities-HUB_HIDE_EMPTY_STREAMS.ps1
===========================================================================
.DESCRIPTION
Scripted Implementation: https://community.qlik.com/t5/Knowledge/Stream-are-not-visible-or-available-on-the-hub-in-Qlik-Sense-May/ta-p/1943938
#>
@Nillth
Nillth / Qlik-SaaS-DLOpenAPI.ps1
Created June 7, 2022 00:39
Download all Qlik SaaS Rest OpenAPI Schemas
$PageData = Invoke-restmethod "https://qlik.dev/page-data/apis/page-data.json"
$BaseURI = "https://qlik.dev/specs/rest"
[System.IO.DirectoryInfo]$OutDir = "$($env:TEMP)\QlikSaaS_OpenAPI"
$OutDir.create()
foreach ($RP in $PageData.result.pageContext.specs.rest.endpoints.parent.relativePath){
$OpenAPI = "$($OutDir)\$($RP)"
$URI = "$($BaseURI)/$($RP)"
Invoke-RestMethod -Method Get -Uri $URI -OutFile $OpenAPI -Verbose
}
& Explorer $OutDir
TRACE /\ including who_reloads_me;
LET vScriptStart = TimeStamp(Now(),'YYYY-MM-DD hh:mm:ss.fff');
LET vDocId = DocumentName();
LET vRestConnection = 'monitor_apps_REST_task';
LET vBaseAPIurl = 'https://localhost/qrs';
LET vReloadTaskStart = '';
LET vReloadTaskName = '';
LET vReloadTaskId = '';
LET vReloadTaskTag = '';
$text = Get-Clipboard
$EncodedText =[Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($text))
$decode = "[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String('$EncodedText'))|Set-Clipboard".replace("(","{(}").replace(")","{)}")
$wshell = New-Object -ComObject wscript.shell
sleep -Seconds 5
$wshell.SendKeys($decode)