Announcements
I want to add an E5 license office 365 users into one of our D365 Database from Power platform. I can see, we can add the user from Environment itself by using this link:
https://docs.microsoft.com/en-us/power-platform/admin/add-users-to-environment
But, I need to perform the same operation either using a C# code or PowerShell script as I would like to add the users in bulk. Any help would much appreciated.
Hey Team!
You have this command: docs.microsoft.com/.../add-adminpowerappssyncuser. It allows user synchronization and requires 2 parameters: The environmentID and the UserObjectID.
A sample script would be something like this:
Connect-AzureAD // This will prompt credentials
$User =Get-AzureADuser // This creates an object with all AzureAD Users. You can do some tuning to retrieve users form a specific ADGroup
$Environment = Get-AdminPowerAppEnvironment //This will prompt for credentials
//Change this either using a For to do this for all environments, or just to select one specific
$env=$Environment[1]
foreach($u in $User)
{
Add-AdminPowerAppsSyncUser -EnvironmentName env.Name -PrincipalObjectId $u.ObjectId
}
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156