The following error was generated when “$error.Clear(); install-adam -Port $RoleAdamLdapPort -SslPort $RoleAdamSslPort ” was run: “Microsoft.Exchange.Management.Edge.SetupTasks.AdamSetAclsProcessFailureException: Active Directory Lightweight Directory Service (AD LDS) process dsacls.exe failed with error code 58 when setting the access control list (ACL) on OU=MSExchangeGateway.    at Microsoft.Exchange.Configuration.Tasks.Task.ThrowError(Exception exception, ErrorCategory errorCategory, Object target, String helpUrl)

While installing Edge Transport Server role on Windows Server 2016, if you get the following error: Error: The following error was generated when “$error.Clear(); install-adam -Port $RoleAdamLdapPort -SslPort $RoleAdamSslPort ” was run: “Microsoft.Exchange.Management.Edge.SetupTasks.AdamSetAclsProcessFailureException: Active Directory Lightweight Directory Service (AD LDS)

Add-PSSnapin : The windows PowerShell snap-in ‘microsoft.exchange.powershell.snapin’ is not installed on this computer.

When you execute the following command Add-PSSnapin microsoft.exchange.powershell.snapin You may get the following error: Add-PSSnapin : The windows PowerShell snap-in 'microsoft.exchange.powershell.snapin' is not installed on this computer. The solution is: Slightly change the command as follows. Add-PSSnapin microsoft.exchange.management.powershell.snapin