• View Communities
    • Citrix Developer Network
      The place for unfiltered straight talk on Citrix products. Blogs, code downloads, best practices, APIs, and more can all be found here.
    • Citrix Ready Community Verified
      Does it work with Citrix? Application compatibility questions are a thing of the past with the new Citrix Community Verified site.
    • Blogs
      Learn the latest from the Citrix employees who are building application delivery infrastructure technologies.
    • Blogosphere
      The Citrix Blogosphere is a window into the thousands of conversations taking place about Citrix and Application Delivery.
  •  Sign In
XenDesktop Developer Network

Logging off a user from all current sessions, after sending a warning message

This command displays a warning message to all users whose names start with "fred" before logging them off. Note that in this example there is specified time period (10 seconds) before logoff occurs.

Get-XdVirtualDesktop |
where { $($_.AssignedUserName -match 'fred')
-and $( $_.PowerState -eq 'Suspended') } | Resume-XdVirtualDesktop

If the VMs were shut down as opposed to suspended, use the following command to restart those VMs:

Get-XdVirtualDesktop |
where { $($_.AssignedUserName -match 'fred') } | `
foreach { switch ($_.PowerState) { 'Suspended' { Resume-XdVirtualDesktop $_ }
'Off' { Start- XdVirtualDesktop $_ } } }

Tags

vdi vdi Delete
xendesktop powershell api xendesktop powershell api Delete
xendesktop sdk xendesktop sdk Delete
Enter tags to add to this page:
Please wait 
Looking for a tag? Just start typing.

Add Comment

Related Links