Skip to content

Commit

Permalink
Merge pull request #15 from microsoft/Dev
Browse files Browse the repository at this point in the history
Update my fork
  • Loading branch information
ThorstenLoeschmann authored Jun 24, 2019
2 parents 29cf95d + 6cefb97 commit caa361f
Show file tree
Hide file tree
Showing 87 changed files with 3,610 additions and 2,745 deletions.
4 changes: 2 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ codecov:
notify:
require_ci_to_pass: no
# dev should be the baseline for reporting
branch: dev
branch: Dev

comment:
layout: "reach, diff"
behavior: default

coverage:
range: 50..80
range: 70..90
round: down
precision: 0

Expand Down
53 changes: 53 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @nikcharlebois

/Modules/Office365DSC/DSCResources/MSFT_EXOAcceptedDomain/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOAntiPhishPolicy/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_AntiPhishRule/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOAtpPolicyForO365/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOCASMailboxPlan/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOClientAccessRule/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_DkimSigningConfig/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedConnectionFilterPolicy/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedContentFilterPolicy/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedCOntentFilterRule/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOHostedOutboundSpamFilterPolicy/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOMailboxSettings/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOMailTips/ @poiriersimon
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeAttachmentPolicy/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeAttachmentRule/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeLinksPolicy/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOSafeLinksRule/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_EXOSharedMailbox/ @nikcharlebois

/Modules/Office365DSC/DSCResources/MSFT_O365AdminAuditLogConfig/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_O365Group/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_O365User/ @nikcharlebois

/Modules/Office365DSC/DSCResources/MSFT_ODSettings/ @desmay

/Modules/Office365DSC/DSCResources/MSFT_SCRetentionCompliancePolicy/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_SCRetentionComplianceRule/ @nikcharlebois

/Modules/Office365DSC/DSCResources/MSFT_SPOAccessControlSettings/ @thorstenloeschmann
/Modules/Office365DSC/DSCResources/MSFT_SPOApp/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_SPOHubSite/ @ykuijs
/Modules/Office365DSC/DSCResources/MSFT_SPOSearchManagedProperty/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_SPOSearchResultSource/ @nikcharlebois
/Modules/Office365DSC/DSCResources/MSFT_SPOSharingSettings/ @thorstenloeschmann
/Modules/Office365DSC/DSCResources/MSFT_SPOSite/ @thorstenloeschmann
/Modules/Office365DSC/DSCResources/MSFT_SPOSiteDesign/ @thorstenloeschmann
/Modules/Office365DSC/DSCResources/MSFT_SPOSiteDesignRights/ @thorstenloeschmann
/Modules/Office365DSC/DSCResources/MSFT_SPOStorageEntity/ @thorstenloeschmann
/Modules/Office365DSC/DSCResources/MSFT_SPOTenantSettings/ @thorstenloeschmann
/Modules/Office365DSC/DSCResources/MSFT_SPOTheme/ @thorstenloeschmann


/Modules/Office365DSC/DSCResources/MSFT_TeamsTeam/ @desmay
/Modules/Office365DSC/DSCResources/MSFT_TeamsChannel/ @desmay
/Modules/Office365DSC/DSCResources/MSFT_TeamsUser/ @desmay

/Modules/Office365DSC/Modules/ @nikcharlebois
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

## Unreleased

* Exchange Online Workload Major Refactoring and GUI Changes
* SCRetentionCompliancePolicy
* Initial Release
* SCRetentionComplianceRule
* Initial Release
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,26 @@ function Get-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
Write-Verbose "Get-TargetResource will attempt to retrieve Accepted Domain configuration for $($Identity)"

Write-Verbose -Message "Getting configuration of Accepted Domain for $Identity"

Connect-ExchangeOnline -GlobalAdminAccount $GlobalAdminAccount
$AllAcceptedDomains = Get-AcceptedDomain

$AcceptedDomain = ($AllAcceptedDomains | Where-Object Identity -IMatch $Identity)
$AcceptedDomain = ($AllAcceptedDomains | Where-Object -FilterScript { $_.Identity -IMatch $Identity })

