Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
We have one Dummy Qlik Sense QMC job that is dependent on another server job where we are receiving the data. The QlikSense QMC job will be executed after the data has been refreshed from another server.
We have PowerShell script which is running fine in old server but when we trying to execute this PowerShell in newly migration server. Getting forbidden error.
Please find my script below.
cls
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB")
$url = "https://Myserver/qrs/about?xrfkey=iX83QmNlvu87yyAB"
#$response = Invoke-RestMethod -Uri $url -Method Get -Headers $hdrs -SessionVariable websession
$response = Invoke-RestMethod -UseDefaultCredentials -Uri $url -Method Get -Headers $hdrs -SessionVariable websession
$cookies = $websession.Cookies.GetCookies($url)
$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession
$session.Cookies.Add($cookies)
$response = @{}
$hdrs = @{}
$hdrs.Add("X-Qlik-xrfkey","iX83QmNlvu87yyAB")
$url = "https://Myserver/qrs/task//start/synchronous?name=DummyJobForTrigger&xrfkey=iX83QmNlvu87yyAB"
$response = Invoke-RestMethod -WebSession $session -Uri $url -Method Post -Headers $hdrs -ContentType 'application/json'
$response.value -like "????????-????-????-????-????????????"
Error screenshot:
Could you please check and suggest ?
Regards,
Irshad Ahmad
403 is a post auth (i.e. the authentication was successful) denial based on access. The most obvious step to verify is that the user who is running the PowerShell script has sufficient rights to do perform the action. In this interactive session I can run the whoami command to see the user then verify that they have sufficient rights to execute the task (RootAdmin will assuredly grant them this right, you can customize the security rules to provide this without the RootAdmin role):
It's unclear what is executing this script, but I would start by running it as your target user. Then running it in whatever system / process / application will be executing the script.
403 is a post auth (i.e. the authentication was successful) denial based on access. The most obvious step to verify is that the user who is running the PowerShell script has sufficient rights to do perform the action. In this interactive session I can run the whoami command to see the user then verify that they have sufficient rights to execute the task (RootAdmin will assuredly grant them this right, you can customize the security rules to provide this without the RootAdmin role):
It's unclear what is executing this script, but I would start by running it as your target user. Then running it in whatever system / process / application will be executing the script.