Bin/ADSyncDiagnostics/PSScripts/ADSyncConfigurePermissions.ps1

#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#-------------------------------------------------------------------------

Function CheckConfigureAccountPermissionsPrerequisites
{
    # Check if all the features installed by RSAT-AD-Tools are available. These are required for the AdSyncConfig module
    if (((Get-WindowsFeature RSAT-AD-PowerShell).InstallState -ne "Installed") -or ((Get-WindowsFeature RSAT-AD-AdminCenter).InstallState -ne "Installed") -or ((Get-WindowsFeature RSAT-ADDS-Tools).InstallState -ne "Installed") -or ((Get-WindowsFeature RSAT-ADLDS).InstallState -ne "Installed"))
    {
        $installRSATOptions = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No")
        $canInstall = !($host.UI.PromptForChoice("RSAT-AD-Tools Warning", "The use of these options requires 'Remote Server Administration Tools for AD DS' to be installed. Is it okay to install them now?", $installRSATOptions, 0))

        if (!$canInstall)
        {
            return $false
        }

        Try
        {
            $installState = $null

            $osVersion = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name ProductName).ProductName

            if ($osVersion -Like "*Windows Server 2008 R2*")
            {
                $installState = Add-WindowsFeature RSAT-AD-Tools
            }
            else
            {
                $installState = Install-WindowsFeature RSAT-AD-Tools
            }

            if ($installState.RestartNeeded -eq "Yes")
            {
                $restartOptions = [System.Management.Automation.Host.ChoiceDescription[]] @("&Restart Now", "&Back to Previous Menu")
                $confirmRestart = !($host.UI.PromptForChoice("Feature Install Warning", "A restart is required to complete installation of the RSAT-AD-Tools Windows Feature. Is it okay to restart now?", $installRSATOptions, 0))

                if ($confirmRestart)
                {
                    Restart-Computer
                }
                else
                {
                    return $false
                }
            }
        }
        Catch
        {
            Write-Host "[ERROR]`t Installing RSAT-AD-Tools Windows Feature failed."
            Exit 1
        }
    }

    if (-not (Get-Module ActiveDirectory))
    {
        Import-Module ActiveDirectory -ErrorAction Stop
    }

    # These options make use of the AdSyncConfig module included with the product
    Try
    {
        $aadConnectRegKey = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Azure AD Connect"
        $aadConnectWizardPath = $aadConnectRegKey.WizardPath
        $aadConnectWizardFileName = "AzureADConnect.exe"

        $aadConnectPathLength = $aadConnectWizardPath.IndexOf($aadConnectWizardFileName)
        $aadConnectPath = $aadConnectWizardPath.Substring(0, $aadConnectPathLength)

        $adSyncConfigModulePath = [System.IO.Path]::Combine($aadConnectPath, "AdSyncConfig\AdSyncConfig.psm1")
        Import-Module $adSyncConfigModulePath -ErrorAction Stop
    }
    Catch
    {
        Write-Host "[ERROR]`t Importing the AdSyncTools module failed."
        Exit 1
    }

    return $true
}

