Hello @Sig ,
Thanks for reaching out.
You must have a valid Azure subscription in order to use Azure cloud Shell (PowerShell/Bash CLI) and here are cloud shell pricing details for your reference.
Alternatively, you could either use Microsoft Graph explorer in any browser or Microsoft Graph PowerShell module which works with PowerShell 7 and later and on all platforms including Windows, macOS, and Linux. It's also compatible with Windows PowerShell 5.1 as detailed below to disable Password Expiration on Specific Accounts. Hope this helps.
Microsoft Graph PowerShell module:
--
Install Core PowerShell on Mac
Install Graph Module
Authenticate to MS Graph using Connect-MgGraph -Scopes User.ReadWrite.All
Update Password policy by using Update-MgUser -UserId {userobjectid} -PasswordPolicies DisablePasswordExpiration
Microsoft Graph explorer:
--
Login with your work account to http://aka.ms/ge with privileged user/global admin account and use beta version to make a patch HTTP call to https://graph.microsoft.com/v1.0/users/{UPN/ObjectID}
endpoint along with following value in BODY {"passwordPolicies": "DisablePasswordExpiration"}
section as shown in below example:
-----
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.