Pushing PowerShell scripts – scripted actions to endpoints
If there is no policy for the configuration change that you need to make on your corporate devices, you can leverage PowerShell scripts in Microsoft Intune. This is also a good way of publishing one-time installations or custom scripted actions to both your physical and cloud endpoints:
- In the Microsoft Endpoint Manager admin center, browse to Home | Devices | Windows | PowerShell scripts and click Add:
- Click Select a file to upload your PowerShell script to Microsoft Intune:
Important Note
Make sure to select Run script on the 64-bit PowerShell host for the right registry location.
Assign the script to the user or device groups. The script will then run once on each assigned device. Here are some script examples:
- Enable Reserved Storage:
$Storage = Invoke-Command {DISM /Online ...