Delete Local Accounts with Powershell Script

Discussion in 'Windows 10' started by alessio89g, Jul 17, 2020.

  1. alessio89g

    alessio89g MDL Member

    Jan 20, 2013
    238
    17
    10
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    3,451
    1,345
    120
    #2 kaljukass, Jul 17, 2020
    Last edited: Jul 17, 2020
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. alessio89g

    alessio89g MDL Member

    Jan 20, 2013
    238
    17
    10
    Is it not because of the number of the accounts, but because I make a sysprep 2004 image, with a pre-configured account ("User"), and I want a script which delete the account created during OOBE; I don't know which name will be inserted, so I thinked for a script which delete everything except the built-in accounts (Administrator, ssh, etc…) and "User" account.
    The script it's not an example, I tested it, and it works, but it wipe also the "User" account, so at the next boot I can't do anything (the Lockscreen ask for a nonexistent password for "User")
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...