Guest User

Untitled

a guest
Apr 23rd, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. try {
  2. # Boxstarter options
  3. $Boxstarter.RebootOk=$true
  4. $Boxstarter.NoPassword=$false # Is this a machine with no logon password?
  5. $Boxstarter.AutoLogin=$true
  6.  
  7. Write-BoxstarterMessage "Ensuring Computer name is correct..."
  8. $ServerName = "DC1"
  9. $HostName = $($env:computername).ToUpper()
  10. if ($HostName -ne $ServerName) { Rename-Computer -NewName $ServerName -restart }
  11. Write-BoxstarterMessage "Computer renaming module complete..."
  12. }
  13. catch {
  14. Write-ChocolateyFailure 'Boxstarter Error: ' $($_.Exception.Message)
  15. throw
  16. }
Add Comment
Please, Sign In to add comment