# Connect to remote CMD $creds = Get-Credential $targetIP = "10.83.244.221" Enter-PSSession -ComputerName $targetIP -Credential $creds # After successful connection, restart the service: powershell -command "Restart-Service TermService -Force"