Take a look at:
Changing user password in Azure AD with MgGraph
Hello,
I'm creating script that get finds wanted service accounts in Azure AD and then changes their password. To find wanted account I'm using following line which works fine
$accounts = Get-MgUser -ConsistencyLevel eventual -Count userCount -Search 'DisplayName:SVC_Acc'
Then I would go to Foreach loop and change all theirs passwords
foreach($account in $accounts) {
$name = $account.DisplayName
$id = $account.Id
Write-Output "Account In Azure AD: $name. Changing the password now..."
}
I have now hard time finding the right command in MgGraph which can change users passwords. All I can find is the old AzureAD module which I would not want to use. So are there MgGraph cmdlet for changing user passwords?
#Set-AzureADUserPassword -ObjectId "$id" -Password $password
Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Entra | Microsoft Entra ID
A cloud-based identity and access management service for securing user authentication and resource access
Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
2 answers
Sort by: Oldest
-
Andy David - MVP 160.4K Reputation points MVP Volunteer Moderator2023-10-25T11:38:22.6566667+00:00 -
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more