Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Sets Autologin for scripts
- $RegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
- $DefaultUsername = Read-Host -Prompt "User's O365 Cred"
- $DefaultPassword = Read-Host -Prompt "User's O365 Pass"
- Set-ItemProperty $RegPath "AutoAdminLogon" -Value "1" -type String
- Set-ItemProperty $RegPath "DefaultUsername" -Value "$DefaultUsername" -type String
- Set-ItemProperty $RegPath "DefaultPassword" -Value "$DefaultPassword" -type String
- #Reboots and starts next script
- $RunOnceKey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce"
- set-itemproperty $RunOnceKey "NextRun" 'powershell "& {~\Downloads\systemrename.ps1}"'
- Start-Sleep 10
- Restart-Computer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement