docs/powershell.md aktualisiert
This commit is contained in:
@@ -1,28 +1,69 @@
|
|||||||
## Interface
|
## Basic-config
|
||||||
|
|
||||||
> Command: Get-NetIPInterface -AddressFamily [IPv6/IPv4]
|
Set-Password, Set-Hostname, IP-Config, DNS-Config
|
||||||
```ruby
|
|
||||||
Get-NetIPInterface -AddressFamily 'IPv6'
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## IPv6
|
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
<summary>IPv6-an/abschalten</summary>
|
<summary>Expand</summary>
|
||||||
|
|
||||||
|
#### Set-Password
|
||||||
|
|
||||||
|
> Command: Get-LocalUser -Name [Username] | Set-LocalUser -Password (ConvertTo-SecureString -AsPlainText [Password] -Force)
|
||||||
|
```ruby
|
||||||
|
Get-LocalUser -Name 'Administrator' | Set-LocalUser -Password (ConvertTo-SecureString -AsPlainText 'Passw0rd' -Force)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Set-Hostname
|
||||||
|
|
||||||
|
> Command: Rename-Computer -NewName [Name der Maschine] -Restart -Force
|
||||||
|
```ruby
|
||||||
|
Rename-Computer -NewName 'DC01' -Restart -Force
|
||||||
|
```
|
||||||
|
|
||||||
|
#### IP-Config
|
||||||
|
|
||||||
|
> Command: New-NetIPAddress -InterfaceIndex [Index des Interfaces] -AddressFamily [IPv4/IPv6] -IPAddress [IP-Adress] -PrefixLength [SNM / Prefix] -DefaultGateway [IP-Adresse des Default-Gateway]
|
||||||
|
```ruby
|
||||||
|
New-NetIPAddress -InterfaceIndex 3 -AddressFamily IPv4 -IPAddress '172.16.7.100' -PrefixLength '255.255.255.0' -DefaultGateway '172.16.7.254'
|
||||||
|
```
|
||||||
|
|
||||||
|
#### DNS-Config
|
||||||
|
|
||||||
|
> Command: Set-DnsClientServerAddress -InterfaceIndex [Index des Interfaces] -ServerAddresses ("[IP-Adresse primärer DNS]","[IP-Adresse sekundärer DNS]")
|
||||||
|
```ruby
|
||||||
|
Set-DnsClientServerAddress -InterfaceIndex '3' -ServerAddresses ('172.16.7.11','172.16.7.12')
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## Interface Options
|
||||||
|
|
||||||
|
Infos auslesen, IPv6 on/off, DHCPv6 on/off, Networkmode [Public,Private,Domain]
|
||||||
|
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<summary>Expand</summary>
|
||||||
|
|
||||||
|
#### Adapterinfos auslesen [Name/Index/Ip-Adress]
|
||||||
|
IPv6 -AddressFamily 'IPv6'
|
||||||
|
IPv4 -AddressFamily 'IPv4'
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
Get-NetIPInterface
|
||||||
|
```
|
||||||
|
|
||||||
|
#### IPv6-an/abschalten
|
||||||
|
|
||||||
Schaltet IPv6 komplett ab!
|
|
||||||
> Command: [Disable/Enable]-NetAdapterBinding -Name [Name der Netzwerkkarte] -ComponentID ms_tcpip6
|
> Command: [Disable/Enable]-NetAdapterBinding -Name [Name der Netzwerkkarte] -ComponentID ms_tcpip6
|
||||||
```ruby
|
```ruby
|
||||||
Disable-NetAdapterBinding -Name 'eth0' -ComponentID ms_tcpip6
|
Disable-NetAdapterBinding -Name 'eth0' -ComponentID ms_tcpip6
|
||||||
```
|
```
|
||||||
|
```ruby
|
||||||
|
Enable-NetAdapterBinding -Name 'eth0' -ComponentID ms_tcpip6
|
||||||
|
```
|
||||||
|
|
||||||
### IPv6-DHCP-abschalten
|
#### IPv6-DHCP-abschalten
|
||||||
<details>
|
|
||||||
|
|
||||||
<summary>IPv6-DHCP-abschalten</summary>
|
|
||||||
|
|
||||||
Nur DHCPv6 abschalten
|
|
||||||
> Command: Set-NetIPInterface -InterfaceAlias [Name der Netzwerkkarte] -AddressFamily [IPv4/IPv6] -Dhcp Disabled
|
> Command: Set-NetIPInterface -InterfaceAlias [Name der Netzwerkkarte] -AddressFamily [IPv4/IPv6] -Dhcp Disabled
|
||||||
```ruby
|
```ruby
|
||||||
Set-NetIPInterface -InterfaceAlias 'Inside' -AddressFamily 'IPv6' -Dhcp Disabled
|
Set-NetIPInterface -InterfaceAlias 'Inside' -AddressFamily 'IPv6' -Dhcp Disabled
|
||||||
@@ -32,9 +73,6 @@ Set-NetIPInterface -InterfaceAlias 'Inside' -AddressFamily 'IPv6' -Dhcp Disabled
|
|||||||
Set-NetIPInterface -InterfaceIndex '3' -AddressFamily 'IPv6' -Dhcp Disabled
|
Set-NetIPInterface -InterfaceIndex '3' -AddressFamily 'IPv6' -Dhcp Disabled
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
|
||||||
</details>
|
|
||||||
|
|
||||||
## Set-Networkcard-to-private
|
## Set-Networkcard-to-private
|
||||||
Profil der Netzwerkkarte auf Privat umstellen (Firewall)
|
Profil der Netzwerkkarte auf Privat umstellen (Firewall)
|
||||||
> Comman: Set-NetConnectionProfile -InterfaceIndex [Index der Netzwerkkarte] -NetworkCategory "Private"
|
> Comman: Set-NetConnectionProfile -InterfaceIndex [Index der Netzwerkkarte] -NetworkCategory "Private"
|
||||||
@@ -42,6 +80,8 @@ Profil der Netzwerkkarte auf Privat umstellen (Firewall)
|
|||||||
Set-NetConnectionProfile -InterfaceIndex '3' -NetworkCategory 'Private'
|
Set-NetConnectionProfile -InterfaceIndex '3' -NetworkCategory 'Private'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## Add-Route
|
## Add-Route
|
||||||
> Command: New-NetRoute -DestinationPrefix [Subnet] -InterfaceIndex [Index der Netzwerkkarte] -NextHop [IP-Adress] -RouteMetric [Metric]
|
> Command: New-NetRoute -DestinationPrefix [Subnet] -InterfaceIndex [Index der Netzwerkkarte] -NextHop [IP-Adress] -RouteMetric [Metric]
|
||||||
```ruby
|
```ruby
|
||||||
|
|||||||
Reference in New Issue
Block a user