0

I want to run PowerShell command (any command) from SharePoint Script Editor.

Please let me know how can I achieve it?

I use the below script to lunch notepad, just to test it, and even it doesn't work:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

function LaunchApp() {
   var shell = new ActiveXObject("WScript.shell");
   shell.run("notepad.exe", 1, True);
};

</script>
<button type="button" id="btn" onclick=LaunchApp()>Run App</button>

Please help.

0

This isn't possible due to crossing the security boundary of the browser.

0

I agree with Trevor's point of view. By design, the Script Editor Web Part does not support running any powershell commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.