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.

2 Answers 2

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 and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.