Function ConfigureAccountPermissions
{
    param
    (
        [string]
        [parameter(mandatory=$true)]
        $ConfigurationOption
    )

    Write-Host "`r`n"

    if ($ConfigurationOption -eq "GetADSyncADConnectorAccount")
    {
        $allAccounts = Get-ADSyncADConnectorAccount

        Write-Host ($allAccounts | Format-Table -Wrap -AutoSize -Property ADConnectorName, ADConnectorForest, ADConnectorAccountName,ADConnectorAccountDomain | Out-String)
    }
    elseif ($ConfigurationOption -eq "GetADSyncObjectsWithInheritanceDisabled")
    {
        Write-Host "`r`n"
        $targetForest = Read-Host "Please enter the forest to search for objects"
        Write-Host "`r`n"
        $searchBase = Read-Host "Please enter the search base for the LDAP query, it can be an AD Domain DistinguishedName or a FQDN"
        Write-Host "`r`n"
        $objectClass = Read-Host "Please enter the object class. It can be '*' (for any object class), 'user', 'group', 'container', etc. Giving no input will use the default, 'organizationalUnit'"

        if ($targetForest -ne (Get-ADForest).Name)
        {
            $targetForestCredentials = Get-Credential -Message "Please enter credentials for target forest '$targetForest' in DOMAIN\username format"

            if ($objectClass)
            {
                Write-Host (Get-ADSyncObjectsWithInheritanceDisabled -SearchBase $searchBase -ObjectClass $objectClass -TargetForest $targetForest -TargetForestCredential $targetForestCredentials | Out-String)
            }
            else
            {
                Write-Host (Get-ADSyncObjectsWithInheritanceDisabled -SearchBase $searchBase -TargetForest $targetForest -TargetForestCredential $targetForestCredentials | Out-String)
            }
        }
        else
        {
            if ($objectClass)
            {
                Write-Host (Get-ADSyncObjectsWithInheritanceDisabled -SearchBase $searchBase -ObjectClass $objectClass | Out-String)
            }
            else
            {
                Write-Host (Get-ADSyncObjectsWithInheritanceDisabled -SearchBase $searchBase | Out-String)
            }
        }
    }
    elseif ($ConfigurationOption -eq "ShowADSyncADObjectPermissions")
    {
        Write-Host "`r`n"
        $targetForest = Read-Host "Please enter the forest where the object exists"

        $objectToCheck = Read-Host "Please enter the DistinguishedName of the object to view the permissions on"

        if ($targetForest -ne (Get-ADForest).Name)
        {
            $targetForestCredentials = Get-Credential -Message "Please enter credentials for target forest '$targetForest' in DOMAIN\username format"

            Write-Host (Show-ADSyncADObjectPermissions -ADobjectDN $objectToCheck -TargetForestCredential $targetForestCredentials | Out-String)
        }
        else
        {
            Write-Host (Show-ADSyncADObjectPermissions -ADobjectDN $objectToCheck | Out-String)
        }
    }
    else
    {
        if ($ConfigurationOption -eq "SetADSyncDefaultPermssions")
        {
            Write-Host "`r`n"
            Write-Host "This option will set permissions required for the following:"
            Write-Host " Password Hash Sync"
            Write-Host " Password Writeback"
            Write-Host " Hybrid Exchange"
            Write-Host " Exchange Mail Public Folder"
            Write-Host " MsDsConsistencyGuid"
            Write-Host "It will then restrict permissions"

            $confirmDefaultOptions = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No")
            $confirmDefaultChoice = !($host.UI.PromptForChoice("Confirm", "Would you like to continue with these options?", $confirmDefaultOptions, 0))

            if (!$confirmDefaultChoice)
            {
                return
            }
        }

        $configureArguments = @{ }

        $accountTypeOptions = [System.Management.Automation.Host.ChoiceDescription[]] @("&Existing Connector Account", "&Custom Account")
        $accountTypeChoice = $host.UI.PromptForChoice("Account to Configure", "Would you like to configure an existing connector account or a custom account?", $accountTypeOptions, 0)

        if ($accountTypeChoice)
        {
            Write-Host "`r`n"
            $accountChoiceOptions = [System.Management.Automation.Host.ChoiceDescription[]] @("&Distinguished Name", "&Account Name and Account Domain")
            $accountInputChoice = $host.UI.PromptForChoice("Account Information", "How would you like to input the account information?", $accountChoiceOptions, 0)

            Write-Host "`r`n"
            $targetForest = Read-Host "Please enter the forest on which to configure the account"

            if ($accountInputChoice)
            {
                $connectorAccountName = Read-Host "Please enter the Account Name"
                $connectorAccountDomain = Read-Host "Please enter the Account Domain"

                $configureArguments.Add("ADConnectorAccountName", $connectorAccountName)
                $configureArguments.Add("ADConnectorAccountDomain", $connectorAccountDomain)
            }
            else
            {
                Write-Host "`r`n"
                $connectorAccountDN = Read-Host "Please enter the Account Distinguished Name"

                $configureArguments.Add("ADConnectorAccountDN", $connectorAccountDN)
            }
        }
        else
        {
            $allAccounts = Get-ADSyncADConnectorAccount

            $selectedConnector = $null

            while ($selectedConnector -eq $null)
            {
                Write-Host "`r`n"
                Write-Host "Configured connectors and their related accounts:"

                Write-Host ($allAccounts | Out-String)

                Write-Host "`r`n"
                $connectorSelection = Read-Host "Name of the connector who's account to configure"

                if ($allAccounts.ADConnectorName -contains $connectorSelection)
                {
                    $selectedConnector = $allAccounts | Where-Object { $_.ADConnectorName -like $connectorSelection }
                    $configureArguments.Add("ADConnectorAccountName", $selectedConnector.ADConnectorAccountName)
                    $configureArguments.Add("ADConnectorAccountDomain", $selectedConnector.ADConnectorAccountDomain)

                    $targetForest = $selectedConnector.ADConnectorForest
                }
                else
                {
                    Write-Host "`r`n"
                    ReportWarning "'$connectorSelection' is not a configured connector. Please try again!"
                }
            }
        }

        if ($targetForest -ne (Get-ADForest).Name)
        {
            $targetForestCredentials = Get-Credential -Message "Please enter credentials for target forest '$targetForest' in DOMAIN\username format"

            $configureArguments.Add("TargetForest", $targetForest)
            $configureArguments.Add("TargetForestCredential", $targetForestCredentials)
        }

        Write-Host "`r`n"

        if (($ConfigurationOption -eq "SetADSyncRestrictedPermissions") -or ($ConfigurationOption -eq "SetADSyncDefaultPermssions"))
        {
            if ($configureArguments.ContainsKey("ADConnectorAccountName"))
            {
                $ldapFilter = "(|(Name=" +  $configureArguments.ADConnectorAccountName + ")(sAMAccountName=" + $configureArguments.ADConnectorAccountName + "))"

                if ($targetForest -ne (Get-ADForest).Name)
                {
                    $adObject = Get-ADObject -LDAPFilter $ldapFilter -Server $configureArguments.ADConnectorAccountDomain -Properties distinguishedName -Credential $configureArguments.TargetForestCredential -ErrorAction Stop
                }
                else
                {
                    $adObject = Get-ADObject -LDAPFilter $ldapFilter -Server $configureArguments.ADConnectorAccountDomain -Properties distinguishedName -ErrorAction Stop
                }

                $configureArguments.Remove("ADConnectorAccountName")
                $configureArguments.Remove("ADConnectorAccountDomain")
                $configureArguments.Add("ADConnectorAccountDN", $adObject.distinguishedName)
            }

            $adminCredential = Get-Credential -Message "Please enter Administrator credentials that have the necessary privileges to restrict the permissions on the Connector Account"

            if ($ConfigurationOption -eq "SetADSyncDefaultPermssions")
            {
                Write-Host (Set-ADSyncPasswordHashSyncPermissions @configureArguments | Out-String)
                Write-Host (Set-ADSyncPasswordWritebackPermissions @configureArguments | Out-String)
                Write-Host (Set-ADSyncExchangeHybridPermissions @configureArguments | Out-String)
                Write-Host (Set-ADSyncExchangeMailPublicFolderPermissions @configureArguments | Out-String)
                Write-Host (Set-ADSyncMsDsConsistencyGuidPermissions @configureArguments | Out-String)

                $configureArguments.Add("Credential", $adminCredential)
                if ($configureArguments.ContainsKey("TargetForestCredential"))
                {
                    $configureArguments.Remove("TargetForestCredential")
                }

                Write-Host (Set-ADSyncRestrictedPermissions @configureArguments | Out-String)
            }
            else
            {
                $configureArguments.Add("Credential", $adminCredential)
                if ($configureArguments.ContainsKey("TargetForestCredential"))
                {
                    $configureArguments.Remove("TargetForestCredential")
                }

                Write-Host "`r`n"
                $validationChoiceOptions = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No")
                $disableCredentialValidation = !($host.UI.PromptForChoice("Disable Credential Validation", "Skip checking if the credentials provided are valid in AD and if they have the necessary privileges to restrict the permissions on the Connector account.", $validationChoiceOptions, 1))
        
                if ($disableCredentialValidation)
                {
                    $configureArguments.Add("DisableCredentialValidation", $true)
                }

                Write-Host "`r`n"
                Write-Host (Set-ADSyncRestrictedPermissions @configureArguments | Out-String)
            }
        }
        elseif ($ConfigurationOption -eq "SetADSyncPasswordHashSyncPermissions")
        {
            Write-Host (Set-ADSyncPasswordHashSyncPermissions @configureArguments | Out-String)
        }
        else
        {
            $adObjectDN = Read-Host "To set permissions for a single target object, enter the DistinguishedName of the target AD object. Giving no input will set root permissions for all Domains in the Forest"

            Write-Host "`r`n"
            $includeChoiceOptions = [System.Management.Automation.Host.ChoiceDescription[]] @("&Yes", "&No")
            $includeAdminSDHolders = !($host.UI.PromptForChoice("Update AdminSdHolders", "Update AdminSDHolder container when updating with these permissions?", $includeChoiceOptions, 1))

            if ($adObjectDN)
            {
                $configureArguments.Add("ADobjectDN", $adObjectDN)
            }

            if ($includeAdminSDHolders)
            {
                $configureArguments.Add("IncludeAdminSDHolders", $true)
            }

            Write-Host "`r`n"

            if ($ConfigurationOption -eq "SetADSyncBasicReadPermissions")
            {
                Write-Host (Set-ADSyncBasicReadPermissions @configureArguments | Out-String)
            }
            elseif ($ConfigurationOption -eq "SetADSyncExchangeHybridPermissions")
            {
                Write-Host (Set-ADSyncExchangeHybridPermissions @configureArguments | Out-String)
            }
            elseif ($ConfigurationOption -eq "SetADSyncExchangeMailPublicFolderPermissions")
            {
                Write-Host (Set-ADSyncExchangeMailPublicFolderPermissions @configureArguments | Out-String)
            }
            elseif ($ConfigurationOption -eq "SetADSyncMsDsConsistencyGuidPermissions")
            {
                Write-Host (Set-ADSyncMsDsConsistencyGuidPermissions @configureArguments | Out-String)
            }
            elseif ($ConfigurationOption -eq "SetADSyncPasswordWritebackPermissions")
            {
                Write-Host (Set-ADSyncPasswordWritebackPermissions @configureArguments | Out-String)
            }
            elseif ($ConfigurationOption -eq "SetADSyncUnifiedGroupWritebackPermissions")
            {
                Write-Host (Set-ADSyncUnifiedGroupWritebackPermissions @configureArguments | Out-String)
            }
        }
    }
}
# SIG # Begin signature block
# MIInogYJKoZIhvcNAQcCoIInkzCCJ48CAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDZ7I+XwaUhLp33
# bPHQpAN5xYlDd9kR8siFMxxQw8Wbp6CCDYIwggYAMIID6KADAgECAhMzAAADXJXz
# SFtKBGrPAAAAAANcMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD
# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy
# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p
# bmcgUENBIDIwMTEwHhcNMjMwNDA2MTgyOTIyWhcNMjQwNDAyMTgyOTIyWjB0MQsw
# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u
# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy
# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
# AQDijA1UCC84R0x+9Vr/vQhPNbfvIOBFfymE+kuP+nho3ixnjyv6vdnUpgmm6RT/
# pL9cXL27zmgVMw7ivmLjR5dIm6qlovdrc5QRrkewnuQHnvhVnLm+pLyIiWp6Tow3
# ZrkoiVdip47m+pOBYlw/vrkb8Pju4XdA48U8okWmqTId2CbZTd8yZbwdHb8lPviE
# NMKzQ2bAjytWVEp3y74xc8E4P6hdBRynKGF6vvS6sGB9tBrvu4n9mn7M99rp//7k
# ku5t/q3bbMjg/6L6mDePok6Ipb22+9Fzpq5sy+CkJmvCNGPo9U8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