Note that this works only if you are using Entra ID user accounts which has been sourced from an Active Directory domain. Cloud only accounts are not supported
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin