AzStackHciExternalActiveDirectory/AzStackHci.ExternalActiveDirectory.Helpers.psm1

Import-LocalizedData -BindingVariable lcAdTxt -FileName AzStackHci.ExternalActiveDirectory.Strings.psd1

function Get-ParamFromCommandLineOrConfigFile {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$false)]
        [string]
        $ConfigurationJsonPath,

        [Parameter(Mandatory=$true)]
        [string]
        $ParameterName,

        [Parameter(Mandatory=$false)]
        [string]
        $CommandLineParameterValue,

        [Parameter(Mandatory=$true)]
        [string]
        $ParameterDescription,

        [Parameter(Mandatory=$true)]
        [string]
        $ValidationRegex
    )

    # If CommandLineParameterValue is set, then use it and the config file doesn't matter
    if ([string]::IsNullOrEmpty($CommandLineParameterValue))
    {
        # If the configuration file is present, check to see if the value exists under the DeploymentData object
        # If we can find it, we'll overwrite $CommandLineParameterValue (so we can check for that later to see if it worked)
        if (-not [string]::IsNullOrEmpty($ConfigurationJsonPath))
        {
            $configData = Get-Content -Path $ConfigurationJsonPath -ErrorAction SilentlyContinue | ConvertFrom-Json

            $deployData = $configData.ScaleUnits.DeploymentData | Select-Object -First 1

            if ($deployData)
            {
                if ($deployData.PSobject.Properties.name -eq $ParameterName)
                {
                    $CommandLineParameterValue = $deployData.PSobject.Properties.Item($ParameterName).Value
                }
            }
        }

        if ([string]::IsNullOrEmpty($ConfigurationJsonPath))
        {
            throw ($lcAdTxt.MissingRequiredParameter -f $ParameterName,$ParameterDescription)
        }
    }

    if (-not ($CommandLineParameterValue -match $ValidationRegex))
    {
        throw ($lcAdTxt.MalformedRequiredParameter -f $ParameterName,$CommandLineParameterValue,$ValidationRegex)
    }

    return $CommandLineParameterValue
}

function Get-ClusterNameFromCommandLineOrConfigFile {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$false)]
        [string]
        $ConfigurationJsonPath,

        [Parameter(Mandatory=$false)]
        [string]
        $CommandLineParameterValue,

        [Parameter(Mandatory=$true)]
        [string]
        $ParameterDescription,

        [Parameter(Mandatory=$true)]
        [string]
        $ValidationRegex
    )

    # If CommandLineParameterValue is set, then use it and the config file doesn't matter
    if ([string]::IsNullOrEmpty($CommandLineParameterValue))
    {
        # If the configuration file is present, check to see if the value exists under the DeploymentData object
        # If we can find it, we'll overwrite $CommandLineParameterValue (so we can check for that later to see if it worked)
        if (-not [string]::IsNullOrEmpty($ConfigurationJsonPath))
        {
            $configData = Get-Content -Path $ConfigurationJsonPath -ErrorAction SilentlyContinue | ConvertFrom-Json

            $deployData = $configData.ScaleUnits.DeploymentData | Select-Object -First 1

            if ($deployData)
            {
                $clusterEntry = $deployData.Cluster
                $CommandLineParameterValue = if ($clusterEntry) { $clusterEntry.Name } else { "" }
            }
        }

        if ([string]::IsNullOrEmpty($ConfigurationJsonPath))
        {
            throw ($lcAdTxt.MissingRequiredParameter -f "ClusterName",$ParameterDescription)
        }
    }

    if (-not ($CommandLineParameterValue -match $ValidationRegex))
    {
        throw ($lcAdTxt.MalformedRequiredParameter -f "ClusterName",$CommandLineParameterValue,$ValidationRegex)
    }

    return $CommandLineParameterValue
}

