web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Query on Adding New Us...
Power Apps
Suggested Answer

Query on Adding New Users to Power Platform Environments

(0) ShareShare
ReportReport
Posted on by 6
HI All,
 
I have a requirement where i need onboard 1000+ users into my Power Platform environment. Is there any way to achieve this via Programmatically(PowerShell)?
 
Regards,
SK
I have the same question (0)
  • Suggested answer
    bscarlavai33 Profile Picture
    752 Super User 2025 Season 2 on at
    Here's a good solution from another thread - https://community.powerplatform.com/forums/thread/details/?threadid=cd3bb0c2-3c56-4319-a267-f4bf29fc028f


    "Using Windows PowerShell 5.1.xxx, you can add users in bulk into any Power Platform environment. To do this, first create a CSV file with the email address of each user.

     

    Next, make sure you are using Windows PowerShell 5.1.xxx by running the following command:

    $PSVersionTable

     

    If this returns any version other than 5.1.xxx, you will need to install or switch to Windows PowerShell version 5.1.xxx before continuing.

     

    Once you've created the CSV file and confirmed that you're using Windows PowerShell 5.1.xxx, next you'll need to install the appropriate PowerApps modules by opening Windows PowerShell as an administrator and running the following commands:

    Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
    Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber

    Once these modules have been installed successfully, you can then run the following PowerShell script to add the users into the environment:

    # Add users to Power Platform environment
    $CsvPath = '.\NewUsers.csv' # Replace with relative/absolute path to your CSV file
    $PowerAppsEnvName = 'example' # Replace with your Power Platform environment name
    $PowerAppsEnvGuid = (Get-AdminPowerAppEnvironment $PowerAppsEnvName).EnvironmentName
    
    foreach($User in (Import-Csv -Path $CsvPath)) {
     $UserEmail = $User.'Email' # Replace 'Email' with the CSV column heading
    
     Write-Output "Attempting to add $($UserEmail) to $($PowerAppsEnvName)..."
    
     $UserId = (Get-AzADUser -ObjectId $UserEmail).Id
     
     try {
     Add-AdminPowerAppsSyncUser -EnvironmentName $PowerAppsEnvGuid -PrincipalObjectId $UserId
     Write-Output "$($UserEmail) added to $($PowerAppsEnvName)!"
     }
     catch {
     Write-Output "$($UserEmail) is already a member of $($PowerAppsEnvName)."
     }
    }

    This script will not only attempt to add each user into your Power Platform environment, but will also let you know the result. Once complete, all new users should now be in your Power Platform environment.

     

    Key Points Worth Noting:

    • The PowerApps modules only work with Windows PowerShell 5.1.xxx (unfortunately)
    • You must run Windows PowerShell as an administrator
    • If you see an error related to the 'AcquireToken' method, double-check that you are running Windows PowerShell as an administrator (I've made this mistake!)
    "
  • SV-14110338-0 Profile Picture
    6 on at
    Hi @bscarlavai33, Thanks for your response. I already tried this command but it doesn't give me an option to assign security roles.
     
    This command will add the users to the Env and assigning them with Environment maker role but i wanna to assign Basic User role. Any guidance on this?
     
    Thank you!
     
    Regards,
    SK

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard