Ares Chen @ 2020-2-8
-
Install .NET Core runtime 3.1
-
Register the Application in Azure Portal
- Navigate to the app registration portal with your Office 365 Global administrator account https://portal.azure.com/?l=en.en-us#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps
- Click the "New Registeration" button
- Type the app name (for example : uploaduserphotos)and leave all other settings by default, then click the "Register" button
- Copy and save the clientId and tenantId
- Navigate to the "Certificates & secrets" page and click the "New client secret" button
- Create a default client secret as below
- Copy the secret information immediately because you don't have another chance to see it if you refresh the page or goto another page
- Navigate to the "API permissions" page, add an application permission under Microsoft Graph category, the permission is "User.ReadWrite.All" , click the "Add permissions" button
- Grant the permission as admin
- Now, you've registered an application to run, and you've copied three information including the clientId, tenantId, client secret.
-
Prepare all the photos into a single directory, please keep each file small than 4MB, and named with the employee's email address and extension with jpg. for example
[email protected]
- You can download the execuable here : uploadalluserphoto.zip
- Unzip the file to your local drive, start a command shell, change the current directory to the folder, then run a command as below
.\updatealluserphoto.exe -i yourclientId -s yourclientsecret -t yourtenantid -d photodirectory
Please change these four parameter to your information
- Relax and enjoy!
- If you want to customize the application, please feel free to
fork
the repository and do you change, build and run whatever you want. - If you have great idea to improve this program, you are welcome to send the
pull request
to me, and I will check the code, and hopefully your code can merge to the repository.
Email : [email protected]