function Get-PhysicalHostNamesFromCommandLineOrConfigFile {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$false)]
        [string]
        $ConfigurationJsonPath,

        [Parameter(Mandatory=$false)]
        [array]
        $CommandLineParameterValue,

        [Parameter(Mandatory=$true)]
        [string]
        $ParameterDescription,

        [Parameter(Mandatory=$true)]
        [string]
        $ValidationRegex
    )

    try {
        # If the command line argument is specified, always use it
        if (-not $CommandLineParameterValue -or $CommandLineParameterValue.Length -eq 0)
        {
            # If the command line argument is not specified, check the unattend
            $configData = Get-Content -Path $ConfigurationJsonPath -ErrorAction SilentlyContinue | ConvertFrom-Json

            $deployData = $configData.ScaleUnits.DeploymentData | Select-Object -First 1

            if ($deployData)
            {
                $clusterEntry = $deployData.PhysicalNodesV2 | ForEach-Object {$_.Name}
                if ($clusterEntry -and $clusterEntry.Length -gt 0)
                {
                    # No command line argument, but we found it in unattend, so overwrite command line value
                    $CommandLineParameterValue = $clusterEntry
                }
            }
        }
    }
    catch {}

    if (-not $CommandLineParameterValue -or $CommandLineParameterValue.Length -eq 0)
    {
        throw ($lcAdTxt.MissingRequiredParameter -f "PhysicalMachineNames",$ParameterDescription)
    }

    $failedValidationRegexItems = $CommandLineParameterValue | Where-Object {$_ -notmatch $ValidationRegex}

    if ($failedValidationRegexItems -and $failedValidationRegexItems.Length -gt 0)
    {
        throw ($lcAdTxt.MalformedRequiredParameter -f "PhysicalMachineNames",$failedValidationRegexItems -join ", ",$ValidationRegex)
    }

    return $CommandLineParameterValue
}


function Install-GroupPolicyModule
{
    $modulePresent = $false

    try
    {
        $result = Get-Module -All | Where-Object { $_.Name -eq 'GroupPolicy' }
        if (-not $result)
        {
            # Module is not already imported. See if it's available.
            $result = Get-Module -Refresh -ListAvailable | Where-Object { $_.Name -eq 'GroupPolicy' }

            if ($result)
            {
                $result | Import-Module -WarningAction Ignore
                $modulePresent = $true
            }
        }
        else
        {
            $modulePresent = $true
        }
    }
    catch
    {
        # Module not present and not importable.
    }

    if (-not $modulePresent)
    {
        if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
        {
            throw $lcAdTxt.NotRunningElevated
        }

        try
        {
            $capability = $null

            try
            {
                # See if we're on Windows 10 Oct 2018 update or later where it's a windows capability
                $capability = Get-WindowsCapability -Online | Where-Object {$_.Name -like 'Rsat.GroupPolicy*'}
            }
            catch {}

            if ($capability)
            {
                # Yes, Windows 10 Oct 2018 or later. Check if it's present and add it if not
                if ($capability.State -ne 'Installed')
                {
                    ($capability | Add-WindowsCapability -Online)
                }
                else
                {
                    # The capability is present and installed, but the Get-Module above failed, so we should just bail
                    throw ($lcAdTxt.RsatCapabilityPresentButCantImport -f $capability.Name)
                }
            }
            else
            {
                # We're not on Windows 10 Oct 2018 or later. If we're on a server sku (or a client with RSAT installed), we
                # may be able to find the optional feature to install
                $optionalFeature = Get-WindowsOptionalFeature -Online | Where-Object {$_.FeatureName -eq 'Microsoft-Windows-GroupPolicy-ServerAdminTools-Update'}

                if ($optionalFeature)
                {
                    # Feature is known, so see if it's enabled or enable-able
                    if ($optionalFeature.State -eq 'Enabled')
                    {
                        # Feature is known, and enabled, but still the previous efforts didn't find the module. We should just bail.
                        throw ($lcAdTxt.RsatOptionalFeaturePresentButCantImport -f 'Microsoft-Windows-GroupPolicy-ServerAdminTools-Update')
                    }
                    else
                    {
                        # Feature is known, but not enabled
                        $result = ($optionalFeature | Enable-WindowsOptionalFeature -Online)
                    }
                }
                else
                {
                    # We cannot find the module from WindowsCapability or from WindowsOptionalFeature, and it wasn't in the available modules
                    # Not much we can do here except prompt the user to install RSAT
                    throw $lcAdTxt.MissingModuleAndRsat
                }
            }
        }
        catch
        {
            throw ($lcAdTxt.FailedToInstallRsat -f $_)
        }
    }

    if (-not $modulePresent)
    {
        # If we're here, it's because the module wasn't originally present, and our attempt at installing it seemed to be successful. Try to find it again
        try
        {
            $result = Get-Module -Refresh -ListAvailable | Where-Object { $_.Name -eq 'GroupPolicy' }
            if ($result)
            {
                # AD module warns about finding a default server, but we'll specify everything later
                $result | Import-Module -WarningAction Ignore
            }
            else
            {
                throw $lcAdTxt.ModuleStillMissingAfterRsatInstall
            }
        }
        catch
        {
            throw ($lcAdTxt.FailToLoadModuleAfterRsatInstall -f $_)
        }
    }
}

