Intune - Powershell script not pushed to Win10

Chned 51 Reputation points
2020-09-29T09:12:42.213+00:00

So I added a simple .ps1 script in Intune under Devices, Scripts. It is assigned to a Device-group.

28950-1.png

After deploying I can see that the status is showing as Succeeded.

29112-2.png

But the script is never executed on the clients. I read that it should be placed in C:\Program Files (x86)\Microsoft Intune Management Extension\Policies\Scripts, but it isn't appearing there.

I tested this script on the client itself and it is working properly (after executing set-executionpolicy remotesigned)

Does anyone know where to start troubleshooting from here?

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,871 questions
0 comments No comments
{count} votes

12 answers

Sort by: Most helpful
  1. Chned 51 Reputation points
    2020-09-29T09:18:25.037+00:00

    By the way, the script itself is as follows:

    New-Item -Path "HKCU:\Software\Citrix\ICA Client\Keyboard Mapping" -Name Tips –Force
    New-ItemProperty -Path Registry::"HKEY_CURRENT_USER\Software\Citrix\ICA Client\Keyboard Mapping\Tips" -Name "In full screen mode" -Value 20070313 -PropertyType DWord -Force

    0 comments No comments

  2. VipulSparsh-MSFT 16,271 Reputation points Microsoft Employee
    2020-09-29T09:32:15+00:00

    @Chned You will need to update the script with set-executionpolicy remotesigned and then deploy again. Try that and let us know.

    0 comments No comments

  3. Chned 51 Reputation points
    2020-09-29T13:25:12.353+00:00

    I added "set-executionpolicy" to the first line and executed that manually on the clients and it ran succesfully.

    I then uploaded the edited script in Intune and applied. After a while I get the status Failed, so I removed "set-executionpolicy" again and now the status went back to Succeeded again. So it still doesn't work though....


  4. Chned 51 Reputation points
    2020-09-30T13:03:23.88+00:00

    I found out the following.

    We use 2 different types of Deployment profiles, 1 where user enrolling is Standard User and 1 where user enrolling is Local Admin on the device.

    When I put the device in the Deplyoment profile for user account type: Administrator then the regkey gets added succesfully! How to make this work for Standard accounts?


  5. Chned 51 Reputation points
    2020-10-01T14:52:06.77+00:00

    I open regedit and check if "Computer\HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Keyboard Mapping\Tips" including value "In full screen mode" exists.

    When I put the device in the Deplyoment profile for user account type: Administrator then the regkey gets added succesfully, when I put the device in the Deployment profile for user account type: Standard and WIPE and enroll again for testing it never works.


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.