Add/Change User Assignment (-UserGroups) throught PowerShell

We're running RemoteApps on WS2012. Hundreds of .rdp RemoteApps were published using PowerShell.

When I want to add additional groups through User Assigment in the GUI I get: "Cannot bind argument to paramter 'VirtualPath' because it is an empty string".

How would I do this in PowerShell, if I use the below command it doesn't add the UserGroups, it replaces the group:

Set-RDRemoteApp -Alias "rdp1" -DisplayName "rdp1" -collectionname remoteapps -connectionbroker rds.domain.local -UserGroups ADGroup1
June 19th, 2013 11:23am

Have you tried capturing the previous user group assignment (via Get-RDRemoteApp), adding your new user group to the existing list of user groups, then setting the combined list using Set-RDRemoteApp?
Free Windows Admin Tool Kit Click here and download it now
June 20th, 2013 2:58am

How would I go about setting the combined list using Set-RDRemoteApp? What would be the command to add multiple groups, users?
June 28th, 2013 12:37pm

You can pass in the list of group as an array, as documented here: http://technet.microsoft.com/en-us/library/jj215494.aspx (note that the -UserGroups parameter is documented as type String[], which means array of strings).

The object output by Get-RDRemoteApp will have a UserGroups property, which is an array of group names. You can simply capture the UserGroups property of the object that is output by Get-RDRemoteApp, add your new user group to the end of the array, then pass it back in using Set-RDRemoteApp.

Hope that helps,

Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2013 12:32pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics