-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config Server.ps1
37 lines (26 loc) · 1.17 KB
/
Config Server.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<#
COnfiguration Server
- Adresse IP fixe
- Configurer le client DNS
- Desactiver IPv6
- Configurer un FQDN
- COnfigurer la réponse au ping
#>
# Identifier les interfaces IP
Get-NetAdapter
Get-NetIPConfiguration # ipconfig
# Adresse IP fixe
# Désactiver mode client DHCP
Set-NetIPInterface -InterfaceIndex 5 -Dhcp Disabled
New-NetIPAddress -InterfaceIndex 5 -IPAddress 192.168.108.11 -PrefixLength 24 -DefaultGateway 192.168.108.2 ##-WhatIf
# - Configurer le client DNS
Get-DnsClientServerAddress
Set-DnsClientServerAddress -InterfaceIndex 5 -ServerAddresses 127.0.0.1, 192.168.108.11
Get-DnsClientServerAddress
# - Désactiver IPv6
Get-NetAdapterBinding -Name Ethernet0
Set-NetAdapterBinding -Name Ethernet0 -ComponentID ms_tcpip6 -Enabled $false
# - Configurer un FQDN
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -Name "NV Hostname" -Value "srv-dc1"
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -Name "NV Domain" -Value "formation.lab"
Enable-NetFirewallRule -DisplayName "Partage de fichiers et d’imprimantes (Demande d’écho - Trafic entrant ICMPv4)"