简体   繁体   中英

Create user in office 365 programatically

I want to create user programtically in order to achieve the following functionality:

Once user is created I need to add more information related to that user in custom list.

Anyone has an idea about it?

You can use Powershell for this. How to create one or more O365 users by using PowerShell: https://technet.microsoft.com/library/mt628067.aspx

In the following link they explain how to push items to a Sharepoint list. https://camerondwyer.wordpress.com/2014/05/09/sharepoint-powershell-how-to-create-sharepoint-list-items-in-root-and-in-folders-for-loadperformance-testing/

I hope this helps you.

You could also create a O365 user using Microsoft Graph API ,you could make a post request to create user like:

POST https://graph.microsoft.com/v1.0/users
Content-type: application/json

Below is the request body for your reference:

{
  "accountEnabled": true,
  "displayName":"displayName",
  "mailNickname": "mailNickname",
  "passwordProfile": {
      "password": "Your password"
            },
  "userPrincipalName": "displayName@yourtenant.com",

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM