Modifying QVS Settings - QlikProfessionalServices/QlikView-CLI GitHub Wiki
Get the Existing Settings, Make the required Modifications, Save the Settings, Restart the Service.
In order to succsessulyy modify the QVS Settings we first need to connect to the Qlik View environment and get the existing QVS Settings.
#Connect to the Local Qlik View Server
$QVClient = Connect-QlikView
#Get the QVS Settings
$QVQVSSettings = Get-QVQVSSettings -Scope All -qvsID $QVClient.QlikViewServer.id
We can then Modify the existing QVS Settings with the new values we want
$QVQVSSettings.Documents.Server.AllowDocumentDownload = $False
$QVQVSSettings.Logging.FileSplitMode = [QlikView_CLI.QMSAPI.QVSLogFileSplitMode]::Daily
$QVQVSSettings.Security.EnableAuditLogging = [QlikView_CLI.QMSAPI.QVSAuditLogLevel]::Detail
$QVQVSSettings.Security.Authentication.Level = [QlikView_CLI.QMSAPI.QVSAuthenticationLevel]::ProhibitAnonymous
we then save the updated QVS Settings Object back to QlikView
Save-QVQVSSettings -Qvssettings $QVQVSSettings
And finally Restart the Service for the new setting to take effect
Restart-QVQVS -qvsID $QVClient.QlikViewServer.id
First we connect to QlikView and Get the Existing Settings
#Connect to the Local Qlik View Server
$QVClient = Connect-QlikView
#Get the QVS Settings
$QVQVSSettings = Get-QVQVSSettings -Scope All -qvsID $QVClient.QlikViewServer.id
Once we have the Settings, we can review the existing settings by interrogating the object returned by the Get-QVQVSettings
function
We then Modify the FileSplitMode Property
$QVQVSSettings.Logging.FileSplitMode = [QlikView_CLI.QMSAPI.QVSLogFileSplitMode]::Daily
Finally we save the updated settings back to QlikView and restart the QVS Service using:
Save-QVQVSSettings -Qvssettings $QVQVSSettings
Restart-QVQVS -qvsID $QVClient.QlikViewServer.id
In this example we will modify multiple properties before updating the QVS Settings back on the server.
#Connect to the Local Qlik View Server
$QVClient = Connect-QlikView
#Get the QVS Settings
$QVQVSSettings = Get-QVQVSSettings -Scope All -qvsID $QVClient.QlikViewServer.id
#Disable the Affinity on the First CPU
$QVQVSSettings.Performance.cpu.Affinity[0] = $False
#Set the CPU Throttle to 90
$QVQVSSettings.Performance.cpu.Throttle = 90
#Increase the LowLimit to 80
$QVQVSSettings.Performance.WorkingSetMemory.LowLimit = 80
#Increase the HighLimit to 95
$QVQVSSettings.Performance.WorkingSetMemory.HighLimit = 95
#Change the Logging Split File Setting
$QVQVSSettings.Logging.FileSplitMode = [QlikView_CLI.QMSAPI.QVSLogFileSplitMode]::Daily
#Save the updated Settings
Save-QVQVSSettings -Qvssettings $QVQVSSettings
#Restart the QVS for the Updated Settings to take effect
Restart-QVQVS -qvsID $QVClient.QlikViewServer.id
if we take EnableAuditLogging as an example.
We can run the PowerShell command .GetType()
$QVQVSSettings.Security.EnableAuditLogging.GetType()
Here we can see that the EnableAuditLogging is a BaseType Enum. and the Enum is called "QVSAuditLogLevel"
The DataObject definition can be found here: https://help.qlik.com/en-US/qlikview-developer/April2020/APIs/QMS+API/html/T_PIX_QMSAPI_DataObjects_QVSAuditLogLevel.htm
More options for working with enums can be found here: https://devblogs.microsoft.com/scripting/working-with-enums-in-powershell-5/
We can further expand on the Object type by calling .GetType().FullName which shows us the FullName of the object type
$QVQVSSettings.Security.EnableAuditLogging.GetType().FullName
In PowerShell we can then encase this full name in square brackets '[FullName]' to use dotnet enum type
Once we know the Valid Values for the EnableAuditLogging, we can then use any of the following Valid values to set the desired Audit Logging level. Int values require you to know what that translates to, which can be found on the DataObject definition listed above.
$QVQVSSettings.Security.EnableAuditLogging = "None"
$QVQVSSettings.Security.EnableAuditLogging = [QlikView_CLI.QMSAPI.QVSAuditLogLevel]::None
$QVQVSSettings.Security.EnableAuditLogging = 0
$QVQVSSettings.Security.EnableAuditLogging = "Basic"
$QVQVSSettings.Security.EnableAuditLogging = [QlikView_CLI.QMSAPI.QVSAuditLogLevel]::Basic
$QVQVSSettings.Security.EnableAuditLogging = 1
$QVQVSSettings.Security.EnableAuditLogging = "Detail"
$QVQVSSettings.Security.EnableAuditLogging = [QlikView_CLI.QMSAPI.QVSAuditLogLevel]::Detail
$QVQVSSettings.Security.EnableAuditLogging = 2