I found the solution for it
first you download a CSV file of every User in your tenant.
Get-MGuser -All -Property UserPrincipalName |
Select-Object UserprincipalName |
ConvertTo-Csv -NoTypeInformation |
Out-File /Users/username/Downloads/UPN.csv
after you have that file you use it to scope all users in your tenant and apply the change
Import-Csv “/Users/username/Downloads/UPN.csv” | ForEach-Object{
$UserPrincipalName = $_.UserPrincipalName
Update-MgUser -UserId $UserPrincipalName -PasswordPolicies DisablePasswordExpiration }