Wanting to import service accounts from a spreadsheet and set to password never expire

Viewed 50
Import-CSV "C:\Users\$env:username\Desktop\azureadusers.csv" | ForEach {
    Set-AzureADUser -ObjectId $user.UserPrincipalName -PasswordPolicies DisablePasswordExpiration
}

The error I get is: Set-AzureADUser : Cannot bind argument to parameter 'ObjectId' because it is null

0 Answers
Related