how to Remove-RdsAppGroupUser if the user was already deleted from azure ad?

%3CLINGO-SUB%20id%3D%22lingo-sub-1226870%22%20slang%3D%22en-US%22%3Ehow%20to%20Remove-RdsAppGroupUser%20if%20the%20user%20was%20already%20deleted%20from%20azure%20ad%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1226870%22%20slang%3D%22en-US%22%3E%3CP%3Ewhen%20i%20try%20to%20remove%20a%20user%20name%20from%20an%20RdsAppGroup%20and%20that%20user%20has%26nbsp%3Balready%3CSPAN%3E%26nbsp%3Bbeen%20deleted%20from%20azure%20ad%2C%20i%20get%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3ERemove-RdsAppGroupUser%20%3A%20The%20specified%20UserPrincipalName%20does%20not%20exist%20in%20the%20Azure%20AD%20associated%20with%20the%20RD%20tenant.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3Ei%20don't%20have%20control%20of%20who%20is%20able%20to%20delete%20azure%20ad%20users%2C%20but%20i%20want%20to%20run%20a%20cron%20cleanup%20script%20to%20prune%20my%26nbsp%3BRdsAppGroups%20of%20users%20names%20not%20in%20selected%20security%20groups.%3C%2FP%3E%3CP%3Eif%20the%20user%20must%20exist%20in%20aad%20to%20be%20deleted%20from%20an%20appgroup%2C%20then%20deleting%20a%20user%20in%20aad%20should%20delete%20that%20user%20in%20an%20appgroup%20too%2C%20otherwise%20how%20do%20we%20keep%20appgroups%20clean%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1227190%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20Remove-RdsAppGroupUser%20if%20the%20user%20was%20already%20deleted%20from%20azure%20ad%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1227190%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22p1%22%3EI%20ran%20into%20the%20same%20issue.%26nbsp%3B%20Hope%20there%20is%20a%20way%20to%20remove%20group%20user%20without%20re-creating%20account%20in%20AD.%3C%2FP%3E%3CP%20class%3D%22p2%22%3Ethanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1231139%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20Remove-RdsAppGroupUser%20if%20the%20user%20was%20already%20deleted%20from%20azure%20ad%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1231139%22%20slang%3D%22en-US%22%3EThis%20may%20not%20be%20helpful%2C%20but%20this%20is%20how%20we%20get%20around%20it.%3CBR%20%2F%3E%3CBR%20%2F%3EWhen%20an%20employee%20is%20terminated%2C%20we%20don't%20delete%20them%20from%20AD.%20Instead%2C%20we%20move%20them%20to%20a%20%22Trash%22%20OU%20and%20strip%20them%20of%20all%20their%20AD%20rights.%20That%20way%20they%20still%20exist%20in%20AD%20(and%20thus%20can%20be%20deleted%20by%20Remove-RdsAppGroupUser)%20but%20don't%20have%20the%20ability%20to%20actually%20do%20anything%20in%20AD.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20better%20solution%2C%20of%20course%2C%20would%20be%20for%20WVD%20to%20start%20supporting%20AD%20Groups%20instead%20of%20requiring%20us%20to%20add%20users%20individually.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1306688%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20Remove-RdsAppGroupUser%20if%20the%20user%20was%20already%20deleted%20from%20azure%20ad%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1306688%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F317842%22%20target%3D%22_blank%22%3E%40FortyMegabytes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20an%20update%20on%20this%3F%26nbsp%3B%20We%20are%20running%20into%20this%20same%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERespectfully.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1306707%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20Remove-RdsAppGroupUser%20if%20the%20user%20was%20already%20deleted%20from%20azure%20ad%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1306707%22%20slang%3D%22en-US%22%3EJust%20so%20you%20know%3A%20I'm%20not%20a%20Microsoft%20guy%2C%20just%20a%20WVD%20user.%20I%20only%20commented%20about%20how%20we%20got%20around%20this%20limitation.%20The%20fact%20that%20WVD%20doesn't%20support%20AD%20groups%20is%20very%20limiting.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1310184%22%20slang%3D%22en-US%22%3ERe%3A%20how%20to%20Remove-RdsAppGroupUser%20if%20the%20user%20was%20already%20deleted%20from%20azure%20ad%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1310184%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F581158%22%20target%3D%22_blank%22%3E%40joe-miller%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20fixed%20this%20with%20a%20powershell%20script.%20The%20script%20looks%20in%20my%20onpremise%20AD%20and%20sync%20with%20powershell%20to%20App%20groups.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

when i try to remove a user name from an RdsAppGroup and that user has already been deleted from azure ad, i get:

Remove-RdsAppGroupUser : The specified UserPrincipalName does not exist in the Azure AD associated with the RD tenant.

i don't have control of who is able to delete azure ad users, but i want to run a cron cleanup script to prune my RdsAppGroups of users names not in selected security groups.

if the user must exist in aad to be deleted from an appgroup, then deleting a user in aad should delete that user in an appgroup too, otherwise how do we keep appgroups clean?

5 Replies

I ran into the same issue.  Hope there is a way to remove group user without re-creating account in AD.

thanks.

This may not be helpful, but this is how we get around it.

When an employee is terminated, we don't delete them from AD. Instead, we move them to a "Trash" OU and strip them of all their AD rights. That way they still exist in AD (and thus can be deleted by Remove-RdsAppGroupUser) but don't have the ability to actually do anything in AD.

The better solution, of course, would be for WVD to start supporting AD Groups instead of requiring us to add users individually.

@FortyMegabytes 

 

Is there an update on this?  We are running into this same issue.

 

Respectfully.

Just so you know: I'm not a Microsoft guy, just a WVD user. I only commented about how we got around this limitation. The fact that WVD doesn't support AD groups is very limiting.

@joe-miller 

 

I fixed this with a powershell script. The script looks in my onpremise AD and sync with powershell to App groups.