Azure active directory Azure AD Connect安装-System.Security.SecurityException:不允许请求的注册表访问

Azure active directory Azure AD Connect安装-System.Security.SecurityException:不允许请求的注册表访问,azure-active-directory,Azure Active Directory,我必须在服务器格式化后重新安装Azure AD Connect,使用自定义设置时出现以下错误: [ERROR] A terminating unhandled exception occurred. Exception Data (Raw): System.AggregateException: One or more errors occurred. ---> System.Reflection.TargetInvocationException: Exception has been

我必须在服务器格式化后重新安装Azure AD Connect,使用自定义设置时出现以下错误:

[ERROR] A terminating unhandled exception occurred.
Exception Data (Raw): System.AggregateException: One or more errors occurred. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: Requested registry access is not allowed.
   at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
   at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
   at Microsoft.Identity.Health.Common.FileUploader.GetHealthAgentInstallPath()
   at Microsoft.Identity.Health.Common.FileUploader..ctor(UploadSourcePolicy agent, Action`1 logLine)
   at Microsoft.Online.Deployment.Types.Utility.AutoUpgradeEligibilityProvider..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Microsoft.Online.Deployment.Framework.ProviderRegistry.CreateInstance[TProvider]()
   at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfigurationPageViewModel.ExecuteAutoUpgradeCheck()
   at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfigurationPageViewModel.BackgroundInitialize(Object obj)
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.SecurityException: Requested registry access is not allowed.
   at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
   at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
   at Microsoft.Identity.Health.Common.FileUploader.GetHealthAgentInstallPath()
   at Microsoft.Identity.Health.Common.FileUploader..ctor(UploadSourcePolicy agent, Action`1 logLine)
   at Microsoft.Online.Deployment.Types.Utility.AutoUpgradeEligibilityProvider..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Microsoft.Online.Deployment.Framework.ProviderRegistry.CreateInstance[TProvider]()
   at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfigurationPageViewModel.ExecuteAutoUpgradeCheck()
   at Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfigurationPageViewModel.BackgroundInitialize(Object obj)
   at System.Threading.Tasks.Task.Execute()<---
[错误]发生终止未处理的异常。
异常数据(原始):System.AggregateException:发生一个或多个错误。-->System.Reflection.TargetInvocationException:调用的目标已引发异常。-->System.Security.SecurityException:不允许请求的注册表访问。
在System.ThrowHelper.ThrowSecurityException(异常资源)
位于Microsoft.Win32.RegistryKey.OpenSubKey(字符串名称,布尔可写)
在Microsoft.Identity.Health.Common.FileUploader.GetHealthAgentInstallPath()上
位于Microsoft.Identity.Health.Common.FileUploader..ctor(UploadSourcePolicy代理,操作`1日志行)
在Microsoft.Online.Deployment.Types.Utility.AutoUpgradeEligibilityProvider..ctor()中
---内部异常堆栈跟踪的结束---
在System.RuntimeTypeHandle.CreateInstance(RuntimeType类型、Boolean publicOnly、Boolean noCheck、Boolean&canBeCached、RuntimeMethodHandleInternal&ctor、Boolean&bNeedSecurityCheck)
位于System.RuntimeType.CreateInstanceSlow(布尔publicOnly、布尔skipCheckThis、布尔fillCache、StackScrawlMark和stackMark)
位于System.Activator.CreateInstance(类型,布尔非公共)
位于System.Activator.CreateInstance(类型)
位于Microsoft.Online.Deployment.Framework.ProviderRegistry.CreateInstance[TProvider]()
在Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfiguration PageViewModel.ExecuteAutoUpgradeCheck()中
在Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfigurationPageViewModel.BackgroundInitialize(对象obj)中
在System.Threading.Tasks.Task.Execute()中
---内部异常堆栈跟踪的结束---
--->(内部异常#0)System.Reflection.TargetInvocationException:调用的目标已引发异常。-->System.Security.SecurityException:不允许请求的注册表访问。
在System.ThrowHelper.ThrowSecurityException(异常资源)
位于Microsoft.Win32.RegistryKey.OpenSubKey(字符串名称,布尔可写)
在Microsoft.Identity.Health.Common.FileUploader.GetHealthAgentInstallPath()上
位于Microsoft.Identity.Health.Common.FileUploader..ctor(UploadSourcePolicy代理,操作`1日志行)
在Microsoft.Online.Deployment.Types.Utility.AutoUpgradeEligibilityProvider..ctor()中
---内部异常堆栈跟踪的结束---
在System.RuntimeTypeHandle.CreateInstance(RuntimeType类型、Boolean publicOnly、Boolean noCheck、Boolean&canBeCached、RuntimeMethodHandleInternal&ctor、Boolean&bNeedSecurityCheck)
位于System.RuntimeType.CreateInstanceSlow(布尔publicOnly、布尔skipCheckThis、布尔fillCache、StackScrawlMark和stackMark)
位于System.Activator.CreateInstance(类型,布尔非公共)
位于System.Activator.CreateInstance(类型)
位于Microsoft.Online.Deployment.Framework.ProviderRegistry.CreateInstance[TProvider]()
在Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfiguration PageViewModel.ExecuteAutoUpgradeCheck()中
在Microsoft.Online.Deployment.OneADWizard.UI.WizardPages.PerformConfigurationPageViewModel.BackgroundInitialize(对象obj)中

在System.Threading.Tasks.Task.Execute()。此外,请检查您是否正在安装最新版本的AAD Connect

服务器的管理员帐户需要具有注册表访问权限。在VM上的系统设置中,确保将您的帐户添加为管理员

有关此错误,请参见。

找到了答案并

这与要授予以下权限的注册表项有关:

HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\ADHealthAgent\Sync