POWERSHELL SUR LINUX
INSTALLATION
apt upgrade && apt full-upgrade && apt install curl apt-transport-https gnupg2 -y
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-bullseye-prod bullseye main" > /etc/apt/sources.list.d/microsoft.list'
apt update && apt install -y powershell gss-ntlmssp
SE CONNECTER À DISTANCE EN POWERSHELL
- Installation des modules nécessaires en BASH
pwsh -Command 'Install-Module -Name PSWSMan' --> Redémarrer une session - Installation des module nécessaire en POWERSHELL
Install-Module -Name PowerShellGet Install-Module -Name PSWSMan - Connexion sur un WINDOWS SERVER
PS /root> Enter-PSSession -ComputerName 172.16.0.3 -Authentication Negotiate -Credential megaproduction\administrator PowerShell credential request Enter your credentials. Password for user megaproduction\administrator: ******** [172.16.0.3]: PS C:\Users\Administrator\Documents> hostname ads-front-01
Il faudra au préalable avoir lancé ces commande sur le serveur distant:
Enable-PSRemoting -Force