0% found this document useful (0 votes)
5 views

7 WindowsCoreGestion

Uploaded by

jawadessadri123
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

7 WindowsCoreGestion

Uploaded by

jawadessadri123
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Cmd Commands

## Display Network Interfaces


netsh interface ipv4 show interfaces

## Configure Network Interface


netsh interface ipv4 set address name="ethernet" static 192.168.1.100 255.255.255.0
192.168.1.1
netsh interface ipv4 set address name="ethernet" source=static
address=192.168.1.100 mask=255.255.255.0 gateway=192.168.1.1

## DNS Configuration
netsh interface ipv4 set dns name="ethernet" static 192.168.1.90
netsh interface ipv4 add dns name="ethernet" 192.168.1.91 index=2 #
index=1 for primary DNS, index=2 for secondary DNS

## Computer Information
hostname
echo %computername% # Display environment variable for computer
name

## Rename Computer and Join Domain


netdom renamecomputer %computername% /newname:CoreSrv
netdom join %computername% /domain:formation.local /userd:administrateur
/passwordd:admin.123

## Restart Command
shutdown /r /t 0 /c "maintenance"

## Firewall Commands
netsh advfirewall set allprofiles state off|on
netsh advfirewall set domainprofile state off|on
netsh advfirewall set privateprofile state off|on
netsh advfirewall set publicprofile state off|on

## Display Firewall Settings


netsh advfirewall show allprofiles
netsh advfirewall show domainprofile
netsh advfirewall show privateprofile
netsh advfirewall show publicprofile

___________________________________________________________________________________
_____________________________
PowerShell Commands

## Network Interface and IP Address


Get-NetAdapter
Get-NetIPConfiguration # Similar to ipconfig
New-NetIPAddress -InterfaceIndex 6 -IPAddress 192.168.1.4 -PrefixLength 24 -
DefaultGateway 192.168.1.1

## Remove Network Address and Route


Get-NetAdapter Ethernet | Remove-NetIPAddress
Remove-NetRoute -InterfaceAlias "ethernet"

## Set DNS Client Server Address


Set-DnsClientServerAddress -InterfaceIndex 6 -ServerAddresses
("192.168.1.90","192.168.1.91")
Set-DnsClientServerAddress -InterfaceIndex 48 -ResetServerAddresses

## Rename Computer and Restart


$env:computername
Rename-Computer -NewName SrvCore -Restart
Restart-Computer

## Join Domain
Add-Computer -DomainName formation.local -DomainCredential administrateur
Add-Computer -DomainName formation.local

## Firewall Profile Management


Get-NetFirewallProfile
Set-NetFirewallProfile -Profile domain,public,private -Enabled True
Set-NetFirewallProfile -Profile domain,public,private -Enabled False

## Command Help
Get-Command *computer*
Get-Help Rename-Computer
Get-Help Rename-Computer -Full
Update-Help

You might also like