Hi @Mutaz Abdelmajeed ,
if your csv looks like this (for example Sample7users.csv
):
CSVfileCopy
upn,office
"testpeter@test.net","Home Office"
"testpaul@test.net","Room 234"
this PowerShell script should work (tested):
Import-Csv ".\Sample7users.csv" -Delimiter "," -Encoding UTF8 | ForEach-Object {
$user = Get-AzureADUser -Filter "userPrincipalName eq '$($_.upn)'"
Set-AzureADUser -ObjectId $user.ObjectID -PhysicalDeliveryOfficeName "$($_.office)"
}
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten