Rename a host and join to the domain
$hostname = "NEW-HOSTNAME"
$Domain = "domain.local"
$Credential = Get-Credential
Rename-Computer $hostname
Add-Computer -Domain $Domain -NewName $hostname -Credential $Credential -Restart
See also: Assign a static ip address