Intune PowerShell script is not working

Mohamed Umer 140 Reputation points
2023-09-06T06:55:36.86+00:00

Hi there,

I have implemented a PowerShell script in Intune for changing the desktop background image of a device, first of all, it doesn't work even after restarting, and then when I remove the device from the Intune admin the background changes(PowerShell script works).

I am attaching a file of my settings for your reference, please get me through this.

PowerShell Settings.png

Microsoft Intune Configuration
Microsoft Intune Configuration
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Configuration: The process of arranging or setting up computer systems, hardware, or software.
1,945 questions
Microsoft Intune Enrollment
Microsoft Intune Enrollment
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Enrollment: The process of requesting, receiving, and installing a certificate.
1,387 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,327 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,693 questions
{count} votes

Accepted answer
  1. Crystal-MSFT 50,591 Reputation points Microsoft Vendor
    2023-09-07T01:29:44.0466667+00:00

    @Mohamed Umer, Thanks for posting in Q&A. From your description, I know the PowerShell Script to change desktop background image is not working until the device is unenrolled from Intune. If there's any misunderstanding, feel free to let us know.

    It seems the script has been deployed successfully and the registry key for desktop backgorund image has been changed in the registry key. But it doesn't take effect although we restart the device.

    to Clarify our issue, please collect the following information:

    1. For the affected user, if we login other devices, did it have the same result?
    2. What is the status of the PowerShell script in Intune portal for the affected device?
    3. How many devices are affected? Did it affect all? Is there any difference between the working one and not working one?
    4. Was there any other policy or script assigned to the same user and same device which also set desktop background image?

    Please check the above information and if there's any update, feel free to let us 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.


0 additional answers

Sort by: Most helpful

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.