microsoft / MDE-PowerBI-Templates

A respository for MDATP PowerBI Templates
MIT License
196 stars 122 forks source link

PowerShell task does not run on assigned user or devices #27

Open sword134 opened 1 year ago

sword134 commented 1 year ago

Hello,

Following the instructions on the page i've setup a powershell script to run on the "TestUser" group which I have created in Microsoft Endpoint Manager. This group consists of 2 users and 2 devices, however despite trying several times, the script to restore the shortcut's deleted by the microsoft defender update still does not run. It simply lists the script as "0 successes, 0 errors on 0 devices".

Trying to run the restore.ps1 script on my device locally throws a "UnauthorizedAccess" error.

How do I fix this? I've searched around and made sure that my device and workaccount are linked/enrolled via Azure AD, yet I still cant make the restore shortcut script run.

Under device status in the script my device is simply listed as "Status: Unknown", yet I can see OS version, device ID and username associated.

leeburridge commented 1 year ago

Have you set to run in system context?

image

Needs to look like that.

ckennedy666 commented 1 year ago

You need to run this against Computers, not Users. A user-based group will likely fail.

sword134 commented 1 year ago

@ckennedy666 i've added both devices and users to the group. So why doesnt it run on the chosen devices in the group?

ckennedy666 commented 1 year ago

I've only had success with a device only group.

sword134 commented 1 year ago

I've only had success with a device only group.

Even if a group only contains devices, then it still doesnt work