Workspace-Guru

Manage-WVD

May 31st, 2019
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ### Paramters
  2. $tenantname = "" # Can be found with get-rdstenant
  3. $hostpoolname = "" # can be found with get-rdshostpool -tenantname $tenantname
  4.  
  5. ### Check or install Module
  6. $module = get-module -Name Microsoft.RDInfra.RDPowerShell
  7.  
  8. if(!$module) {
  9. Install-Module -Name Microsoft.RDInfra.RDPowerShell -scope CurrentUser -Confirm:$false -force
  10. }
  11.  
  12. ### Import Module
  13. Import-Module -Name Microsoft.RDInfra.RDPowerShell
  14.  
  15.  
  16. ### Sign into WVD Tenant
  17. Add-RdsAccount -DeploymentUrl "https://rdbroker.wvd.microsoft.com"
  18.  
  19. ### Get all current users
  20. get-rdsusersession -TenantName $tenantname -HostPoolName $hostpoolname
  21.  
  22. ### Send message to user
  23. Send-RdsUserSessionMessage -TenantName $tenantname -HostPoolName $hostpoolname -SessionHostName $SessionHostName -SessionId $SessionId -MessageTitle "Message from Administrator" -MessageBody "Message"
  24.  
  25. ### logoff user
  26. Invoke-RdsUserSessionLogoff -TenantName $tenantname -HostPoolName $hostpoolname -SessionHostName $SessionHostName -SessionId $SessionId -NoUserPrompt
  27.  
  28. ### Add User to App Group
  29. Add-RdsAppGroupUser -TenantName $tenantname -HostPoolName $hostpoolname -appgroupname "App group name" -UserPrincipalName "UPN"
  30.  
  31. ### New RDS App Group
  32. New-RdsAppGroup -TenantName $tenantname -HostPoolName $hostpoolname -Name "App group name"
  33.  
  34. ### Search start menu for apps
  35. Get-RdsStartMenuApp -TenantName $tenantname -HostPoolName $hostpoolname -appgroupname "App group name"
  36.  
  37. ### New App
  38. New-RdsRemoteApp -TenantName $tenantname -HostPoolName $hostpoolname -appgroupname "App group name" -Name "App friendly name" -AppAlias "App alias"
  39.  
  40. ### Remove App Group
  41. Remove-RdsAppGroup -TenantName $tenantname -HostPoolName $hostpoolname -Name "App group name"
  42.  
  43. ### Remove user from app group
  44. Remove-RdsAppGroupUser -TenantName $tenantname -HostPoolName $hostpoolname -AppGroupName "App group name" -UserPrincipalName "UPN"
  45.  
  46. ### Remove RDS app
  47. Remove-RdsRemoteApp -TenantName $tenantname -HostPoolName $hostpoolname -AppGroupName "App group name" -Name "AppName"
Advertisement
Add Comment
Please, Sign In to add comment