Running logon scripts when a user logs in to a computer allows administrators to deploy and configure machines beyond what is possible with Intune.
With Intune, we can run PowerShell scripts when a user logs on to their machine. In this post, we will run a simple PowerShell script that creates a directory on the c:\.
Below is the script that I am going to deploy.
New-Item -Type Directory -Path c:\ -Name deploy
To deploy a PowerShell script with Intune, open the Intune console. Click on Devices -> Scripts and click on Add from the scripts main page.
In the Script Setting settings, Upload your script and leave all the settings as default.
In the Assignments, section select an Azure AD Group that contain the devices you would like to deploy the script to and finish the wizard.