
In CRM Online, which runs on this "Power Platform", er, platform, how the heck do you manage roles to user/groups programmatically? (Permissions aren't the issue, I can do it via the Power Platform GUI or within CRM itself.)
Powershell is preferred but the `Microsoft.PowerApps.Administration.PowerShell` doesn't seem to support it. (And so far seems really badly written/incomplete)
I've tried using the PowerPlatform CLI, up to and including registering a service principal, (which is added to the CRM environment), but
give the error
Hey!
I have 2 different approaches for this.
1: Using the Microsoft.PowerApps.Administration.Powershell as you've stated. The list of available cmdlets is on learn.microsoft.com/.../. If you want to create a user, the command would be "add-adminpowerappssyncuser". However, please note that if the environment has a database, you can synchronize the user (which will bring the data from AzureAD into the environment) but there's no command to assign a security role to the user. On this post, you have a nice powershell example: community.dynamics.com/.../force-sync-users-using-powershell
2: There's a Github repository from Sean McNellis, https://github.com/seanmcne. there you have "microsoft.Xrm.Data.Powershell" module that you can deploy, and Microsoft.Xrm.Data.Powershell.Samples. On the latest, you have a folder with "user operations", that has an interesting "addCrmUsersfromOu.ps1", or "AddCrmUsersfromCSV.ps1"
Regards,