-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ServerBuild Buddy Script #67
Milestone
Comments
PowerShell Script v1#Disable ipv6
reg add hklm\system\currentcontrolset\services\tcpip6\parameters /v DisabledComponents /t REG_DWORD /d 0xFF /f
Get-NetAdapterBinding –ComponentID “ms_tcpip6” | disable-NetAdapterBinding –ComponentID “ms_tcpip6” –PassThru
Set-NetIPInterface -InterfaceAlias 'Ethernet0' #set to match the default interface alias value
Get-NetIPConfiguration
$ip = Read-Host "Enter the IP address"
Set-NetIPAddress -InterfaceAlias 'Ethernet0' -IPAddress $ip -PrefixLength 24
Set-DnsClientServerAddress -InterfaceIndex 14 -ServerAddresses ("enter your DNS","enter your dns")
#Set Suffixes - credit https://eddiejackson.net/lab/2022/03/08/powershell-add-dns-suffix-to-ethernet-connections/
Set-DnsClientGlobalSetting -SuffixSearchList @(“domain.com”, “test.domain.com”,“uat.domain.com”)
#Rename and join domain - credit https://stackoverflow.com/a/13492388
# get the credential
$cred = get-credential
# enter the computer in the right place
Add-Computer -DomainName YOURDOMAINNAME -Credential $cred
# rename the computer with credential (because we are in the domain)
$Computer = Get-WmiObject Win32_ComputerSystem
$r = $Computer.Rename("NewComputerName", $cred.GetNetworkCredential().Password, $cred.Username) |
Sysadmin Buddy Script V2
#Disable ipv6
Get-NetAdapterBinding –ComponentID ms_tcpip6 | disable-NetAdapterBinding -ComponentID ms_tcpip6 -PassThru
$getinterfaceindex = Get-NetIPConfiguration | select -ExpandProperty InterfaceIndex
Set-NetIPInterface -InterfaceAlias Ethernet0 #set to match the default interface alias value
Get-NetIPConfiguration
$ip = Read-Host "Enter the IP address"
Set-NetIPAddress -IPAddress $ip -PrefixLength 24 -InterfaceIndex $getinterfaceindex
Set-DnsClientServerAddress -InterfaceIndex $getinterfaceindex -ServerAddresses ("10.0.0.10","10.0.0.11")
#Set Suffixes - credit https://eddiejackson.net/lab/2022/03/08/powershell-add-dns-suffix-to-ethernet-connections/
Set-DnsClientGlobalSetting -SuffixSearchList @("domain.com", "test.domain.com","uat.domain.com")
#Rename and join domain - credit https://stackoverflow.com/a/13492388
# get the credential
$cred = get-credential
# Add and rename the computer with a prompt
Add-Computer -DomainName "domain.com" -Credential $cred -NewName (Read-Host -Prompt "Input the new PC name")
Get-NetIPConfiguration |
V3Notes
#Disable ipv6
Get-NetAdapterBinding –ComponentID ms_tcpip6 | disable-NetAdapterBinding -ComponentID ms_tcpip6 -PassThru
$getinterfaceindex = Get-NetIPConfiguration | select -ExpandProperty InterfaceIndex
Set-NetIPInterface -InterfaceAlias Ethernet0 #set to match the default interface alias value
Get-NetIPConfiguration
$ip = Read-Host "Enter the IP address"
New-NetIPAddress -IPAddress $ip -PrefixLength 24 -DefaultGateway "10.0.0.1" -InterfaceIndex $getinterfaceindex
Set-DnsClientServerAddress -InterfaceIndex $getinterfaceindex -ServerAddresses ("10.0.0.10","10.0.0.11")
#Set Suffixes - credit https://eddiejackson.net/lab/2022/03/08/powershell-add-dns-suffix-to-ethernet-connections/
Set-DnsClientGlobalSetting -SuffixSearchList @("domain.com", "test.domain.com","uat.domain.com")
#Rename and join domain - credit https://stackoverflow.com/a/13492388
# get the credential
$cred = get-credential
# Add and rename the computer with a prompt
Add-Computer -DomainName "domain.com" -Credential $cred -NewName (Read-Host -Prompt "Input the new PC name")
Get-NetIPConfiguration
#refresh dns
ipconfig /registerdns |
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MVP1
v4
V4 ServerBuild Buddy Form #72
The text was updated successfully, but these errors were encountered: