RE: Is there any way to add users to an environment that has no Dataverse database, programmatically or via PowerShell script?
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
}