question

PavelObr-3777 avatar image
PavelObr-3777 asked ·

Azure AD Connect - after uninstall cannot configure and install again

Halo,

I had "successfully" running AD Connect (password hash sync) with my on-premise AD (1500 accounts). Last week my passwords stopped to sync. I used recommended solution (from forum) to uninstall AD Connect and make full install again (all directories, databases, sync user, etc. was deleted too).

But I cannot configure and install AD Connect again. After adding forest and before selecting synced OU I am getting error "ArgumentOutOfRangeException". I have founded some recommendations, but I am still in troubles...

Thank you for hints and recommendation. Screenshot and log are below.

 [10:50:05.604] [ 25] [INFO ] Page transition from "Connect Directories" [ConfigSyncDirectoriesPageViewModel] to "Azure AD sign-in" [UserSignInConfigPageViewModel]
 [10:50:05.604] [ 25] [ERROR] RootWizardPageViewModel: An unhandled exception occurred during a page load.
 Exception Data (Raw): System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
 Parameter name: index
    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
    at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.UserSignInConfigPageViewModel.OnLoad(NavigateDirection direction)
    at Microsoft.Online.Deployment.Framework.UI.WizardPages.RootWizardPageViewModel.ActivatePage(IWizardPage page, NavigateDirection direction)
 [10:50:05.651] [ 25] [ERROR] A terminating unhandled exception occurred.
 Exception Data (Raw): System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
 Parameter name: index
    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
    at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.UserSignInConfigPageViewModel.OnLoad(NavigateDirection direction)
    at Microsoft.Online.Deployment.Framework.UI.WizardPages.RootWizardPageViewModel.ActivatePage(IWizardPage page, NavigateDirection direction)
    at Microsoft.Online.Deployment.Framework.UI.WizardPages.RootWizardPageViewModel.MoveNext()
    at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.ConfigSyncDirectoriesPageViewModel.WaitForTaskCompletion(Task task)
    at System.Threading.Tasks.Task.Execute()
    --- End of inner exception stack trace ---
 ---> (Inner Exception #0) System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
 Parameter name: index
    at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
    at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.UserSignInConfigPageViewModel.OnLoad(NavigateDirection direction)
    at Microsoft.Online.Deployment.Framework.UI.WizardPages.RootWizardPageViewModel.ActivatePage(IWizardPage page, NavigateDirection direction)
    at Microsoft.Online.Deployment.Framework.UI.WizardPages.RootWizardPageViewModel.MoveNext()
    at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.ConfigSyncDirectoriesPageViewModel.WaitForTaskCompletion(Task task)
    at System.Threading.Tasks.Task.Execute()<---
    
 [10:50:05.697] [  1] [INFO ] Page transition from "Azure AD sign-in" [UserSignInConfigPageViewModel] to "Error" [ErrorPageViewModel]
 [10:50:05.713] [  1] [INFO ] UserSignInConfigPageViewModel : UPN attribute: 
 [11:11:52.847] [  1] [INFO ] Opened log file at path C:\ProgramData\AADConnect\trace-20200414-104617.log

7376-remmina-srv-tools-192168735-2020414-82957620114.png


azure-ad-connect
1 comment
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.



I have get hint from Oliver Wu MSFT:

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_o365admin-mso_password-mso_o365b/azure-ad-connect-after-uninstall-cannot-configure/d19f3d91-3bf2-4807-9e7d-d917ccda71be?messageId=28e3d755-3e02-49c1-a6d1-bf79efa0913f

It means to Disable Directory Sync: Set-MsolDirSyncEnabled –EnableDirSync $false.

I was succesfull with it and directory sync was disabled, checked with:

(Get-MSOLCompanyInformation).DirectorySynchronizationEnabled

Next I uninstalled Ad Connect and then install again but I still cannot configure AD Connect with the same error.....

0 Votes 0 · ·

1 Answer

MarileeTurscak avatar image
MarileeTurscak answered ·

There are a few things that can cause this error. In many cases it's related to an invalid character in an attribute on-premises. If you have any users that exist on-premises with one name (perhaps with an added space), and in the cloud with another name, this can occur. Check to see that none of the UPNs have extra spacing. Would you please go to the on premises directory, and check for any extra spaces or invalid characters in the UPNs of your users? Once you finish you can start the sync cycle by using the Powershell cmdlet Start-ADSyncSyncCycle Delta

If you can provide a screenshot of the error in your logs, it may help us narrow this down more.

I have also seen this happen for users that have had empty subscriptions set up. You can run "Get-AzureSubscription -default" to see what your default subscription is. You can then "remove" any empty subscriptions using the "Remove-AzureSubscription" command.

As you mentioned, sometimes a full uninstall, cleanup, and reinstall is required to get past this error. If you do this you need to delete all references and folders. This might be a last option as I understand that it's a pain, so we should probably rule out the other options first before doing this.

In this case you would need to uninstall all instances of Microsoft SQL LocalDB, Microsoft SQL Native Client and Azure AD Connect.

You'll probably need to use the Microsoft program uninstall fixer tool to accomplish this.

After doing the above, delete the program files located at:

%ProgramFiles%\Microsoft Azure AD Connection Tool
%ProgramFiles%\Microsoft Azure AD Sync
%ProgramFiles%\Microsoft Azure Active Directory Connect

You will need to stop the "AD Sync" service. Otherwise, it wont let you delete some of these.

Remove the following registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\AD Sync
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Azure AD Connect
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSOLCoExistence
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Local DB
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\ADSync
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\EventLog\Application\ADSync
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\EventLog\Application\AzureActiveDir
ectorySyncEngine
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\ADSync
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\EventLog\Application\ADSync
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\EventLog\Application\AzureActiveDir
ectorySyncEngine
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ADSync
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\ADSync
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\AzureActiv
eDirectorySyncEngine
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\EventLog\Application\ADSync
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\

Finally, reboot the machine running Azure AD Connect that we've just removed, and you should be able to install it as normal.

If you think it might be easier, you can also send me an email at AzCommunity@microsoft.com and I can open a one-time free support case to help you troubleshoot this.

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sorry to present so many alternatives, but I also ran into something else:

This error is often caused by a form trying to submit a change when the form has not completed loading yet. The data reader object is set to a status of -1 while it is loading and thus the error that it must be non-negative. Possibly the form is trying to load more data than it was ever tested with and it is not completely loading.

Resolution:
- as per the performance recommendations a few indexes may need to be created and you may need a quota increase for the database on your subscription.

I would like to see more of your logs to determine if this might be the case (That is, if you're still running into the "Index out of range" error.)

0 Votes 0 · ·