Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $script:count = 1
  2.  
  3. function Test-Cluster {
  4.      $ComputerName = "webscale-app-v$script:count"
  5.      
  6.      While (Test-Connection $ComputerName -Quiet -Count 2)
  7. {
  8. "Testing Connection with $ComputerName"
  9. $script:count++
  10. }
  11. }
  12. Test-Cluster
  13.    
  14. Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname"
  15. Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname"
  16.  
  17. New-PSDrive -name HKU -PSProvider "Registry" -Root "HKEY_USERS"
  18.  
  19. Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $ComputerName
  20. Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\ActiveComputername" -name "Computername" -value $ComputerName
  21. Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" -value $ComputerName
  22. Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" -value  $ComputerName
  23. Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "AltDefaultDomainName" -value $ComputerName
  24. Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" -name "DefaultDomainName" -value $ComputerName
  25. #Set-ItemProperty -path "HKU:\.Default\Software\Microsoft\Windows Media\WMSDK\General" -name "Computername" -value $ComputerName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement