diff --git a/d365fo.tools/functions/import-d365aaduser.ps1 b/d365fo.tools/functions/import-d365aaduser.ps1 index e8da6703..8f139be9 100644 --- a/d365fo.tools/functions/import-d365aaduser.ps1 +++ b/d365fo.tools/functions/import-d365aaduser.ps1 @@ -208,11 +208,11 @@ function Import-D365AadUser { Write-PSFMessage -Level Verbose -Message "Trying to connect to the Azure Active Directory with tenant id '$TenantId'" if ($PSBoundParameters.ContainsKey("AzureAdCredential") -eq $true) { - Login-AzAccount -Credential $AzureAdCredential -ErrorAction Stop -TenantId $TenantId + Connect-AzAccount -Credential $AzureAdCredential -ErrorAction Stop -TenantId $TenantId } else { if ($SkipAzureAd -eq $false) { - Login-AzAccount -ErrorAction Stop -TenantId $TenantId + Connect-AzAccount -ErrorAction Stop -TenantId $TenantId } } }