Resetting multifactor authentication
The following code sample resets all of the user's authenticator apps activated in Adaxes web interface and password self-service.
Import-Module Adaxes
# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly("localhost")
# Bind to the user.
$userDN = "CN=John Smith,CN=Users,DC=domain,DC=com"
$user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0)
# Reset authenticator apps.
$apps = $user.GetApplicationsUserEnrolledIn()
$user.ResetMfa($apps, $false)
The following code sample resets user's multifactor authentication in Microsoft 365.
Import-Module Adaxes
# Connect to the Adaxes service.
$ns = New-Object("Softerra.Adaxes.Adsi.AdmNamespace")
$service = $ns.GetServiceDirectly("localhost")
# Bind to the user.
$userDN = "CN=John Smith,CN=Users,DC=domain,DC=com"
$user = $service.OpenObject("Adaxes://$userDN", $null, $null, 0)
# Reset multifactor authentication in Microsoft 365.
$user.ResetMfa($null, $true)