Run powershell script from Intune (MEM) for local administrator account.

Renaldo Jack 5 Reputation points
2023-08-01T13:37:56.6133333+00:00

Hi, we are trying to run PowerShell scripts from Intune to do the following on workstations:

  1. To enable the local administrator account (some of our accounts are disabled)
  2. Remove the tick "change password at next logon" for local administrator account
  3. Search and remove all accounts from local administrator group apart from the local administrator account.

We try to run it in the context of the system account or logged in user, but it fails. I assume it needs admin rights, but you cannot set this via the script options in Intune. How can we get around this issue?

Windows for business Windows Server User experience PowerShell
Microsoft Security Intune Other
{count} votes

1 answer

Sort by: Most helpful
  1. Pavel yannara Mirochnitchenko 13,331 Reputation points MVP
    2023-08-02T07:05:44.0933333+00:00

    Take some advantage of my script but I would recommend to rely on Azure LAPS. Ofcourse you still can use the script to create additional account but manage it with LAPS.

    0 comments No comments

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.