Jump to content
TechnicalHero

Run PowerShell command as admin

Recommended Posts

Hi,

I'd really like to run a simple powershell command as admin to uninstall a load of bloatware that comes with Windows 10. From an elevated PS screen, when I run Get-AppxPackage *Microsoft.Office.Desktop* | Remove-AppxPackage it is uninstalled. However, when I run the below, Automate says the script ran and completed but the app stays on the computer. I am able to run other scripts (for example, installing Chrome). Does anyone have any suggestions?

 

 image.thumb.png.cfe284cd817dd4095b3489bd8325d3cb.png

Share this post


Link to post
Share on other sites

Run as admin is not the same as run elevated in the current session, which is what 'run as administrator' actually means in the windows shell. 

With Automate just plain powershell command should work. It runs as system and, with some exceptions, should behave as expected.

If you need to perform any actions on the users profile - like changing the initial screen layout, then you will need to pull in the console number and send commands to the logged in users console. Win10 doesn't give any way to do this without executing commands on the logged in session, though have read that this will be changing in an upcoming version.

 

Share this post


Link to post
Share on other sites

Hi imurphy,

thanks for having a look for me. I have swapped to  "powershell command" and it takes longer to run, but the result is the same. Any other suggestions?

Kind regards,

Share this post


Link to post
Share on other sites

I have also tried the bypass option. As admin and local. Sod all. I would have thought that any decent RMM solution would be able to handle this pretty easily. 

I have got support trying (not sure they know what they are doing)  to setup access to the LTShare for me, the idea being that I create my one line powershell script, then transfer it to the agent and call it from there. Which does seem long winded when the functionality should work as it is in LabTech.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×