add users script

Brass Contributor

I have to add hundreds of users from our domain to WVD. Does anyone have a script to add the users from a csv file?  I assume there is still no way of adding a group?

1 Reply

@Eric Fehn Here is a script I came up with, it added 500 names in a half hour


Import-Module Microsoft.Rdinfra.RdPowershell
Add-RdsAccount -DeploymentURL
# the csv file must have a column called UPN
$Users = Import-CSV -Path “c:\Temp\WVDUsers.CSV”
ForEach ($User in $Users){
$UPN = $User.UPN
Add-RdsAppGroupUser -TenantName "Your Tenant Name" -HostPoolName "Your Host Pool name" -AppGroupname "Your App Group" -UserPrincipalName $UPN

# Check the names with this,
Get-RdsAppgroupUser -TenantName "Your Tenant Name" -HostPoolName "Your host Pool" -AppGroupname "Your App Group"