Intune | MECM | MEM | Autopilot | Desktop Analytics | Blogs
How to Deploy PowerShell Script in Intune
Login to MEM(Microsoft Endpoint Manager) console and click on Devices then click on scripts as highlighted in below screen.
Click on Add button then select Windows 10 and later.
Fill the Script Name and Description then click on Next.
Click on browse in Script Location then select the PowerShell script file that we want to deploy on Device.
Select the PowerShell file then click on Open.
Click on Next.
Click on Add Group under Included group to deploy script on Devices.
Click on Next.
Here you can see the Review, If you want to modify something click on Previous and modify, otherwise click on Add.
Can see the script name here that were created. Click on script name to view the deployment status.
Here you can see Assigned status :Yes,
Login to Device if you want to test script immediate, Login to Company Portal and then click on Settings.
Click on Sync button to get latest policy from Intune.
Open the IntuneManagementExtentsion.log file from this location.
Check the logs file that client received policy.
Press F3 and Type [PowerShell] to filter PowerShell related logs.
Check the PowerShell Body and validate PowerShell script.
Here you can see the Folder has been created.
Go to the MEM console and select the deployed script the got the Device status tab to check script status.