add users script

%3CLINGO-SUB%20id%3D%22lingo-sub-1110899%22%20slang%3D%22en-US%22%3Eadd%20users%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1110899%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20to%20add%20hundreds%20of%20users%20from%20our%20domain%20to%20WVD.%20Does%20anyone%20have%20a%20script%20to%20add%20the%20users%20from%20a%20csv%20file%3F%26nbsp%3B%20I%20assume%20there%20is%20still%20no%20way%20of%20adding%20a%20group%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1111403%22%20slang%3D%22en-US%22%3ERe%3A%20add%20users%20script%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1111403%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F134584%22%20target%3D%22_blank%22%3E%40Eric%20Fehn%3C%2FA%3E%26nbsp%3BHere%20is%20a%20script%20I%20came%20up%20with%2C%20it%20added%20500%20names%20in%20a%20half%20hour%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EImport-Module%20Microsoft.Rdinfra.RdPowershell%3CBR%20%2F%3EAdd-RdsAccount%20-DeploymentURL%20%3CA%20href%3D%22https%3A%2F%2Frdbroker.wvd.microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Frdbroker.wvd.microsoft.com%3C%2FA%3E%3CBR%20%2F%3E%23%20the%20csv%20file%20must%20have%20a%20column%20called%20UPN%3CBR%20%2F%3E%24Users%20%3D%20Import-CSV%20-Path%20%E2%80%9Cc%3A%5CTemp%5CWVDUsers.CSV%E2%80%9D%3CBR%20%2F%3EForEach%20(%24User%20in%20%24Users)%7B%3CBR%20%2F%3E%24UPN%20%3D%20%24User.UPN%3CBR%20%2F%3EAdd-RdsAppGroupUser%20-TenantName%20%22Your%20Tenant%20Name%22%20-HostPoolName%20%22Your%20Host%20Pool%20name%22%20-AppGroupname%20%22Your%20App%20Group%22%20-UserPrincipalName%20%24UPN%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%23%20Check%20the%20names%20with%20this%2C%3CBR%20%2F%3EGet-RdsAppgroupUser%20-TenantName%20%22Your%20Tenant%20Name%22%20-HostPoolName%20%22Your%20host%20Pool%22%20-AppGroupname%20%22Your%20App%20Group%22%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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
Highlighted

@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 https://rdbroker.wvd.microsoft.com
# 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"

Related Conversations
I want users to add New lines items in response
osman_124 in Microsoft Forms on
1 Replies
Intune Scripting
jesusleon in Microsoft Intune on
2 Replies
RDS Collections Not Showing
Tim Hunter in Windows Server for IT Pro on
4 Replies
SharePoint Groups: Help Me Understand
smithme in SharePoint Developer on
2 Replies