Running script with elevated permissions at logon automatically from Group Policy

Jonathan / Spud 56 Reputation points
2022-09-16T16:09:04.507+00:00

I'm migrating users from one tenant to another, and with this comes a fresh 365 license, therefore I need to remove the Users old license, cache and outlook profiles.

I've found the following article that provides the scripts to do these actions: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state#method2

However, the scripts need to run with elevated permissions, and the Run at Logon group policy only runs at a user instance level, therefore meaning the 3 scripts won't work.

The following scripts from the site:

  1. OLicenseCleanup.vbs - requires elevated permissions
  2. signoutofwamaccounts.ps1 - requires elevated permissions
  3. WPJCleanUp.cmd

Does anyone know of an alternative method to get these scripts to only run once, per user, per computer?

Maybes running this from Microsoft Endpoint Configuration Manager?

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,108 questions
Office Management
Office Management
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Management: The act or process of organizing, handling, directing or controlling something.
2,071 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Garth 5,801 Reputation points
    2022-09-18T18:29:02.62+00:00

    Ok i will bite but what does this have to do with cm?