Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created December 5, 2012 11:47
Show Gist options
  • Save sandrinodimattia/4214953 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/4214953 to your computer and use it in GitHub Desktop.
Rename-Administrator.ps1
$user = Get-WMIObject Win32_UserAccount -Filter "Name='Administrator'"
$username = -join ([Char[]]'abcdefghijklmnopqrstuvwxyz._-~´`àéèç' | Get-Random -count 15)
$user.Rename($username)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment