diff --git a/.gitignore b/.gitignore index 4f41350..da030e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@  # ignore the settings folder and files for VSCode and PSS -.vscode/* *.psproj *TempPoint* diff --git a/.vscode/admf.code-snippets b/.vscode/admf.code-snippets new file mode 100644 index 0000000..bde9b0d --- /dev/null +++ b/.vscode/admf.code-snippets @@ -0,0 +1,14 @@ +{ + "Help_ServerCredential": { + "scope": "powershell", + "prefix": "helpsc", + "body": [ + ".PARAMETER Server", + "\tThe server / domain to work with.", + "", + ".PARAMETER Credential", + "\tThe credentials to use for this operation." + ], + "description": "[ADMF] Default help for server & credentials" + } +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3b61434 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/ADMF.Core/ADMF.Core.psd1 b/ADMF.Core/ADMF.Core.psd1 index 549d3a3..e94aff6 100644 --- a/ADMF.Core/ADMF.Core.psd1 +++ b/ADMF.Core/ADMF.Core.psd1 @@ -1,32 +1,32 @@ @{ # Script module or binary module file associated with this manifest - RootModule = 'ADMF.Core.psm1' + RootModule = 'ADMF.Core.psm1' # Version number of this module. - ModuleVersion = '1.1.9' + ModuleVersion = '1.2.12' # ID used to uniquely identify this module - GUID = '11e2d894-33d7-4020-a65e-f13c2f1893aa' + GUID = '11e2d894-33d7-4020-a65e-f13c2f1893aa' # Author of this module - Author = 'Friedrich Weinmann' + Author = 'Friedrich Weinmann' # Company or vendor of this module - CompanyName = 'Microsoft' + CompanyName = 'Microsoft' # Copyright statement for this module - Copyright = 'Copyright (c) 2020 Friedrich Weinmann' + Copyright = 'Copyright (c) 2020 Friedrich Weinmann' # Description of the functionality provided by this module - Description = 'Central Tooling used across available across all ADMF Project modules' + Description = 'Central Tooling used across available across all ADMF Project modules' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '5.0' # Modules that must be imported into the global environment prior to importing # this module - RequiredModules = @( - @{ ModuleName = 'PSFramework'; ModuleVersion = '1.7.270' } + RequiredModules = @( + @{ ModuleName = 'PSFramework'; ModuleVersion = '1.13.416' } # @{ ModuleName = 'ResolveString'; ModuleVersion = '1.0.0' } ) @@ -38,14 +38,18 @@ # TypesToProcess = @('xml\ADMF.Core.Types.ps1xml') # Format files (.ps1xml) to be loaded when importing this module - FormatsToProcess = @('xml\ADMF.Core.Format.ps1xml') + FormatsToProcess = @('xml\ADMF.Core.Format.ps1xml') # Functions to export from this module FunctionsToExport = @( 'Clear-AdcConfiguration' 'Compare-AdcProperty' 'Get-AdcExchangeVersion' + 'Get-AdcRemotingConfig' 'New-AdcChange' + 'New-AdcPSSession' + 'Remove-AdcRemotingConfig' + 'Set-AdcRemotingConfig' 'Sync-AdcObject' 'Write-AdcChangeLog' ) @@ -66,19 +70,19 @@ # FileList = @() # Private data to pass to the module specified in ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. - PrivateData = @{ + PrivateData = @{ #Support for PowerShellGet galleries. PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. - Tags = @('activedirectory', 'configuration', 'admf', 'management') + Tags = @('activedirectory', 'configuration', 'admf', 'management') # A URL to the license for this module. - LicenseUri = 'https://github.com/ActiveDirectoryManagementFramework/ADMF.Core/blob/master/LICENSE' + LicenseUri = 'https://github.com/ActiveDirectoryManagementFramework/ADMF.Core/blob/master/LICENSE' # A URL to the main website for this project. - ProjectUri = 'https://admf.one' + ProjectUri = 'https://admf.one' # A URL to an icon representing this module. # IconUri = '' diff --git a/ADMF.Core/changelog.md b/ADMF.Core/changelog.md index 0b106ca..ef54cde 100644 --- a/ADMF.Core/changelog.md +++ b/ADMF.Core/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 1.2.12 (2025-10-31) + +- New: Remoting config handling, to allow specifying the settings used during invocation. + ## 1.1.9 (2023-05-16) - New: Command Write-AdcChangeLog - Writes a log entry for change objects. @@ -23,6 +27,4 @@ ## 1.0.0 (2020-09-10) -- New: Some Stuff -- Upd: Moar Stuff -- Fix: Much Stuff \ No newline at end of file +- Initial Release diff --git a/ADMF.Core/en-us/strings.psd1 b/ADMF.Core/en-us/strings.psd1 index b6584b1..fcdcb47 100644 --- a/ADMF.Core/en-us/strings.psd1 +++ b/ADMF.Core/en-us/strings.psd1 @@ -4,6 +4,9 @@ 'Get-LdapObject.SearchError' = 'Failed to execute ldap request.' # 'Get-LdapObject.Searchfilter' = 'Searching with filter: {0}' # $LdapFilter 'Get-LdapObject.SearchRoot' = 'Searching {0} in {1}' # $SearchScope, $searcher.SearchRoot.Path + + 'New-AdcPSSession.Connecting' = 'Connecting via PS Remoting to {0}' # $ComputerName + 'New-AdcPSSession.Connecting.Config' = 'Remoting Config used for {0} | Target: {1} | Options: {2} | SSH: {3} | Parameters: {4}' # $ComputerName, $config.Target, $config.HasOptions, $config.UseSSH, @($config.Parameters).Count 'Sync-AdcObject.ConnectError' = 'Failed to connect to {0}' # $errorObject.TargetObject diff --git a/ADMF.Core/functions/Get-AdcExchangeVersion.ps1 b/ADMF.Core/functions/Exchange/Get-AdcExchangeVersion.ps1 similarity index 100% rename from ADMF.Core/functions/Get-AdcExchangeVersion.ps1 rename to ADMF.Core/functions/Exchange/Get-AdcExchangeVersion.ps1 diff --git a/ADMF.Core/functions/Remoting/Get-AdcRemotingConfig.ps1 b/ADMF.Core/functions/Remoting/Get-AdcRemotingConfig.ps1 new file mode 100644 index 0000000..3a0cfc6 --- /dev/null +++ b/ADMF.Core/functions/Remoting/Get-AdcRemotingConfig.ps1 @@ -0,0 +1,31 @@ +function Get-AdcRemotingConfig { + <# + .SYNOPSIS + Retrieve the list of remoting configurations. + + .DESCRIPTION + Retrieve the list of remoting configurations. + Remoting configurations apply to all remote connections via WinRM or - optionally - SSH. + They can be defined for specific servers or all machines in a domain. + + For more details, see Set-AdcRemotingConfig. + + .PARAMETER Target + The target the settings apply to. + Defaults to: * + + .EXAMPLE + PS C:\> Get-AdcRemotingConfig + + Retrieve the list of all remoting configurations. + #> + [CmdletBinding()] + param ( + [PsfArgumentCompleter('ADMF.Core.RemotingTarget')] + [string] + $Target = '*' + ) + process { + ($script:PSRemotingConfig.Values | Where-Object Target -Like $Target) + } +} \ No newline at end of file diff --git a/ADMF.Core/functions/Remoting/New-AdcPSSession.ps1 b/ADMF.Core/functions/Remoting/New-AdcPSSession.ps1 new file mode 100644 index 0000000..381efbf --- /dev/null +++ b/ADMF.Core/functions/Remoting/New-AdcPSSession.ps1 @@ -0,0 +1,71 @@ +function New-AdcPSSession { + <# + .SYNOPSIS + Establish a new PowerShell remoting session to the target computer. + + .DESCRIPTION + Establish a new PowerShell remoting session to the target computer. + Respects the configuration provided via Set-AdcRemotingConfig. + + .PARAMETER ComputerName + The computer to connect to. + Specify thhe full FQDN. + + .PARAMETER Credential + The credentials to use for the connection. + + .EXAMPLE + PS C:\> New-AdcPSSession -ComputerName dc1.contoso.com + + Establish a session to dc1.contoso.com using the settings for either dc1.contoso.com or contoso.com + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSPossibleIncorrectUsageOfAssignmentOperator", "")] + [CmdletBinding()] + param ( + [PSFComputer] + $ComputerName, + + [PSCredential] + $Credential + ) + process { + $credParam = @{} + if ($Credential) { $credParam.Credential = $Credential } + + $target = "$ComputerName" + $config = $null + do { + if ($config = $script:PSRemotingConfig[$target]) { break } + $null, $target = $target -split "\.", 2 + } + while ($target -match '\.') + + if (-not $config) { + Invoke-PSFProtectedCommand -ActionString 'New-AdcPSSession.Connecting' -ActionStringValues $ComputerName -ScriptBlock { + New-PSSession @credParam -ComputerName $ComputerName -ErrorAction Stop + } -Target $ComputerName -EnableException $true -PSCmdlet $PSCmdlet + return + } + + $param = $config.Parameters | ConvertTo-PSFHashtable -ReferenceCommand New-PSSession + if ($config.Options) { $param.SessionOption = $config.Options } + if (-not $config.UseSSH) { + $param.ComputerName = $ComputerName + if ($Credential) { $param.Credential = $Credential } + } + else { + $param.HostName = $ComputerName + if ($config.Ssh.UserName) { $param.UserName = $config.Ssh.UserName } + if ($config.Ssh.KeyFilePath) { $param.KeyFilePath = $config.Ssh.KeyFilePath } + if ($config.Ssh.Subsystem) { $param.Subsystem = $config.Ssh.Subsystem } + if ($config.Ssh.Transport) { $param.SSHTransport = $config.Ssh.Transport } + if ($config.Ssh.Options.Count -gt 0) { $param.Options = $config.Ssh.Options } + } + + Write-PSFMessage -Level Debug -String 'New-AdcPSSession.Connecting.Config' -StringValues $ComputerName, $config.Target, $config.HasOptions, $config.UseSSH, $config.Parameters.Count -Target $ComputerName -Data @{ Config = $config } + Invoke-PSFProtectedCommand -ActionString 'New-AdcPSSession.Connecting' -ActionStringValues $ComputerName -ScriptBlock { + New-PSSession @param -ErrorAction Stop + } -Target $ComputerName -EnableException $true -PSCmdlet $PSCmdlet + } +} \ No newline at end of file diff --git a/ADMF.Core/functions/Remoting/Remove-AdcRemotingConfig.ps1 b/ADMF.Core/functions/Remoting/Remove-AdcRemotingConfig.ps1 new file mode 100644 index 0000000..0f0b172 --- /dev/null +++ b/ADMF.Core/functions/Remoting/Remove-AdcRemotingConfig.ps1 @@ -0,0 +1,29 @@ +function Remove-AdcRemotingConfig { + <# + .SYNOPSIS + Removes a powershell remoting configuration. + + .DESCRIPTION + Removes a powershell remoting configuration. + Use Set-AdcRemotingConfig to define how connections to a target are established when calling New-AdcPSSession. + + .PARAMETER Target + The target the configuration applies to. + + .EXAMPLE + PS C:\> Remove-AdcRemotingConfig -Target contoso.com + + Removes a powershell remoting configuration targeting contoso.com. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] + [PsfArgumentCompleter('ADMF.Core.RemotingTarget')] + [string] + $Target + ) + process { + $null = $script:PSRemotingConfig.Remove($Target) + } +} \ No newline at end of file diff --git a/ADMF.Core/functions/Remoting/Set-AdcRemotingConfig.ps1 b/ADMF.Core/functions/Remoting/Set-AdcRemotingConfig.ps1 new file mode 100644 index 0000000..7bf3dbb --- /dev/null +++ b/ADMF.Core/functions/Remoting/Set-AdcRemotingConfig.ps1 @@ -0,0 +1,129 @@ +function Set-AdcRemotingConfig { + <# + .SYNOPSIS + Define the connection settings to use for PS remoting connections to the target. + + .DESCRIPTION + Define the connection settings to use for PS remoting connections to the target. + Target can be any specific host, domain or subdomain. + + For example, assuming these three targets have settings defined: + - contoso.com + - corp.contoso.com + - dc1.corp.contoso.com + + In this case, the most specific target wins: + - dc1.corp.contoso.com will select the "dc1.corp.contoso.com" config. + - dc2.corp.contoso.com will select the "corp.contoso.com" config. + - dc1.sales.contoso.com will select the "contoso.com" config. + + .PARAMETER Target + The target the configuration applies to. + + .PARAMETER Parameters + Parameters to use when establishing the connection. + Each key in the hashtable must map to a parameter on "New-PSSession". + Note: There are different parameters between PowerShell v5.1 and v7+. + + .PARAMETER SessionOption + A PowerShell session option item to apply. + This allows enabling proxy settings and other connection metadata. + + .PARAMETER UseSSH + Use SSH for the remoting connection. + Redundant if used with other SSH parameters. + + .PARAMETER SshUserName + The user name to use with SSH sessions. + + .PARAMETER SshKeyFilePath + The path to the key file for authenticating via SSH. + + .PARAMETER SshSubsystem + The Subsystem in the SSH server. + + .PARAMETER SshTransport + Whether to use SSH transport. + + .PARAMETER SshOption + The SSH options to include. + + .EXAMPLE + PS C:\> Set-AdcRemotingConfig -Target contoso.com -SessionOption $option + + Have all remoting connections to DCs in contoso.com use the specified options. + + .EXAMPLE + PS C:\> Set-AdcRemotingConfig -Target dc1.contoso.com -UseSSH + + Have all remoting connections to DC dc1.contoso.com use SSH. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")] + [CmdletBinding()] + param ( + [Parameter(Mandatory = $true)] + [PsfArgumentCompleter('ADMF.Core.RemotingTarget')] + [string] + $Target, + + [hashtable] + $Parameters, + + [System.Management.Automation.Remoting.PSSessionOption] + [AllowNull()] + $SessionOption, + + [switch] + $UseSSH, + + [string] + $SshUserName, + + [string] + $SshKeyFilePath, + + [string] + $SshSubsystem, + + [switch] + $SshTransport, + + [hashtable] + $SshOption + ) + process { + $config = $script:PSRemotingConfig[$Target] + if (-not $config) { + $config = [PSCustomObject]@{ + PSTypeName = 'ADMF.Core.RemotingConfig' + Target = $Target + HasOptions = $false + UseSSH = $false + Ssh = @{} + Options = $null + Parameters = @{} + } + } + + if ($UseSSH -or $PSBoundParameters.Keys -match '^Ssh') { $config.UseSSH = $true } + + if ($PSBoundParameters.Keys -contains 'SessionOption') { + if ($SessionOption) { + $config.UseSSH = $false + $config.Options = $SessionOption + } + else { $config.Options = $null } + } + if ($Parameters) { + $config.Parameters = $Parameters + } + if ($PSBoundParameters.Keys -contains 'SshUserName') { $config.Ssh.UserName = $SshUserName } + if ($PSBoundParameters.Keys -contains 'SshKeyFilePath') { $config.Ssh.KeyFilePath = $SshKeyFilePath } + if ($PSBoundParameters.Keys -contains 'SshSubsystem') { $config.Ssh.Subsystem = $SshSubsystem } + if ($PSBoundParameters.Keys -contains 'SshTransport') { $config.Ssh.Transport = $SshTransport.ToBool() } + if ($PSBoundParameters.Keys -contains 'SshOption') { $config.Ssh.Options = $SshOption } + + $config.HasOptions = $null -ne $config.Options + $script:PSRemotingConfig[$Target] = $config + } +} \ No newline at end of file diff --git a/ADMF.Core/functions/Clear-AdcConfiguration.ps1 b/ADMF.Core/functions/System/Clear-AdcConfiguration.ps1 similarity index 100% rename from ADMF.Core/functions/Clear-AdcConfiguration.ps1 rename to ADMF.Core/functions/System/Clear-AdcConfiguration.ps1 diff --git a/ADMF.Core/functions/Compare-AdcProperty.ps1 b/ADMF.Core/functions/System/Compare-AdcProperty.ps1 similarity index 100% rename from ADMF.Core/functions/Compare-AdcProperty.ps1 rename to ADMF.Core/functions/System/Compare-AdcProperty.ps1 diff --git a/ADMF.Core/functions/New-AdcChange.ps1 b/ADMF.Core/functions/System/New-AdcChange.ps1 similarity index 100% rename from ADMF.Core/functions/New-AdcChange.ps1 rename to ADMF.Core/functions/System/New-AdcChange.ps1 diff --git a/ADMF.Core/functions/Write-AdcChangeLog.ps1 b/ADMF.Core/functions/System/Write-AdcChangeLog.ps1 similarity index 100% rename from ADMF.Core/functions/Write-AdcChangeLog.ps1 rename to ADMF.Core/functions/System/Write-AdcChangeLog.ps1 diff --git a/ADMF.Core/internal/scripts/exchange.ps1 b/ADMF.Core/internal/scripts/exchange.ps1 index d619a64..ae4456e 100644 --- a/ADMF.Core/internal/scripts/exchange.ps1 +++ b/ADMF.Core/internal/scripts/exchange.ps1 @@ -1,61 +1,72 @@ # Useful source: https://eightwone.com/references/schema-versions/ $script:exchangeVersionMapping = @{ - '2013RTM' = [PSCustomObject]@{ Name = 'Exchange 2013 RTM'; DomainVersion = 13236; ConfigurationVersion = 15449; SchemaVersion = 15137; Binding = '2013RTM' } - '2013CU1' = [PSCustomObject]@{ Name = 'Exchange 2013 CU1'; DomainVersion = 13236; ConfigurationVersion = 15614; SchemaVersion = 15254; Binding = '2013CU1' } - '2013CU2' = [PSCustomObject]@{ Name = 'Exchange 2013 CU2'; DomainVersion = 13236; ConfigurationVersion = 15688; SchemaVersion = 15281; Binding = '2013CU2' } - '2013CU3' = [PSCustomObject]@{ Name = 'Exchange 2013 CU3'; DomainVersion = 13236; ConfigurationVersion = 15763; SchemaVersion = 15283; Binding = '2013CU3' } - '2013SP1' = [PSCustomObject]@{ Name = 'Exchange 2013 SP1'; DomainVersion = 13236; ConfigurationVersion = 15844; SchemaVersion = 15292; Binding = '2013SP1' } - '2013CU5' = [PSCustomObject]@{ Name = 'Exchange 2013 CU5'; DomainVersion = 13236; ConfigurationVersion = 15870; SchemaVersion = 15300; Binding = '2013CU5' } - '2013CU6' = [PSCustomObject]@{ Name = 'Exchange 2013 CU6'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15303; Binding = '2013CU6' } - '2013CU7' = [PSCustomObject]@{ Name = 'Exchange 2013 CU7'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15312; Binding = '2013CU7' } - '2013CU8' = [PSCustomObject]@{ Name = 'Exchange 2013 CU8'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15312; Binding = '2013CU8' } - '2013CU9' = [PSCustomObject]@{ Name = 'Exchange 2013 CU9'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15312; Binding = '2013CU9' } - '2013CU10' = [PSCustomObject]@{ Name = 'Exchange 2013 CU10'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU10' } - '2013CU11' = [PSCustomObject]@{ Name = 'Exchange 2013 CU11'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU11' } - '2013CU12' = [PSCustomObject]@{ Name = 'Exchange 2013 CU12'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU12' } - '2013CU13' = [PSCustomObject]@{ Name = 'Exchange 2013 CU13'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU13' } - '2013CU14' = [PSCustomObject]@{ Name = 'Exchange 2013 CU14'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU14' } - '2013CU15' = [PSCustomObject]@{ Name = 'Exchange 2013 CU15'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU15' } - '2013CU16' = [PSCustomObject]@{ Name = 'Exchange 2013 CU16'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU16' } - '2013CU17' = [PSCustomObject]@{ Name = 'Exchange 2013 CU17'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU17' } - '2013CU18' = [PSCustomObject]@{ Name = 'Exchange 2013 CU18'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU18' } - '2013CU19' = [PSCustomObject]@{ Name = 'Exchange 2013 CU19'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU19' } - '2013CU20' = [PSCustomObject]@{ Name = 'Exchange 2013 CU20'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU20' } - '2013CU21' = [PSCustomObject]@{ Name = 'Exchange 2013 CU21'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU21' } - '2013CU22' = [PSCustomObject]@{ Name = 'Exchange 2013 CU22'; DomainVersion = 13236; ConfigurationVersion = 16131; SchemaVersion = 15312; Binding = '2013CU22' } - '2013CU23' = [PSCustomObject]@{ Name = 'Exchange 2013 CU23'; DomainVersion = 13237; ConfigurationVersion = 16133; SchemaVersion = 15312; Binding = '2013CU23' } + '2013RTM' = [PSCustomObject]@{ Name = 'Exchange 2013 RTM'; DomainVersion = 13236; ConfigurationVersion = 15449; SchemaVersion = 15137; Binding = '2013RTM' } + '2013CU1' = [PSCustomObject]@{ Name = 'Exchange 2013 CU1'; DomainVersion = 13236; ConfigurationVersion = 15614; SchemaVersion = 15254; Binding = '2013CU1' } + '2013CU2' = [PSCustomObject]@{ Name = 'Exchange 2013 CU2'; DomainVersion = 13236; ConfigurationVersion = 15688; SchemaVersion = 15281; Binding = '2013CU2' } + '2013CU3' = [PSCustomObject]@{ Name = 'Exchange 2013 CU3'; DomainVersion = 13236; ConfigurationVersion = 15763; SchemaVersion = 15283; Binding = '2013CU3' } + '2013SP1' = [PSCustomObject]@{ Name = 'Exchange 2013 SP1'; DomainVersion = 13236; ConfigurationVersion = 15844; SchemaVersion = 15292; Binding = '2013SP1' } + '2013CU5' = [PSCustomObject]@{ Name = 'Exchange 2013 CU5'; DomainVersion = 13236; ConfigurationVersion = 15870; SchemaVersion = 15300; Binding = '2013CU5' } + '2013CU6' = [PSCustomObject]@{ Name = 'Exchange 2013 CU6'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15303; Binding = '2013CU6' } + '2013CU7' = [PSCustomObject]@{ Name = 'Exchange 2013 CU7'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15312; Binding = '2013CU7' } + '2013CU8' = [PSCustomObject]@{ Name = 'Exchange 2013 CU8'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15312; Binding = '2013CU8' } + '2013CU9' = [PSCustomObject]@{ Name = 'Exchange 2013 CU9'; DomainVersion = 13236; ConfigurationVersion = 15965; SchemaVersion = 15312; Binding = '2013CU9' } + '2013CU10' = [PSCustomObject]@{ Name = 'Exchange 2013 CU10'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU10' } + '2013CU11' = [PSCustomObject]@{ Name = 'Exchange 2013 CU11'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU11' } + '2013CU12' = [PSCustomObject]@{ Name = 'Exchange 2013 CU12'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU12' } + '2013CU13' = [PSCustomObject]@{ Name = 'Exchange 2013 CU13'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU13' } + '2013CU14' = [PSCustomObject]@{ Name = 'Exchange 2013 CU14'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU14' } + '2013CU15' = [PSCustomObject]@{ Name = 'Exchange 2013 CU15'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU15' } + '2013CU16' = [PSCustomObject]@{ Name = 'Exchange 2013 CU16'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU16' } + '2013CU17' = [PSCustomObject]@{ Name = 'Exchange 2013 CU17'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU17' } + '2013CU18' = [PSCustomObject]@{ Name = 'Exchange 2013 CU18'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU18' } + '2013CU19' = [PSCustomObject]@{ Name = 'Exchange 2013 CU19'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU19' } + '2013CU20' = [PSCustomObject]@{ Name = 'Exchange 2013 CU20'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU20' } + '2013CU21' = [PSCustomObject]@{ Name = 'Exchange 2013 CU21'; DomainVersion = 13236; ConfigurationVersion = 16130; SchemaVersion = 15312; Binding = '2013CU21' } + '2013CU22' = [PSCustomObject]@{ Name = 'Exchange 2013 CU22'; DomainVersion = 13236; ConfigurationVersion = 16131; SchemaVersion = 15312; Binding = '2013CU22' } + '2013CU23' = [PSCustomObject]@{ Name = 'Exchange 2013 CU23'; DomainVersion = 13237; ConfigurationVersion = 16133; SchemaVersion = 15312; Binding = '2013CU23' } + '2016Preview' = [PSCustomObject]@{ Name = 'Exchange 2016 Preview'; DomainVersion = 13236; ConfigurationVersion = 16041; SchemaVersion = 15317; Binding = '2016Preview' } - '2016RTM' = [PSCustomObject]@{ Name = 'Exchange 2016 RTM'; DomainVersion = 13236; ConfigurationVersion = 16210; SchemaVersion = 15317; Binding = '2016RTM' } - '2016CU1' = [PSCustomObject]@{ Name = 'Exchange 2016 CU1'; DomainVersion = 13236; ConfigurationVersion = 16211; SchemaVersion = 15323; Binding = '2016CU1' } - '2016CU2' = [PSCustomObject]@{ Name = 'Exchange 2016 CU2'; DomainVersion = 13236; ConfigurationVersion = 16212; SchemaVersion = 15325; Binding = '2016CU2' } - '2016CU3' = [PSCustomObject]@{ Name = 'Exchange 2016 CU3'; DomainVersion = 13236; ConfigurationVersion = 16212; SchemaVersion = 15326; Binding = '2016CU3' } - '2016CU4' = [PSCustomObject]@{ Name = 'Exchange 2016 CU4'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15326; Binding = '2016CU4' } - '2016CU5' = [PSCustomObject]@{ Name = 'Exchange 2016 CU5'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15326; Binding = '2016CU5' } - '2016CU6' = [PSCustomObject]@{ Name = 'Exchange 2016 CU6'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15330; Binding = '2016CU6' } - '2016CU7' = [PSCustomObject]@{ Name = 'Exchange 2016 CU7'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU7' } - '2016CU8' = [PSCustomObject]@{ Name = 'Exchange 2016 CU8'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU8' } - '2016CU9' = [PSCustomObject]@{ Name = 'Exchange 2016 CU9'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU9' } - '2016CU10' = [PSCustomObject]@{ Name = 'Exchange 2016 CU10'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU10' } - '2016CU11' = [PSCustomObject]@{ Name = 'Exchange 2016 CU11'; DomainVersion = 13236; ConfigurationVersion = 16214; SchemaVersion = 15332; Binding = '2016CU11' } - '2016CU12' = [PSCustomObject]@{ Name = 'Exchange 2016 CU12'; DomainVersion = 13236; ConfigurationVersion = 16215; SchemaVersion = 15332; Binding = '2016CU12' } - '2016CU13' = [PSCustomObject]@{ Name = 'Exchange 2016 CU13'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU13' } - '2016CU14' = [PSCustomObject]@{ Name = 'Exchange 2016 CU14'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU14' } - '2016CU15' = [PSCustomObject]@{ Name = 'Exchange 2016 CU15'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU15' } - '2016CU16' = [PSCustomObject]@{ Name = 'Exchange 2016 CU16'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU16' } - '2016CU17' = [PSCustomObject]@{ Name = 'Exchange 2016 CU17'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU17' } - '2016CU18' = [PSCustomObject]@{ Name = 'Exchange 2016 CU18'; DomainVersion = 13238; ConfigurationVersion = 16218; SchemaVersion = 15332; Binding = '2016CU18' } - '2016CU19' = [PSCustomObject]@{ Name = 'Exchange 2016 CU19'; DomainVersion = 13239; ConfigurationVersion = 16219; SchemaVersion = 15333; Binding = '2016CU19' } + '2016RTM' = [PSCustomObject]@{ Name = 'Exchange 2016 RTM'; DomainVersion = 13236; ConfigurationVersion = 16210; SchemaVersion = 15317; Binding = '2016RTM' } + '2016CU1' = [PSCustomObject]@{ Name = 'Exchange 2016 CU1'; DomainVersion = 13236; ConfigurationVersion = 16211; SchemaVersion = 15323; Binding = '2016CU1' } + '2016CU2' = [PSCustomObject]@{ Name = 'Exchange 2016 CU2'; DomainVersion = 13236; ConfigurationVersion = 16212; SchemaVersion = 15325; Binding = '2016CU2' } + '2016CU3' = [PSCustomObject]@{ Name = 'Exchange 2016 CU3'; DomainVersion = 13236; ConfigurationVersion = 16212; SchemaVersion = 15326; Binding = '2016CU3' } + '2016CU4' = [PSCustomObject]@{ Name = 'Exchange 2016 CU4'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15326; Binding = '2016CU4' } + '2016CU5' = [PSCustomObject]@{ Name = 'Exchange 2016 CU5'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15326; Binding = '2016CU5' } + '2016CU6' = [PSCustomObject]@{ Name = 'Exchange 2016 CU6'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15330; Binding = '2016CU6' } + '2016CU7' = [PSCustomObject]@{ Name = 'Exchange 2016 CU7'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU7' } + '2016CU8' = [PSCustomObject]@{ Name = 'Exchange 2016 CU8'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU8' } + '2016CU9' = [PSCustomObject]@{ Name = 'Exchange 2016 CU9'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU9' } + '2016CU10' = [PSCustomObject]@{ Name = 'Exchange 2016 CU10'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2016CU10' } + '2016CU11' = [PSCustomObject]@{ Name = 'Exchange 2016 CU11'; DomainVersion = 13236; ConfigurationVersion = 16214; SchemaVersion = 15332; Binding = '2016CU11' } + '2016CU12' = [PSCustomObject]@{ Name = 'Exchange 2016 CU12'; DomainVersion = 13236; ConfigurationVersion = 16215; SchemaVersion = 15332; Binding = '2016CU12' } + '2016CU13' = [PSCustomObject]@{ Name = 'Exchange 2016 CU13'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU13' } + '2016CU14' = [PSCustomObject]@{ Name = 'Exchange 2016 CU14'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU14' } + '2016CU15' = [PSCustomObject]@{ Name = 'Exchange 2016 CU15'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU15' } + '2016CU16' = [PSCustomObject]@{ Name = 'Exchange 2016 CU16'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU16' } + '2016CU17' = [PSCustomObject]@{ Name = 'Exchange 2016 CU17'; DomainVersion = 13237; ConfigurationVersion = 16217; SchemaVersion = 15332; Binding = '2016CU17' } + '2016CU18' = [PSCustomObject]@{ Name = 'Exchange 2016 CU18'; DomainVersion = 13238; ConfigurationVersion = 16218; SchemaVersion = 15332; Binding = '2016CU18' } + '2016CU19' = [PSCustomObject]@{ Name = 'Exchange 2016 CU19'; DomainVersion = 13239; ConfigurationVersion = 16219; SchemaVersion = 15333; Binding = '2016CU19' } + '2016CU20' = [PSCustomObject]@{ Name = 'Exchange 2016 CU20'; DomainVersion = 13240; ConfigurationVersion = 16220; SchemaVersion = 15333; Binding = '2016CU20' } + '2016CU21' = [PSCustomObject]@{ Name = 'Exchange 2016 CU21'; DomainVersion = 13241; ConfigurationVersion = 16221; SchemaVersion = 15334; Binding = '2016CU21' } + '2016CU22' = [PSCustomObject]@{ Name = 'Exchange 2016 CU22'; DomainVersion = 13242; ConfigurationVersion = 16222; SchemaVersion = 15334; Binding = '2016CU22' } + '2016CU22KB' = [PSCustomObject]@{ Name = 'Exchange 2016 CU22 KB5014260'; DomainVersion = 13243; ConfigurationVersion = 16222; SchemaVersion = 15334; Binding = '2016CU22KB' } + '2016CU23' = [PSCustomObject]@{ Name = 'Exchange 2016 CU23'; DomainVersion = 13243; ConfigurationVersion = 16223; SchemaVersion = 15334; Binding = '2016CU23' } + '2019Preview' = [PSCustomObject]@{ Name = 'Exchange 2019 Preview'; DomainVersion = 13236; ConfigurationVersion = 16213; SchemaVersion = 15332; Binding = '2019Preview' } - '2019RTM' = [PSCustomObject]@{ Name = 'Exchange 2019 RTM'; DomainVersion = 13236; ConfigurationVersion = 16751; SchemaVersion = 17000; Binding = '2019RTM' } - '2019CU1' = [PSCustomObject]@{ Name = 'Exchange 2019 CU1'; DomainVersion = 13236; ConfigurationVersion = 16752; SchemaVersion = 17000; Binding = '2019CU1' } - '2019CU2' = [PSCustomObject]@{ Name = 'Exchange 2019 CU2'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU2' } - '2019CU3' = [PSCustomObject]@{ Name = 'Exchange 2019 CU3'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU3' } - '2019CU4' = [PSCustomObject]@{ Name = 'Exchange 2019 CU4'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU4' } - '2019CU5' = [PSCustomObject]@{ Name = 'Exchange 2019 CU5'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU5' } - '2019CU6' = [PSCustomObject]@{ Name = 'Exchange 2019 CU6'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU6' } - '2019CU7' = [PSCustomObject]@{ Name = 'Exchange 2019 CU7'; DomainVersion = 13238; ConfigurationVersion = 16755; SchemaVersion = 17001; Binding = '2019CU7' } - '2019CU8' = [PSCustomObject]@{ Name = 'Exchange 2019 CU8'; DomainVersion = 13239; ConfigurationVersion = 16756; SchemaVersion = 17002; Binding = '2019CU8' } - '2019CU9' = [PSCustomObject]@{ Name = 'Exchange 2019 CU9'; DomainVersion = 13240; ConfigurationVersion = 16757; SchemaVersion = 17002; Binding = '2019CU9' } - '2019CU10' = [PSCustomObject]@{ Name = 'Exchange 2019 CU10'; DomainVersion = 13241; ConfigurationVersion = 16758; SchemaVersion = 17003; Binding = '2019CU10' } - '2019CU11' = [PSCustomObject]@{ Name = 'Exchange 2019 CU11'; DomainVersion = 13242; ConfigurationVersion = 16759; SchemaVersion = 17003; Binding = '2019CU11' } + '2019RTM' = [PSCustomObject]@{ Name = 'Exchange 2019 RTM'; DomainVersion = 13236; ConfigurationVersion = 16751; SchemaVersion = 17000; Binding = '2019RTM' } + '2019CU1' = [PSCustomObject]@{ Name = 'Exchange 2019 CU1'; DomainVersion = 13236; ConfigurationVersion = 16752; SchemaVersion = 17000; Binding = '2019CU1' } + '2019CU2' = [PSCustomObject]@{ Name = 'Exchange 2019 CU2'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU2' } + '2019CU3' = [PSCustomObject]@{ Name = 'Exchange 2019 CU3'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU3' } + '2019CU4' = [PSCustomObject]@{ Name = 'Exchange 2019 CU4'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU4' } + '2019CU5' = [PSCustomObject]@{ Name = 'Exchange 2019 CU5'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU5' } + '2019CU6' = [PSCustomObject]@{ Name = 'Exchange 2019 CU6'; DomainVersion = 13237; ConfigurationVersion = 16754; SchemaVersion = 17001; Binding = '2019CU6' } + '2019CU7' = [PSCustomObject]@{ Name = 'Exchange 2019 CU7'; DomainVersion = 13238; ConfigurationVersion = 16755; SchemaVersion = 17001; Binding = '2019CU7' } + '2019CU8' = [PSCustomObject]@{ Name = 'Exchange 2019 CU8'; DomainVersion = 13239; ConfigurationVersion = 16756; SchemaVersion = 17002; Binding = '2019CU8' } + '2019CU9' = [PSCustomObject]@{ Name = 'Exchange 2019 CU9'; DomainVersion = 13240; ConfigurationVersion = 16757; SchemaVersion = 17002; Binding = '2019CU9' } + '2019CU10' = [PSCustomObject]@{ Name = 'Exchange 2019 CU10'; DomainVersion = 13241; ConfigurationVersion = 16758; SchemaVersion = 17003; Binding = '2019CU10' } + '2019CU11' = [PSCustomObject]@{ Name = 'Exchange 2019 CU11'; DomainVersion = 13242; ConfigurationVersion = 16759; SchemaVersion = 17003; Binding = '2019CU11' } + '2019CU12' = [PSCustomObject]@{ Name = 'Exchange 2019 CU12'; DomainVersion = 13243; ConfigurationVersion = 16760; SchemaVersion = 17003; Binding = '2019CU12' } + '2019CU13' = [PSCustomObject]@{ Name = 'Exchange 2019 CU13'; DomainVersion = 13243; ConfigurationVersion = 16761; SchemaVersion = 17003; Binding = '2019CU13' } + '2019CU14' = [PSCustomObject]@{ Name = 'Exchange 2019 CU14'; DomainVersion = 13243; ConfigurationVersion = 16762; SchemaVersion = 17003; Binding = '2019CU14' } + '2019CU15' = [PSCustomObject]@{ Name = 'Exchange 2019 CU15'; DomainVersion = 13243; ConfigurationVersion = 16763; SchemaVersion = 17003; Binding = '2019CU15' } } \ No newline at end of file diff --git a/ADMF.Core/internal/scripts/postimport.ps1 b/ADMF.Core/internal/scripts/postimport.ps1 index 227b5fb..bad3260 100644 --- a/ADMF.Core/internal/scripts/postimport.ps1 +++ b/ADMF.Core/internal/scripts/postimport.ps1 @@ -24,6 +24,7 @@ $moduleRoot = Split-Path (Split-Path $PSScriptRoot) # Load Variables "$moduleRoot\internal\scripts\variables.ps1" +"$moduleRoot\internal\scripts\variables_persistent.ps1" # Load Exchange Data "$moduleRoot\internal\scripts\exchange.ps1" diff --git a/ADMF.Core/internal/scripts/variables_persistent.ps1 b/ADMF.Core/internal/scripts/variables_persistent.ps1 new file mode 100644 index 0000000..efd1039 --- /dev/null +++ b/ADMF.Core/internal/scripts/variables_persistent.ps1 @@ -0,0 +1,4 @@ +# Configuration Entries for remoting +$script:PSRemotingConfig = @{ + +} \ No newline at end of file diff --git a/ADMF.Core/internal/tepp/exchange.tepp.ps1 b/ADMF.Core/internal/tepp/exchange.tepp.ps1 index b177ab2..0543f00 100644 --- a/ADMF.Core/internal/tepp/exchange.tepp.ps1 +++ b/ADMF.Core/internal/tepp/exchange.tepp.ps1 @@ -7,4 +7,4 @@ Register-PSFTeppScriptblock -Name 'ADMF.Core.ExchangeVersion' -ScriptBlock { & (Get-Module ADMF.Core) { $script:exchangeVersionMapping.Keys } -} \ No newline at end of file +} -Global \ No newline at end of file diff --git a/ADMF.Core/internal/tepp/remoting.tepp.ps1 b/ADMF.Core/internal/tepp/remoting.tepp.ps1 new file mode 100644 index 0000000..6c5e3ff --- /dev/null +++ b/ADMF.Core/internal/tepp/remoting.tepp.ps1 @@ -0,0 +1,3 @@ +Register-PSFTeppScriptblock -Name 'ADMF.Core.RemotingTarget' -ScriptBlock { + (Get-AdcRemotingConfig).Target +} -Global \ No newline at end of file diff --git a/ADMF.Core/xml/ADMF.Core.Format.ps1xml b/ADMF.Core/xml/ADMF.Core.Format.ps1xml index 55cb762..5fa312d 100644 --- a/ADMF.Core/xml/ADMF.Core.Format.ps1xml +++ b/ADMF.Core/xml/ADMF.Core.Format.ps1xml @@ -1,39 +1,74 @@  - - - - ADMF.Core.ExchangeVersion - - ADMF.Core.ExchangeVersion - - - - - - - - - - - - - - Name - - - DomainVersion - - - ConfigurationVersion - - - SchemaVersion - - - - - - - + + + + ADMF.Core.ExchangeVersion + + ADMF.Core.ExchangeVersion + + + + + + + + + + + + + + Name + + + DomainVersion + + + ConfigurationVersion + + + SchemaVersion + + + + + + + + + + ADMF.Core.RemotingConfig + + ADMF.Core.RemotingConfig + + + + + + + + + + + + + + Target + + + HasOptions + + + UseSSH + + + Parameters + + + + + + + \ No newline at end of file