Run PowerShell script as administrator from Microsoft Intune

Andres Agudelo Mora 0 Reputation points
2024-01-11T14:50:21.7233333+00:00

Hello, I would like to consult with you, how can I make a powershell script deployed from Microsoft Intune to run as administrator on the devices.

Microsoft Security Intune Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JM 1,166 Reputation points
    2024-01-11T16:32:05.3833333+00:00

    When you deploy powershell script using Intune. Ensure that the Under Script settings > Run this script using the logged on credentials: Select as No. The script will execute as an administrator. You can refer to the guide for more Information: https://cloudinfra.net/how-to-deploy-a-powershell-script-using-intune/.

    ---If the response is helpful, please click "Accept Answer" and upvote it.---

    0 comments No comments

  2. ZhoumingDuan-MSFT 17,165 Reputation points Microsoft External Staff
    2024-01-12T01:22:03.5233333+00:00

    @Andres Agudelo Mora,Thanks for posting in Q&A.

    From your description, I know you want to deploy a PowerShell script via Intune to run as administrator on device.

    Based on my researching, when you create a PowerShell, in Script settings page, set Run this script using the logged on credentials No and deploy it, then the script will run as administrator on the targeted device.

    User's image

    https://learn.microsoft.com/en-us/mem/intune/apps/intune-management-extension#create-a-script-policy-and-assign-it

    Hope above information can help you. If there is any update, feel free to let me know.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.