Support Request: Run Powershell Script Through Object Model

Description

Hey,
i am trying to run a powershell script. The script works, however i am struggling to execute the powershell.exe through the sitekiosk object model.
I followd the instructions here: http://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?externalapps_run_mth.htm
This results in the followig function:

function setupAutologon() {
    window.external.InitScriptInterface();
    SiteKiosk.ExternalApps.RunElevated("c:\\windows\\system32\\windowspowershell\\v1.0\\powershell.exe -file 'C:\\Program Files (x86)\\SiteKiosk\\HtmlRegistryAutoAdminLogon.ps1'", false);
    SiteKiosk.Logfile.Notification("Setup Registry for AutoAdminLogon");
}


I am calling the function with the AddDelayedEvent() function, in the logfile i get the following error though:
40 03f5 2018-05-16 16:12:59 +0200 [SiteKiosk] Laufzeitfehler in Microsoft JScript: "'window' ist undefiniert" at line 60, char 4
Which is german and basically tells me there is a "runtime error" in my script, at the line " window.external.InitScriptInterface();"

What am i doing wrong?

Kind Regards,
Finn.

Answer: (3)

Re: Run Powershell Script Through Object Model 5/16/2018 4:54 PM
Hello,

wenn Sie möchen, können Sie auch auf Deutsch schreiben.

Ansonsten:
It seems you use this code in an external script and in that case you should remove this line:

window.external.InitScriptInterface();

There is no window when using an external script and furthermore this line is only for activating the object model within a web page in the SiteKiosk Browser. It is not necessary in an external script that you add to the SiteKiosk configuration.
Also see “6. Execute script file”
http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?advanced_settings.htm

Also note that for security reasons executing powershell is blocked by default.
Notifications you will find in the SiteKiosk log (…\SiteKiosk\Logfiles).
Example:

[SiteKiosk] Notification: According to the windows monitoring rule(Title:'xxxxxx' Class:'xxxx') the window (Title:'xxxxxxxx' Class:'xxxxxxxxx') will be closed


Further information about that feature:
- http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?windows___dialoge.htm
- http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?handling_of_windows.htm

And if using the SiteKiosk user (Auto Start) the “powershell.exe” and “powershell_ise.exe” are blocked in general but can be allowed at “-->Customized-->Programs” with the System-Security-Manager:
http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?access_rights1.htm

Please understand that our free support cannot offer any assistance with creating your own code or customizing the skin files (apart from the detailed SiteKiosk and SiteKiosk Object Model documentation).
http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?support.htm

Documentation:
- General Information about customizing SiteKiosk: http://www.provisio.com/web/us/features/siteskin
- SiteKiosk help: http://www.provisio.com/helpconsole/SiteKiosk%20Help/en-US/default.htm?customization_%28site_skin%29.htm
- SiteKiosk Object model help for IE based skins: http://www.provisio.com/helpconsole/SiteKiosk%20Object%20Model%20Help/en-US/default.htm?index.htm
- The SiteKiosk Object model help for Chrome Browser Skin can be requested via e-mail at support-europe(at)provisio.com

Further hints and suggestions can be found in our developer blog at http://devblog.provisio.com/


If you need further assistance in creating individual coding solutions you can contact us via e-mail that we may find a solution against payment for your needs.

In case you are interested in a solution against payment please write a detailed description to support-europe(at)provisio.com that we can check the technical feasibility and the amount of work to make a quotation.
The adjustment fees are depending on the complexity of the changes and in general it costs 120 Euro per hour.

Regards,
Michael Olbrich
Re: Run Powershell Script Through Object Model 5/16/2018 5:05 PM
Thank you so much for the fast response. That fixed my problem.
Re: Run Powershell Script Through Object Model 5/17/2018 8:49 AM
Thank you for your feedback.
My Account
Login
Language (Tickets):