if (!$AcceptedDomain)
if ($null -eq $AcceptedDomain)
{
Write-Verbose "AcceptedDomain configuration for $($Identity) does not exist."
Write-Verbose -Message "AcceptedDomain configuration for $($Identity) does not exist."

# Check to see if $Identity matches a verified domain in the O365 Tenant
Test-O365ServiceConnection -GlobalAdminAccount $GlobalAdminAccount
$VerifiedDomains = Get-AzureADDomain | Where-Object {$_.IsVerified}
$MatchingVerifiedDomain = $VerifiedDomains | Where-Object {$_.Name -eq $Identity}
$VerifiedDomains = Get-AzureADDomain | Where-Object -FilterScript { $_.IsVerified }
$MatchingVerifiedDomain = $VerifiedDomains | Where-Object -FilterScript { $_.Name -eq $Identity }

if ($null -ne $MatchingVerifiedDomain)
{
Write-Verbose "A verified domain matching $($Identity) does not exist in this O365 Tenant."
Write-Verbose -Message "A verified domain matching $($Identity) does not exist in this O365 Tenant."
$nullReturn = @{
DomainType = $DomainType
Ensure = $Ensure
Expand Down Expand Up @@ -90,7 +92,7 @@ function Get-TargetResource
OutboundOnly = $AcceptedDomain.OutboundOnly
}

Write-Verbose "Found AcceptedDomain configuration for $($Identity)"
Write-Verbose -Message "Found AcceptedDomain configuration for $($Identity)"
return $result
}
}
Expand Down Expand Up @@ -129,7 +131,9 @@ function Set-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
Write-Verbose 'Entering Set-TargetResource'

Write-Verbose -Message "Setting configuration of Accepted Domain for $Identity"

Connect-ExchangeOnline -GlobalAdminAccount $GlobalAdminAccount
$AcceptedDomainParams = @{
DomainType = $DomainType
Expand All @@ -138,7 +142,7 @@ function Set-TargetResource
OutboundOnly = $OutboundOnly
}

Write-Verbose "Setting AcceptedDomain for $($Identity) with values: $($AcceptedDomainParams | Out-String)"
Write-Verbose -Message "Setting AcceptedDomain for $($Identity) with values: $(Convert-O365DscHashtableToString -Hashtable $AcceptedDomainParams)"
Set-AcceptedDomain @AcceptedDomainParams
}

Expand Down Expand Up @@ -177,21 +181,22 @@ function Test-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
Write-Verbose -Message "Testing AcceptedDomain for $($Identity)"

Write-Verbose -Message "Testing configuration of Accepted Domain for $Identity"

$CurrentValues = Get-TargetResource @PSBoundParameters

Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"

$ValuesToCheck = $PSBoundParameters
$ValuesToCheck.Remove('GlobalAdminAccount') | out-null
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null

$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck $ValuesToCheck.Keys
if ($TestResult)
{
Write-Verbose 'Test-TargetResource returned True'
}
else
{
Write-Verbose 'Test-TargetResource returned False'
}
-DesiredValues $PSBoundParameters `
-ValuesToCheck $ValuesToCheck.Keys

Write-Verbose -Message "Test-TargetResource returned $TestResult"

return $TestResult
}
Expand All @@ -203,7 +208,7 @@ function Export-TargetResource
param
(
[Parameter(Mandatory = $true)]
[ValidatePattern( '(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]{1,63}(?<!-)\.?)+(?:[a-zA-Z]{2,})$)' )]
[ValidatePattern('(?=^.{1,254}$)(^(?:(?!\d+\.|-)[a-zA-Z0-9_\-]{1,63}(?<!-)\.?)+(?:[a-zA-Z]{2,})$)' )]
[System.String]
$Identity,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,16 @@ function Get-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
Write-Verbose "Get-TargetResource will attempt to retrieve AntiPhishPolicy $($Identity)"

Write-Verbose -Message "Getting configuration of AntiPhishPolicy for $Identity"

Connect-ExchangeOnline -GlobalAdminAccount $GlobalAdminAccount
$AntiPhishPolicies = Get-AntiPhishPolicy

$AntiPhishPolicy = $AntiPhishPolicies | Where-Object Identity -eq $Identity
if (-NOT $AntiPhishPolicy)
$AntiPhishPolicy = $AntiPhishPolicies | Where-Object -FilterScript { $_.Identity -eq $Identity }
if ($null -eq $AntiPhishPolicy)
{
Write-Verbose "AntiPhishPolicy $($Identity) does not exist."
Write-Verbose -Message "AntiPhishPolicy $($Identity) does not exist."
$result = $PSBoundParameters
$result.Ensure = 'Absent'
return $result
Expand All @@ -135,7 +137,7 @@ function Get-TargetResource
Ensure = 'Present'
}

foreach ($KeyName in ($PSBoundParameters.Keys | Where-Object {$_ -ne 'Ensure'}) )
foreach ($KeyName in ($PSBoundParameters.Keys | Where-Object -FilterScript { $_ -ne 'Ensure' }))
{
if ($null -ne $AntiPhishPolicy.$KeyName)
{
Expand All @@ -151,8 +153,8 @@ function Get-TargetResource
}
}

Write-Verbose "Found AntiPhishPolicy $($Identity)"
Write-Verbose "Get-TargetResource Result: `n $($result | Out-String)"
Write-Verbose -Message "Found AntiPhishPolicy $($Identity)"
Write-Verbose -Message "Get-TargetResource Result: `n $(Convert-O365DscHashtableToString -Hashtable $result)"
return $result
}
}
Expand Down Expand Up @@ -275,27 +277,29 @@ function Set-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
Write-Verbose 'Entering Set-TargetResource'

