![]() ![]() $User = New-ScheduledTaskPrincipal System $Time = New-ScheduledTaskTrigger -At 23:59 -Once My eventual workaround was to create a temporary scheduled task that would add OpenSSH.Server as SYSTEM. This is apparently a known limitation with feature-on-demand installation. Turns out the Add-WindowsCapability command will not work in a remoting session. I figured all I needed to do was run the script using Invoke-Command. Yes, you could use a third-party tool like psexec.exe or something like Desired State Configuration, but I want to stick with tools and skills you likely already have.Īs I was working on this I had a simple PowerShell script that ran the steps I just showed you. I will need to use traditional PowerShell remoting. I have some Windows 10 VMs that I’d like to connect to with ssh. Remote Installationīut I want to do this remotely. ![]() It wouldn’t take much to assemble a simple PowerShell script to run these commands interactively. Using ssh to connect to localhost now gives me a Windows PowerShell session. The change should be immediate and not require restarting the sshd service. Set-ItemProperty -Path $regPath -Name $regProperty -Value $regValue $regValue = (Get-Command powershell.exe).source You can modify the registry on your computer. Note that I am not talking about PowerShell remoting over ssh yet. But maybe you’d like a different shell when connecting over ssh. If you’re setup is like mine, you’ll end up in a CMD prompt. You might get prompted about accepting keys and for a password. One thing I have learned about ssh, especially if you want to use it with PowerShell remoting, and that is to verify ssh works outside of PowerShell. Set-Service -Name sshd -StartupType Automatic I want to configure the service to start and start automatically. This will setup the sshd service which is not running and configured to start manually. I’m using Get-WindowsCapability with a wildcard just in case the version number changes at some point. Get-WindowsCapability -online -name rver* | Add-WindowsCapability -online I’m running these commands interactively. The PowerShell commands for installing the OpenSSH Server component in Windows 10 are pretty simple. ManageEngine ADManager Plus - Download Free Trial Manual Setup Manage and Report Active Directory, Exchange and Microsoft 365 with ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |