nerdexam
Microsoft

AZ-140 · Question #109

You have an Azure Virtual Desktop deployment. You need to create a PowerShell script to sign users out of a specific session host before you perform a maintenance task. Which PowerShell module should

The correct answer is D. Az.DesktopVirtualization. The Az.DesktopVirtualization PowerShell module contains the cmdlets specific to managing Azure Virtual Desktop (AVD) resources. To sign users out of a session host, you would use Remove-AzWvdUserSession, which is part of this module. It allows you to enumerate active user session

Submitted by fernanda_arg· Apr 18, 2026Monitor and maintain an Azure Virtual Desktop infrastructure

Question

You have an Azure Virtual Desktop deployment. You need to create a PowerShell script to sign users out of a specific session host before you perform a maintenance task. Which PowerShell module should you load in the script?

Options

  • AAz.Automation
  • BAz.Compute
  • CAz.Maintenance
  • DAz.DesktopVirtualization

How the community answered

(60 responses)
  • A
    2% (1)
  • B
    8% (5)
  • C
    3% (2)
  • D
    87% (52)

Explanation

The Az.DesktopVirtualization PowerShell module contains the cmdlets specific to managing Azure Virtual Desktop (AVD) resources. To sign users out of a session host, you would use Remove-AzWvdUserSession, which is part of this module. It allows you to enumerate active user sessions on a host (Get-AzWvdUserSession) and then forcibly log them off. The other modules are unrelated to AVD session management: Az.Automation handles runbooks and automation accounts, Az.Compute manages virtual machines and disks, and Az.Maintenance handles maintenance configurations for Azure resources - none of which expose AVD session control cmdlets.

Topics

#Azure Virtual Desktop#PowerShell#Session Host Management#Maintenance Scripting

Community Discussion

No community discussion yet for this question.

Full AZ-140 Practice