Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rafalcqlik
Contributor III
Contributor III

Execute powershell command in qv script and reload using distribution service

Hi, I created script in qv to download file from Web page using powershell + BITS. Everything is working fine when I reload document manually but when I run it through management control or just wait for scheduled start, it's not working. There is no error or anything but it just won't download file. I'm log file I can see the script and it looks like there is no issue but I don't get any file. I checked allow to execute external program in document properties. What can be wrong here?

My script:

Let vCOMMAND = 'Import-Module BitsTransfer

Start-BitsTransfer -Source http://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?file=table_of_contents.x... -Destination D:\QLIKVIEW\Dane\WEB\EUROSTAT\table_of_contents.xml';

Execute powershell -command $(vCOMMAND);

Thanks in advance

1 Solution

Accepted Solutions
rafalcqlik
Contributor III
Contributor III
Author

Ok, I found the problem. For some reason powershell command:

Import-Module BitsTransfer

Start-BitsTransfer -Source http://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?file=table_of_contents.x... -Destination D:\QLIKVIEW\Dane\WEB\EUROSTAT\table_of_contents.xml

was not working when reloading with distribution service.

But this one works:

Invoke-WebRequest -Uri http://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?file=table_of_contents.x... -OutFile D:\QLIKVIEW\Dane\WEB\EUROSTAT\table_of_contents.xml

Both commands work fine when reloading manually in QlikView desktop.

View solution in original post

6 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

does the user running your QlikView service has an access to this file/rights to execute command statement. Remember, that running it localy you are running it with your credentials, when triggering from server you are using service account credentials.

pozdr.

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
rafalcqlik
Contributor III
Contributor III
Author

Yes, it has access to that file. It's the same user. QlikView Service is running on the same user I'm using to develop documents. It has full admin rights.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

check this topic and see whether you are missing something:

https://qlikviewcookbook.com/2016/01/authorizing-the-script-execute-statement/

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
rafalcqlik
Contributor III
Contributor III
Author

I also found this topic and tried that before I created new discussion. Nothing works...

rafalcqlik
Contributor III
Contributor III
Author

Ok, I found the problem. For some reason powershell command:

Import-Module BitsTransfer

Start-BitsTransfer -Source http://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?file=table_of_contents.x... -Destination D:\QLIKVIEW\Dane\WEB\EUROSTAT\table_of_contents.xml

was not working when reloading with distribution service.

But this one works:

Invoke-WebRequest -Uri http://ec.europa.eu/eurostat/estat-navtree-portlet-prod/BulkDownloadListing?file=table_of_contents.x... -OutFile D:\QLIKVIEW\Dane\WEB\EUROSTAT\table_of_contents.xml

Both commands work fine when reloading manually in QlikView desktop.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Good kn you mate!

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.