Powershell Remote
Hostsystem einrichten
Enable-PSRemoting -force
cd wsman:
Set-Item WSMan:\localhost\Client\TrustedHosts <CLIENT_IP>
restart-Service winrmClientsystem
Passwort verschlüsselt hinterlegen
Read-Host -AsSecureString | ConvertFrom-SecureString | Out-File C:\Password.txtCredential-Variable erzeugen
$password = type C:\Password.txt | ConvertTo-SecureString
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist "Administrator",$passwordBefehl ausführen
invoke-command <HOSTSYSTEM_IP> -Credential $cred -scriptblock {systeminfo}Oder eine interaktive Remote Shell starten:
enter-PSSession <HOSTSYSTEM_IP> -Credential $credZuletzt aktualisiert am