MicrosoftLearning / AZ-800-Administering-Windows-Server-Hybrid-Core-Infrastructure

AZ-800
https://microsoftlearning.github.io/AZ-800-Administering-Windows-Server-Hybrid-Core-Infrastructure/
MIT License
81 stars 88 forks source link

Lab 04 Ex 3: `Deploy-WACAzVM.ps1` fails "no supported WSMan client library was found" #63

Closed SkillableMG closed 1 month ago

SkillableMG commented 9 months ago

When running the Deploy-WACAzVM.ps1 script in Cloud Shell per the above-referenced task, the below error message is encountered, and the WAC install script is not run on the VM.

Invoke-Command: This parameter set requires WSMan, and no supported WSMan client library was found. WSMan is either not installed or unavailable for this system.
Write-Error: Ending installation of WAC on virtual machine az800l04-vmwac.

The error message appears to originate from the below script lines:

https://github.com/MicrosoftLearning/AZ-800-Administering-Windows-Server-Hybrid-Core-Infrastructure/blob/7640a5332295a1b560af626d5c31dc9d32b8b12f/Allfiles/Labfiles/Lab04/Deploy-WACAzVM.ps1#L373-L381

The Invoke-Command error line can also be replicated by running a simpler Invoke-AzVMCommand command (example below), with the az800l04-vmwac VM already running.

$cred = Get-Credential # Student
Invoke-AzVMCommand -ResourceGroupName 'AZ800-L0401-RG' -Name 'az800l04-vmwac' -ScriptBlock { Get-Process } -Credential $cred

Per PSWSMan install instructions, a sudo pwsh -Command 'Install-WSMan' command is required after installing the module with Install-Module. Testing this command in Cloud Shell is not possible as sudo privileges are not available. If this command is required to make WSMan available, that raises the question of why no errors were previously observed in its absence.

https://www.powershellgallery.com/packages/PSWSMan/2.3.1 https://github.com/jborean93/omi#installing

No specific workaround has been determined at this time. This issue prevents completion of Lab 04.

Repro steps:

  1. Perform prerequisite activities for Ex 3 (Exercise 1?)
  2. Follow steps for the above-referenced Ex 3 Task 1.
  3. Run additional Invoke-AzVMCommand if desired.

Instructions permalink: https://github.com/MicrosoftLearning/AZ-800-Administering-Windows-Server-Hybrid-Core-Infrastructure/blob/7640a5332295a1b560af626d5c31dc9d32b8b12f/Instructions/Labs/LAB_AK_04_Using_Windows_Admin_Center_in_hybrid_scenarios.md

Relevant screenshots

image

awillslo commented 8 months ago

Though the script fails, I created a work-around. It does require a manual install of WAC on the az800;04-vmwac, but in the real world, students would not have a script like in this lab. So, I don't mind students putting in a little extra effort to get the lab finished. I tested these steps a second time, before posting them here. Use at your discretion.

On SEA-ADM1:

In the Azure portal, search for Virtual Machines Click the link for az800l04-vmwac On the left under Settings, click Connect Click Download RDP file Click Open File Click Connect in the warning pop up window Type is Pa55w.rd1234 for the password and click OK Click Yes

Once logged in: Click NO in the Network blue pane Close any open windows Click the Start button and type Edge, click Microsoft edge Complete the Edge setup wizard In the Edge url field, type Windows Admin Center Click the first returned link Click Download Windows Admin center button Click Open file Close Edge Check the "I accept these terms" box, click Next 5 times Click Install Click Finish Right Click Start > Shut down or sign out > Disconnect

Pick up on Task 2: Review results of the script provisioning Step 1: Locate the vm named az800l04-vmwac in the Azure portal Copy the DNS name on the Overview page Open a new browser tab Right click the URL field and choose paste Put https:// in the front of the url and then press Enter

Continue with Ex 4, Task 1 step 2 in the lab steps

SkillableMG commented 8 months ago

Thank you for sending the workaround, which should be useful for any affected learners.

To corroborate the absence of other issues outside of the script error in Cloud Shell, I also previously observed a successful WAC install via connecting to the VM via RDP and running a script file containing the MSI install script as extracted from the Deploy-WACAzVM.ps1 script.

Have any plans been determined so far to update the script and/or instructions to resolve the issue?