Jump to content


  • 0
Chris Zeigler

Trouble running powershell as advertisement

Question

Hey folks, I've created a simple package that has a program that simply runs "powershell.exe" No batch file or anything, I've reduced it down to the most simple thing since I've been having issues trying to call anything else. I've advertised it to two Windows 7 machines, one 32 bit and one 64 bit. Powershell.exe starts just fine on the 64-bit machine, but on the 32-bit machine it fails with a -65536 error. Obviously there's no code trying to be run so it can't be an error there. This seems to happen on all of our 32-bit machines. I even changed the program to go directly to the path of powershell on a 32-bit machine, but the same error occurs. Any ideas?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hello Chris,

 

If you run powershell.exe with no parameters, it should start an interactive session which will never exit. This is probably not what you want ultimately.

 

For testing purposes, open a cmd prompt and test your command in that before deploying through SCCM. For example, on a problematic 32-bit machine, open cmd, run powershell, and if it exits immediately, run "echo %ERRORLEVEL%" in the cmd prompt, and see what you get in return. It's possible that this will spit out the same error code you're seeing.

 

Either way though, as I said above, it *should* start an interactive session, so I'd avoid deploying a straight "powershell.exe" command via SCCM.

 

Hope this helps.

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

Share this post


Link to post
Share on other sites

  • 0

Hello Chris,

 

If you run powershell.exe with no parameters, it should start an interactive session which will never exit. This is probably not what you want ultimately.

 

For testing purposes, open a cmd prompt and test your command in that before deploying through SCCM. For example, on a problematic 32-bit machine, open cmd, run powershell, and if it exits immediately, run "echo %ERRORLEVEL%" in the cmd prompt, and see what you get in return. It's possible that this will spit out the same error code you're seeing.

 

Either way though, as I said above, it *should* start an interactive session, so I'd avoid deploying a straight "powershell.exe" command via SCCM.

 

Hope this helps.

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

 

My original program was more than just powershell.exe without parameters, but it would do the exact same thing, work fine on the 64-bit machine but fail on the 32-bit one. Running powershell.exe from a command prompt on the 32-bit machine opens up the interactive powershell just fine, it only seems to be when it's called from SCCM that it fails.

Share this post


Link to post
Share on other sites

  • 0

My original program was more than just powershell.exe without parameters, but it would do the exact same thing, work fine on the 64-bit machine but fail on the 32-bit one. Running powershell.exe from a command prompt on the 32-bit machine opens up the interactive powershell just fine, it only seems to be when it's called from SCCM that it fails.

Try enabling the "Allow users to interact with this program" checkbox and see what happens.

 

For the sake of making testing easier, you could publish this as an optional advertisement and execute it on-demand from Run Advertised Programs.

 

Hope this helps.

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

Share this post


Link to post
Share on other sites

  • 0

Try enabling the "Allow users to interact with this program" checkbox and see what happens.

 

For the sake of making testing easier, you could publish this as an optional advertisement and execute it on-demand from Run Advertised Programs.

 

Hope this helps.

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

 

Sadly, checking the "Allow users to interact with this program" did not change anything.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.