Open
Description
Hi,
When trying to set BusinessPhones or MobilePhone values to $null, like so:
Update-MgUser -UserId $MgUser.UserPrincipalName -MobilePhone $null -BusinessPhones $null
It throws an error:
Update-MgUser_UpdateExpanded: Invalid value specified for property 'mobilePhone' of resource 'User'.
I've fixed this for now by using an alternative command:
Invoke-GraphRequest -Method PATCH -Uri "https://graph.microsoft.com/v1.0/Users/$($MgUser.UserPrincipalName)" -Body '{"businessPhones": [],"mobilePhone": null}'
Hope this helps someone else in a similar need and more so, the Update-MgUser cmdlet is fixed.
Thanks,
AB#10944