function Install-ActiveDirectoryModule
{
    $modulePresent = $false

    try
    {
        $result = Get-Module -All | Where-Object { $_.Name -eq 'ActiveDirectory' }
        if (-not $result)
        {
            # Module is not already imported. See if it's available.
            $result = Get-Module -Refresh -ListAvailable | Where-Object { $_.Name -eq 'ActiveDirectory' }

            if ($result)
            {
                # AD module warns about finding a default server, but we'll specify everything later
                $result | Import-Module -WarningAction Ignore
                $modulePresent = $true
            }
        }
        else
        {
            $modulePresent = $true
        }
    }
    catch
    {
        # Module not present and not importable.
    }

    if (-not $modulePresent)
    {
        if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
        {
            throw $lcAdTxt.NotRunningElevated
        }

        $windowsFeature = $null

        # See if we're on a server version that installs AD Powershell with Add-WindowsFeature
        try {
            $windowsFeature = Get-WindowsFeature -Name "RSAT-AD-PowerShell"
        }
        catch {
        }

        if ($windowsFeature -and $windowsFeature.InstallState -ne [Microsoft.Windows.ServerManager.Commands.InstallState]::Installed)
        {
            Add-WindowsFeature -Name "RSAT-AD-PowerShell" -IncludeAllSubFeature
        }

        $result = Get-Module -Refresh -ListAvailable | Where-Object { $_.Name -eq 'ActiveDirectory' }

        $modulePresent = ($null -ne $result)
    }

    if (-not $modulePresent)
    {
        try
        {
            $capability = $null

            try
            {
                # See if we're on Windows 10 Oct 2018 update or later where it's a windows capability
                $capability = Get-WindowsCapability -Online | Where-Object {$_.Name -like 'Rsat.ActiveDirectory*'}
            }
            catch {}

            if ($capability)
            {
                # Yes, Windows 10 Oct 2018 or later. Check if it's present and add it if not
                if ($capability.State -ne 'Installed')
                {
                    ($capability | Add-WindowsCapability -Online)
                }
                else
                {
                    # The capability is present and installed, but the Get-Module above failed, so we should just bail
                    throw ($lcAdTxt.RsatCapabilityPresentButCantImport -f $capability.Name)
                }
            }
            else
            {
                # We're not on Windows 10 Oct 2018 or later. If we're on a server sku (or a client with RSAT installed), we
                # may be able to find the optional feature to install
                $optionalFeature = Get-WindowsOptionalFeature -Online | Where-Object {$_.FeatureName -eq 'RSAT-ADDS-Tools-Feature'}

                if ($optionalFeature)
                {
                    # Feature is known, so see if it's enabled or enable-able
                    if ($optionalFeature.State -eq 'Enabled')
                    {
                        # Feature is known, and enabled, but still the previous efforts didn't find the module. We should just bail.
                        throw ($lcAdTxt.RsatOptionalFeaturePresentButCantImport -f 'RSAT-ADDS-Tools-Feature')
                    }
                    else
                    {
                        # Feature is known, but not enabled
                        $result = ($optionalFeature | Enable-WindowsOptionalFeature -Online)
                    }
                }
                else
                {
                    # We cannot find the module from WindowsCapability or from WindowsOptionalFeature, and it wasn't in the available modules
                    # Not much we can do here except prompt the user to install RSAT
                    throw $lcAdTxt.MissingModuleAndRsat
                }
            }
        }
        catch
        {
            throw ($lcAdTxt.FailedToInstallRsat -f $_)
        }
    }

    if (-not $modulePresent)
    {
        # If we're here, it's because the module wasn't originally present, and our attempt at installing it seemed to be successful. Try to find it again
        try
        {
            $result = Get-Module -Refresh -ListAvailable | Where-Object { $_.Name -eq 'ActiveDirectory' }
            if ($result)
            {
                # AD module warns about finding a default server, but we'll specify everything later
                $result | Import-Module -WarningAction Ignore
            }
            else
            {
                throw $lcAdTxt.ModuleStillMissingAfterRsatInstall
            }
        }
        catch
        {
            throw ($lcAdTxt.FailToLoadModuleAfterRsatInstall -f $_)
        }
    }

    # Sometimes we seem to import the module, but don't get the PS provider as well. Should be safe to just import again here to see
    if (-not (Get-PSProvider -PSProvider ActiveDirectory -ErrorAction SilentlyContinue))
    {
        Import-Module 'ActiveDirectory' -Force
    }
    if (-not (Get-PSProvider -PSProvider ActiveDirectory -ErrorAction SilentlyContinue))
    {
        throw ("Can't find ActiveDirectory PSProvider!")
    }
}
# SIG # Begin signature block
# MIInkwYJKoZIhvcNAQcCoIInhDCCJ4ACAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBEKnzkisn2Tg4q
# HD9TaBvG08+zK3iazEUgm4LusZASL6CCDXYwggX0MIID3KADAgECAhMzAAADTrU8
# esGEb+srAAAAAANOMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD
# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy
# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29m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