May 03 2021
06:45 PM
- last edited on
Feb 07 2023
08:08 PM
by
TechCommunityAP
May 03 2021
06:45 PM
- last edited on
Feb 07 2023
08:08 PM
by
TechCommunityAP
Hi, I want to ask. If I want to bulk change user attributes with powershell azureAD by importing a Csv file, what is the max number of user attributes that can be changed with a single script from a single csv file?
Is there a limit to the max users in a single csv file that can be processed?
Here is what I am planning to do:
1. First script.
Import-CSV "C:\UserAttributes.csv" | Foreach { Set-AzureADUser -ObjectID $_.UserPrincipalName -Department $_.Department -JobTitle $_.Title -Surname $_.LastName -GivenName $_.FirstName -DisplayName $_.DisplayName }
With this script I want to change the users' department, job title, firstname, lastname and displayname.
2. Second script
Import-CSV "C:\UserAttributes.csv" | ForEach-Object {
$CPW = $_.Password
$CPWS = ConvertTo-SecureString -String $CPW -AsPlainText -Force
Set-AzureADUserPassword -ObjectId $_.UserPrincipalName -Password $CPWS -EnforceChangePasswordPolicy:$false }
With this script I want to re-assign new password to users.
3. Thrid script
Import-CSV "C:\UserAttributes.csv" | Foreach { Set-AzureADUser -ObjectID $_.UserPrincipalName -UserPrincipalName $_.UPN }
With this script I want to change the users' email.
The 3 scripts above are tested and run perfectly with 10 test users that I created.
So, back to my question. Is there any limit to the max number of users in one csv file that can be processed with every single script above?
Just to let you know, there are 620s users in my department and around 7000 users in the whole organisation. If I can do it at once with a single csv file that will be very convenient.
Thank you
May 04 2021 11:59 PM
SolutionMay 05 2021 12:21 AM
May 04 2021 11:59 PM
Solution