Server per Powershell konfigurieren

Server Administration via Powershell

Powershell starten mit administrativen Rechten starten.

# Bildschirmauflösung setzen
Set-DisplayResolutions 1280 720

# Zeitzone einstellen auslesen und kopieren
tzutil /l
Set-Timezone “Zeitzone einfügen”
Einstellungen prüfen
Get-TimeZone

# DHCP ausschalten
Get-NetIPConfiguration
InterfaceIndex merken
Set-NetIPInterface -InterfaceIndex 3 -DHCP Disabled

# IP Adresse zuweisen
Get-NetIPConfiguration
InterfaceAlias merken
Get-NetIPAdress -InterfaceAlias Ethernet0
New-NetIPAdress -InterfaceAlias Ethernet0 -IPAdress 192.168.178.10 -PrefixLength 24 -DefaultGateway 192.168.178.100

Einstellungen wieder prüfen
Get-NetIPConfiguration

# DNS zuweisen
Get-NetAdapter | Select-Object InterfaceAlias , InterfaceIndex
Get-DnsClientServerAddress -InterfaceIndex 1
Set-DNSClientServerAddress -InterfaceAlias Ethernet0 -ServerAddresses (“192.168.178.1”)
Set-DnsClientServerAddress -InterfaceIndex 1 -ServerAddresses (“192.168.178.1″,”192.168.178.2”)
Einstellungen wieder prüfen:
Get-NetIPConfiguration
Get-NetAdapter | Select-Object InterfaceAlias , InterfaceIndex

Optional auf einem entfernten Computer:

Enter-PSSession -ComputerName ComputerName -Credential domainuser
Get-NetAdapter | Select-Object InterfaceAlias , InterfaceIndex
Get-DnsClientServerAddress -InterfaceIndex 1
Set-DnsClientServerAddress -InterfaceIndex 1 -ServerAddresses (“192.168.178.1″,”192.168.178.2”)

# Hostname ändern
Get-Content env:computername
Rename-Computer -NewName server01 -restart

# Lizenz zuweisen
slmgr.vbs /?
slmgr.vbs -ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
slmgr.vbs -ato

#Firewall Ping aktivieren
Get-NetFirewallRule | ft -autosize
Get-NetFirewallRule -Name FPS-ICMP4-ERQ-In | Enable-NetFirewallRule
Get-NetFirewallRule -Name FPS-ICMP4-ERQ-Out | Enable-NetFirewallRule

# Domain Join
Add-Computer -DomainName “nds-edv.de” -Restart