Running Powershell Scripts - Windows 11 Laptop - Local Admin

Brass Contributor

Hi All,

 

I am going round in circle's trying to deploy some powershell scripts, they are required to do some pretty simple tasks, like download a file from a suppliers website and set the wallpaper to a certain background.

 

The device is a Windows 11 laptop, Enrolled in Intune and deployed with Autopilot.

The device only has a local admin account (due to the laptop being off the network for long periods and customer needs).

 

I have a PS script that creates a local admin account and password, this works no problem.

The next script sets the welcome screen, lock screen and the user wallpaper, this work for the first two but doesn't change for the logged in user.

The last script should download a file from a suppliers website and save it on the desktop.
This deploys with Intune but errors. I have run the script directly on the laptop and it works.

Am I missing something?

 

Can scripts be deployed by Intune and ran when end user is a local admin?

I have tried  changing this setting and still doesn't work "Run this script using the logged on credentials"

 

Any help is appreciated.

 

 

 

3 Replies
Slight Break through.

Simplified the process.
Created a script to create a folder on the C drive. - that worked
Created a script to download the file and safe it to the that folder - that worked
Just creating a third script to create a shortcut to that file on the desktop - testings....
Desktop shortcut not worked - seems to be having issues when trying to add files and folders to the desktop..
Are you testing it in system context as well, when you are testing directly on the device?