Categories: Thủ Thuật Mới

Review How do I reset Windows Virtual Desktop? 2022

Mục lục bài viết

Mẹo Hướng dẫn How do I reset Windows Virtual Desktop? Chi Tiết

Update: 2022-03-15 17:09:11,Quý khách Cần tương hỗ về How do I reset Windows Virtual Desktop?. Bạn trọn vẹn có thể lại phản hồi ở phía dưới để Admin được tương hỗ.


I have found that the session hosts often end up reporting a status of ‘Needs Assistance’. This can be caused by updates having been applied that require a reboot to complete…and other unknown issues. Often a reboot will sort them out. So I developed a simple script to assist.

The following script will allow you to specifiy the only the VM’s in a Host Pool and only those that ‘Need Assistance’ and that have no active sessions on too….or not!

Save the full script to a file called RebootHosts.ps1

#———————————————————[Script Parameters]——————————————————
[CmdletBinding()]
Param (
#Script parameters go here
[Parameter(mandatory = $true)]
[string]$HostPoolName,

[Parameter(mandatory = $true)]
[string]$HostPoolResourceGroupName,

[Parameter(mandatory = $false)]
[switch]$SkipIfActiveSessions,

[Parameter(mandatory = $false)]
[switch]$OnlyDoIfNeedsAssistance
)

#———————————————————[Initialisations]——————————————————–

#Set Error kích hoạt to Silently Continue
$ErrorActionPreference=”SilentlyContinue”

#———————————————————-[Declarations]———————————————————-

#Any Global Declarations go here

#———————————————————–[Functions]————————————————————

#———————————————————–[Execution]————————————————————

Write-Output “Starting to Enable Boot Diagnostics for VMs in Host Pool $HostPoolName …”
if ($OnlyDoIfNeedsAttention)
Write-Output “!! Only hosts flagged as ‘Needs Assistance’ will be rebooted !!”

if ($SkipIfActiveSessions)
Write-Output “!! Only hosts with zero sessions will be rebooted !!”

$rebooted = 0
$skippedSessions = 0
$skippedOK = 0
$shutdown = 0

$sessionHosts = Get-AzWvdSessionHost -ResourceGroupName $HostPoolResourceGroupName -HostPoolName $HostPoolName
foreach ($sh in $sessionHosts)

# Name is in the format ‘host-pool-name/vmname.domainfqdn’ so need to split the last part
$VMName = $sh.Name.Split(“thattruyen/”)[1]
$VMName = $VMName.Split(“.”)[0]

$Session = $sh.Session
$Status = $sh.Status
$UpdateState = $sh.UpdateState
$UpdateErrorMessage = $sh.UpdateErrorMessage

Write-output “=== Starting Reboot for VM: $VMName”
Write-output “Session: $Session”
Write-output “Status: $Status”
Write-output “UpdateState: $UpdateState”
Write-output “UpdateErrorMessage: $UpdateErrorMessage”

if ($Status -ne “Unavailable”)
if ($Status -ne “NeedsAssistance” -and $OnlyDoIfNeedsAssistance )
$skippedOK += 1
Write-output “!! The VM ‘$VMName’ is not in ‘Needs Assistance’ state, so will NOT be rebooted. !!”

elseif ($SkipIfActiveSessions -and $Session -gt 0)
$skippeSessions += 1
Write-output “!! The VM ‘$VMName’ has $Session session(s), so will NOT be rebooted. !!”

else
$rebooted += 1
Restart-AzVM -ResourceGroupName $HostPoolResourceGroupName -Name $VMName
Write-output “=== Reboot initiated for VM: $VMName”

else
$shutdown += 1
Write-output “!! The VM ‘$VMName’ must be started in order to reboot it. !!”

Write-Output “”
Write-Output “============== Completed ==========================”
Write-Output “Skipped due Not needing attention: $skippedOK”
Write-Output “Skipped due to active sessions: $skippedSessions”
Write-Output “Host not started: $shutdown”
Write-Output “Rebooted: $rebooted”
Write-Output “===================================================”

You will need to log in to Azure and select your subscription in the normal way using:

Login-AzAccount
Select-AzSubscription “my-subscription”

You can then simply run the script as follows:

.RebootHosts.ps1 -HostPoolName “my-host-pool” -HostPoolResourceGroupName “my-host-pool-rg” -OnlyDoIfNeedsAssistance -SkipIfActiveSessions

The following section outlines how to reset a saved desktop in the PCoIP Client. You can reset to a virtual desktop by following the steps outlined below:

  • Click the configure button and select Edit from the popup menu.
  • Click NEXT on the initial saved connection screen.
  • Enter your access credentials and click SAVE.
  • Click the configure button and select Reset. If the Reset option is not available, then this feature is not supported by the Connection Manager.
  • You can select a Fusion command to reset a virtual machine, much as you would press the reset button on a physical computer when it becomes unresponsive.

    Caution: Resetting the virtual machine can cause data loss.

    • Press the Option key and click , the hard power option, to reset the operating system in your virtual machine.

    If the remote desktop operating system stops responding, you might need to restart a remote desktop. Restarting a remote desktop is similar to using the Windows operating system restart command. The remote desktop operating system usually prompts you to save any unsaved data before it restarts.

    You can restart a remote desktop only if a Horizon administrator has enabled the restart feature for the remote desktop and the remote desktop is powered on. You can restart only one remote desktop at a time.

    For information about enabling the desktop restart feature, see the Setting Up Virtual Desktops in Horizon or Setting Up Published Desktops and Applications in Horizon document.

    • Use the Restart Desktop command. Option kích hoạt From within the remote desktop Select from the menu bar. From the desktop selector window Right-click the remote desktop icon and select Restart Desktop.

      Horizon Client prompts you to confirm the restart action.

    The operating system in the remote desktop restarts and the client disconnects and logs off from the remote desktop.

    Wait an appropriate amount of time for the system to restart before you attempt to reconnect to the remote desktop.

    If restarting the remote desktop does not solve the problem, you might need to reset the remote desktop. See Reset Remote Desktops or Published Applications.

    Reply
    1
    0
    Chia sẻ

    đoạn Clip hướng dẫn Share Link Tải How do I reset Windows Virtual Desktop? ?

    – Một số Keyword tìm kiếm nhiều : ” Video full hướng dẫn How do I reset Windows Virtual Desktop? tiên tiến và phát triển nhất , Share Link Down How do I reset Windows Virtual Desktop? “.

    Thảo Luận vướng mắc về How do I reset Windows Virtual Desktop?

    You trọn vẹn có thể để lại phản hồi nếu gặp yếu tố chưa hiểu nghen.
    #reset #Windows #Virtual #Desktop How do I reset Windows Virtual Desktop?

    Phương Bách

    Published by
    Phương Bách