Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- # Boxstarter options
- $Boxstarter.RebootOk=$true
- $Boxstarter.NoPassword=$false # Is this a machine with no logon password?
- $Boxstarter.AutoLogin=$true
- Write-BoxstarterMessage "Ensuring Computer name is correct..."
- $ServerName = "DC1"
- $HostName = $($env:computername).ToUpper()
- if ($HostName -ne $ServerName) { Rename-Computer -NewName $ServerName -restart }
- Write-BoxstarterMessage "Computer renaming module complete..."
- }
- catch {
- Write-ChocolateyFailure 'Boxstarter Error: ' $($_.Exception.Message)
- throw
- }
Add Comment
Please, Sign In to add comment