Write-Verbose -Message "Setting configuration of AntiPhishPolicy for $Identity"

Connect-ExchangeOnline -GlobalAdminAccount $GlobalAdminAccount
$AntiPhishPolicies = Get-AntiPhishPolicy

$AntiPhishPolicy = $AntiPhishPolicies | Where-Object Identity -eq $Identity
$AntiPhishPolicy = $AntiPhishPolicies | Where-Object -FilterScript { $_.Identity -eq $Identity }

if ( ('Present' -eq $Ensure ) -and (-NOT $AntiPhishPolicy) )
if (('Present' -eq $Ensure ) -and (-not $AntiPhishPolicy))
{
New-EXOAntiPhishPolicy -AntiPhishPolicyParams $PSBoundParameters
Start-Sleep -Seconds 1
Set-EXOAntiPhishPolicy -AntiPhishPolicyParams $PSBoundParameters
}

if ( ('Present' -eq $Ensure ) -and ($AntiPhishPolicy) )
if (('Present' -eq $Ensure ) -and ($AntiPhishPolicy))
{
Set-EXOAntiPhishPolicy -AntiPhishPolicyParams $PSBoundParameters
}

if ( ('Absent' -eq $Ensure ) -and ($AntiPhishPolicy) )
if (('Absent' -eq $Ensure ) -and ($AntiPhishPolicy))
{
Write-Verbose "Removing AntiPhishPolicy $($Identity)"
Write-Verbose -Message "Removing AntiPhishPolicy $($Identity)"
Remove-AntiPhishPolicy -Identity $Identity -Confirm:$false -Force
}
}
Expand Down Expand Up @@ -419,21 +423,22 @@ function Test-TargetResource
[System.Management.Automation.PSCredential]
$GlobalAdminAccount
)
Write-Verbose -Message "Testing AntiPhishPolicy for $($Identity)"

Write-Verbose -Message "Testing configuration of AntiPhishPolicy for $Identity"

$CurrentValues = Get-TargetResource @PSBoundParameters

Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"

$ValuesToCheck = $PSBoundParameters
$ValuesToCheck.Remove('GlobalAdminAccount') | out-null
$ValuesToCheck.Remove('GlobalAdminAccount') | Out-Null

$TestResult = Test-Office365DSCParameterState -CurrentValues $CurrentValues `
-DesiredValues $PSBoundParameters `
-ValuesToCheck $ValuesToCheck.Keys
if ($TestResult)
{
Write-Verbose 'Test-TargetResource returned True'
}
else
{
Write-Verbose 'Test-TargetResource returned False'
}
-DesiredValues $PSBoundParameters `
-ValuesToCheck $ValuesToCheck.Keys

Write-Verbose -Message "Test-TargetResource returned $TestResult"

return $TestResult
}
Expand Down
Loading

0 comments on commit caa361f

Please sign in to comment.