docs/powershell.md aktualisiert
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# Powershell
|
# Powershell
|
||||||
|
|
||||||
## IPv6 DHCP abschalten
|
## IPv6 DHCP abschalten
|
||||||
> Command: Get-NetIPInterface -AddressFamily [IPv6/IPv4]
|
> Command: Get-NetIPInterface -AddressFamily [IPv6/IPv4]
|
||||||
```ruby
|
```ruby
|
||||||
@@ -12,21 +13,25 @@ Set-NetIPInterface -InterfaceAlias 'Inside' -AddressFamily 'IPv6' -Dhcp Disabled
|
|||||||
```ruby
|
```ruby
|
||||||
Set-NetIPInterface -InterfaceIndex '3' -AddressFamily 'IPv6' -Dhcp Disabled
|
Set-NetIPInterface -InterfaceIndex '3' -AddressFamily 'IPv6' -Dhcp Disabled
|
||||||
```
|
```
|
||||||
|
|
||||||
## 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
|
||||||
New-NetRoute -DestinationPrefix '172.16.0.0/20' -InterfaceIndex '7' -NextHop '172.16.X.254' -RouteMetric '1'
|
New-NetRoute -DestinationPrefix '172.16.0.0/20' -InterfaceIndex '7' -NextHop '172.16.X.254' -RouteMetric '1'
|
||||||
```
|
```
|
||||||
|
|
||||||
## IP-Config
|
## IP-Config
|
||||||
> Command: New-NetIPAddress -InterfaceIndex [Index des Interfaces] -AddressFamily [IPv4/IPv6] -IPAddress [IP-Adress] -PrefixLength [SNM / Prefix] -DefaultGateway [IP-Adresse des Default-Gateway]
|
> Command: New-NetIPAddress -InterfaceIndex [Index des Interfaces] -AddressFamily [IPv4/IPv6] -IPAddress [IP-Adress] -PrefixLength [SNM / Prefix] -DefaultGateway [IP-Adresse des Default-Gateway]
|
||||||
```ruby
|
```ruby
|
||||||
New-NetIPAddress -InterfaceIndex 3 -AddressFamily IPv4 -IPAddress '172.16.7.100' -PrefixLength '255.255.255.0' -DefaultGateway '172.16.7.254'
|
New-NetIPAddress -InterfaceIndex 3 -AddressFamily IPv4 -IPAddress '172.16.7.100' -PrefixLength '255.255.255.0' -DefaultGateway '172.16.7.254'
|
||||||
```
|
```
|
||||||
|
|
||||||
## DNS-Config
|
## DNS-Config
|
||||||
> Command: Set-DnsClientServerAddress -InterfaceIndex [Index des Interfaces] -ServerAddresses ("[IP-Adresse primärer DNS]","[IP-Adresse sekundärer DNS]")
|
> Command: Set-DnsClientServerAddress -InterfaceIndex [Index des Interfaces] -ServerAddresses ("[IP-Adresse primärer DNS]","[IP-Adresse sekundärer DNS]")
|
||||||
```ruby
|
```ruby
|
||||||
Set-DnsClientServerAddress -InterfaceIndex '3' -ServerAddresses ('172.16.7.11','172.16.7.12')
|
Set-DnsClientServerAddress -InterfaceIndex '3' -ServerAddresses ('172.16.7.11','172.16.7.12')
|
||||||
```
|
```
|
||||||
|
|
||||||
## Set-Hostname
|
## Set-Hostname
|
||||||
> Command: Rename-Computer -NewName [Name der Maschine] -Restart -Force
|
> Command: Rename-Computer -NewName [Name der Maschine] -Restart -Force
|
||||||
```ruby
|
```ruby
|
||||||
@@ -35,8 +40,7 @@ Rename-Computer -NewName 'DC01' -Restart -Force
|
|||||||
|
|
||||||
## Remote Access
|
## Remote Access
|
||||||
Read TrustedHosts
|
Read TrustedHosts
|
||||||
> Command: Get-Item WSMan:localhost\client\TrustedHosts
|
```ps
|
||||||
```ruby
|
|
||||||
Get-Item WSMan:localhost\client\TrustedHosts
|
Get-Item WSMan:localhost\client\TrustedHosts
|
||||||
```
|
```
|
||||||
Set TrustedHost
|
Set TrustedHost
|
||||||
@@ -44,4 +48,24 @@ Set TrustedHost
|
|||||||
```ruby
|
```ruby
|
||||||
Set-Item WSMan:localhost\client\TrustedHosts –Value '172.16.7.254'
|
Set-Item WSMan:localhost\client\TrustedHosts –Value '172.16.7.254'
|
||||||
```
|
```
|
||||||
|
Activate Remote-PS
|
||||||
|
```ruby
|
||||||
|
Enable-PsRemoting
|
||||||
|
```
|
||||||
|
|
||||||
|
## Remote PS Execute
|
||||||
|
Remote befehle oder scirptblöcke ausführen
|
||||||
|
> Command: Invoke-Command –ComputerName [IP bzw. FQDN] –Credential [User] –Command {[Befehl]}
|
||||||
|
|
||||||
|
> Command: Invoke-Command –ComputerName [IP bzw. FQDN] –Credential [User] –ScriptBlock {[Befehle]}
|
||||||
|
```ruby
|
||||||
|
Invoke-Command –ComputerName [IP bzw. FQDN] –Credential [User] –Command {[Befehl]}
|
||||||
|
```
|
||||||
|
```ruby
|
||||||
|
Invoke-Command –ComputerName [IP bzw. FQDN] –Credential [User] –ScriptBlock {[Befehle]}
|
||||||
|
```
|
||||||
|
|
||||||
|
> Command:
|
||||||
|
```ruby
|
||||||
|
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user