Skip to main content

Get-NewLocalAdmin

Description​

Gets user accounts that have been granted elevated permissions since the last run of the script.

Requirements​

  • Run as administrator
  • PowerShell v5

If the script has not been run previously, the admin data is saved to the table, and the script exits. If a new admin is detected from a previous run, it returns the newly elevated users (if any).

.\Get-NewLocalAdmin.ps1

Output​

Log Files​

  • .\Get-NewLocalAdmin-log.txt

Tables​

  • Get-NewLocalAdmin_log
  • Get-NewLocalAdmin_admins

Changelog​

2025-04-10​

  • Initial version of the document