Microsoft Excel
--
Questions
--
Followers
Top Experts
User Photo Bulk Upload
I am new to Powershell Scripting and Office365.
What I have is a pure cloud based solution, not hybrid and what I am looking for is an addition to this script that will bulk upload user photographs to their online profile. As I have roughly 500 accounts to do I would like to this through a CSV file.
Thanks in Advance
Script
$userName = 'name'
$msolcred = New-Object System.Management.Automati on.PSCrede ntial($use rName)
Get-MsolAccountSku
Get-MsolUser | Sort-Object -property DisplayName |Format-Table -AutoSize
$userfile = “c:\bulkuserupload.csv”
Import-Csv -Path $userfile | ForEach-Object {
New-MsolUser `
-FirstName $_.FirstName `
-LastName $_.LastName `
-UserPrincipalName $_.UserPrincipalName `
-preferredLanguage $_.PreferredLanguage `
-DisplayName $_.DisplayName `
-LicenseAssignment $_.AccountSkuId `
-UsageLocation $_.UsageLocation `
-Title $_.JobTitle `
-Department $_.Department `
-StreetAddress $_.StreetAddress `
-City $_.City `
-State $_.State `
-Country $_.Country `
-PostalCode $_.PostalCode `
-PhoneNumber $_.PhoneNumber `
-Office $_.Office `
-MobilePhone $_.MobilePhone `
-Manager $_.Manager `
-AlternateEmailAddresses $_.AlternateEmailAddresses `
-Password “*******”
} | Export-Csv -Path C:\Provisioned_users.csv -Append
write-host “Updated users”
Get-MsolUser | Sort-Object -property DisplayName |Format-Table -AutoSize
What I have is a pure cloud based solution, not hybrid and what I am looking for is an addition to this script that will bulk upload user photographs to their online profile. As I have roughly 500 accounts to do I would like to this through a CSV file.
Thanks in Advance
Script
$userName = 'name'
$msolcred = New-Object System.Management.Automati
Get-MsolAccountSku
Get-MsolUser | Sort-Object -property DisplayName |Format-Table -AutoSize
$userfile = “c:\bulkuserupload.csv”
Import-Csv -Path $userfile | ForEach-Object {
New-MsolUser `
-FirstName $_.FirstName `
-LastName $_.LastName `
-UserPrincipalName $_.UserPrincipalName `
-preferredLanguage $_.PreferredLanguage `
-DisplayName $_.DisplayName `
-LicenseAssignment $_.AccountSkuId `
-UsageLocation $_.UsageLocation `
-Title $_.JobTitle `
-Department $_.Department `
-StreetAddress $_.StreetAddress `
-City $_.City `
-State $_.State `
-Country $_.Country `
-PostalCode $_.PostalCode `
-PhoneNumber $_.PhoneNumber `
-Office $_.Office `
-MobilePhone $_.MobilePhone `
-Manager $_.Manager `
-AlternateEmailAddresses $_.AlternateEmailAddresses
-Password “*******”
} | Export-Csv -Path C:\Provisioned_users.csv -Append
write-host “Updated users”
Get-MsolUser | Sort-Object -property DisplayName |Format-Table -AutoSize
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
ASKER CERTIFIED SOLUTION
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Thank you very much for the helpful answer. Looks like fun....






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Microsoft Excel
--
Questions
--
Followers
Top Experts
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.