Challenge - 5 Problems
SSH Remoting Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this PowerShell SSH remoting command?
You run this command in PowerShell 7+ to start an interactive session on a remote machine named 'Server01' using SSH remoting:
What will be the immediate output if the connection is successful?
Enter-PSSession -HostName Server01 -UserName AdminUserWhat will be the immediate output if the connection is successful?
PowerShell
Enter-PSSession -HostName Server01 -UserName AdminUser
Attempts:
2 left
💡 Hint
Think about what Enter-PSSession does when connecting successfully.
✗ Incorrect
Enter-PSSession starts an interactive remote session. When successful, the prompt changes to show the remote computer name, indicating you are now running commands on that machine.
💻 Command Output
intermediate2:00remaining
What error occurs when SSH remoting fails due to wrong credentials?
You try to connect to a remote machine using:
The password is incorrect. What error message will PowerShell most likely show?
Enter-PSSession -HostName Server02 -UserName WrongUserThe password is incorrect. What error message will PowerShell most likely show?
PowerShell
Enter-PSSession -HostName Server02 -UserName WrongUser
Attempts:
2 left
💡 Hint
Think about what happens when SSH credentials are wrong.
✗ Incorrect
When SSH authentication fails due to wrong credentials, the error message indicates permission denied for authentication methods.
📝 Syntax
advanced2:00remaining
Which command correctly runs a script block on a remote machine using SSH remoting?
You want to run the script block
{ Get-Process | Select-Object -First 3 } on a remote machine 'Server03' using SSH remoting. Which command is syntactically correct?Attempts:
2 left
💡 Hint
Use the correct parameter for SSH remoting in PowerShell 7+.
✗ Incorrect
For SSH remoting, Invoke-Command uses the -HostName parameter to specify the remote machine and -ScriptBlock to specify the commands to run.
🔧 Debug
advanced2:00remaining
Why does this SSH remoting command fail with 'The term 'Enter-PSSession' is not recognized'?
You run this command in PowerShell 5.1 on Windows:
and get the error:
What is the most likely cause?
Enter-PSSession -HostName Server04 -UserName AdminUserand get the error:
The term 'Enter-PSSession' is not recognized as the name of a cmdlet...What is the most likely cause?
PowerShell
Enter-PSSession -HostName Server04 -UserName AdminUser
Attempts:
2 left
💡 Hint
Check PowerShell version compatibility for SSH remoting.
✗ Incorrect
SSH-based remoting with the -HostName parameter is supported starting in PowerShell 7+. PowerShell 5.1 does not recognize this parameter.
🚀 Application
expert3:00remaining
How to run a remote command on multiple machines using SSH remoting in PowerShell 7+?
You have a list of remote servers stored in
$servers = @('ServerA', 'ServerB', 'ServerC'). You want to run Get-Service on all of them using SSH remoting and collect the results locally. Which script correctly does this?Attempts:
2 left
💡 Hint
Think about how to run commands on multiple hosts sequentially and collect output.
✗ Incorrect
Invoke-Command with -HostName accepts one hostname at a time. Using ForEach-Object to loop over the list runs the command on each server and collects output.