-
-
Save labrown/0a0e57af61e2dc1a56b3 to your computer and use it in GitHub Desktop.
Sysprep And Remove Vagrant User
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "SysprepAndSeal" -ErrorAction SilentlyContinue | |
$ObjUser = [ADSI]"WinNT://localhost/vagrant"; | |
$ObjUser.userflags = 2; | |
$ObjUser.setinfo(); | |
C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /quiet /shutdown |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment