0

I need to create a test to prove that the 5000 list item limit can be exceeded. More specifically Users. I have en Excel spreadsheet that contains 5002 users. I don't need the trivial data to be included, just name and work email. With CSV files, the limit is 250 and I cannot add the work email to it. I have looked at some powershell scripts but with my lack of experience with it, I can't seem to get it right.

So to be clear the question is

(How)Can I import 5002 users with a custom work email address?

EDIT: Up till now I've tried:

Looking at a console app but UserProfiles in SPO are read only when accessing them via CSOM

Powershell scripts so far are all for SP2010 or SP2013 and don't work for online

4
  • Are you talking about the 5000 item list throttle or creating 5002 User Profiles? Commented Nov 7, 2014 at 14:42
  • I want to add 5002 user profiles
    – Scubacode
    Commented Nov 9, 2014 at 14:14
  • OK, the 5000 item limit applies to list items, not User Profiles. There are some very large companies on SPO that have tens of thousands of users. The next question is what do you mean by "custom" work email address. Are the addresses part of your registered domain? Commented Nov 10, 2014 at 13:34
  • Ok, so there is in fact no limit then? Great news, but unfortunately I still have to prove it by adding the >5001 users. I am testing so I have a O365 trial, I don't have my own domain. I currently want the users email address to simply be a gmail address, but the only place that this is allowed is in the Work Email field(that I know of).
    – Scubacode
    Commented Nov 11, 2014 at 9:41

1 Answer 1

0

The profiles are based on your Azure AD Users so you have to start there. The username has to be part of the registered domain. Like [email protected] if you are not using a custom domain, if you use a custom domain then use that.

Create a CSV file with the columns necessary (listed below in the loop). Create new users with MSOL PowerShell. After establishing a connection use:

$pathtofile = filepath to CSV file

import-csv $pathtofile | foreach { 
   New-Msoluser -userPrincipalName $_.UserPrincipalName -displayname $_.displayname -firstname $_.firstname -lastname $_.lastname -password $_.password 
}

Once you have the user accounts created the SPO User Profile Service will import them.

7
  • I'm sorry but I don't see how this answers my question. I know that the user name must be [email protected] but for the alternate email address it also only accepts tenant.onmicrosoft.com unless I have another registered domain, which gmail is not my domain. Work email accepts the gmail.com address. Also, to my knowledge, the New-MsolUser cmdlet only does one user at a time and does not accept the WorkEmail parameter
    – Scubacode
    Commented Nov 12, 2014 at 10:52
  • Sorry, I assumed you knew how to run a loop in PowerShell. Do you need me to show you? I am lost on why you need work email. Commented Nov 12, 2014 at 12:41
  • Up till now I couldn't find anything to loop the above command, although I was looking for "loop through CSV/ Excel list of users", which is where I have my test users. The work email is for testing purposes, it is the only field that accepts gmail.com and doesn't insist on the tenant.onmicrosoft.com - I'm using gmail with aliases so all users email come to one inbox but addressed to different people. I find it easier to oversee it that way.
    – Scubacode
    Commented Nov 12, 2014 at 13:00
  • OK, but work email is on the user profile, which is created after you create the users in Azure AD. Once you create the users and then create the user profiles, isn't your test complete? You can update the user profiles WorkEmail property after you have user profiles. Commented Nov 12, 2014 at 15:06
  • 1
    OK, last comment. User Account Creation and User Profile Creation are not the same thing. You have to Create the user, then the profile. Then update the profile. You cannot do what you want in "one step". Commented Nov 13, 2014 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.