Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Performance Improvement - Addresses #5615 #5629

Merged
merged 68 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
e63acc1
AADAdministrativeUnit - Improves export performance
niwamo Jan 7, 2025
3a76bb8
AADApplication - Improves export performance
niwamo Jan 7, 2025
42b3dae
AADAuthenticationMethodPolicy - Improves export performance
niwamo Jan 7, 2025
7bda829
AADAuthenticationStrengthPolicy - Improves export performance
niwamo Jan 7, 2025
91bf4eb
AADConditionalAccessPolicy - Improves export performance
niwamo Jan 7, 2025
0ebdeff
AADGroup - Improves export performance
niwamo Jan 7, 2025
d0a2fe0
AADNamedLocationPolicy - Improves export performance
niwamo Jan 7, 2025
c83dd0b
AADRoleDefinition - Improves export performance
niwamo Jan 7, 2025
bfa680c
AADRoleSetting - Improves export performance
niwamo Jan 8, 2025
a940ac9
AADServicePrincipal - Improves export performance
niwamo Jan 8, 2025
b04ef6a
AADSocialIdentityProvider - Improves export performance
niwamo Jan 8, 2025
57229f6
AADTokenLifetimePolicy - Improves export performance
niwamo Jan 8, 2025
931fb5f
AADUser - Improves export performance
niwamo Jan 8, 2025
2c7dc28
EXOAddressList - Improves export performance
niwamo Jan 14, 2025
5cf1902
EXODataClassification - Improves export performance
niwamo Jan 14, 2025
bc9a362
EXODistributionGroup - Improves export performance
niwamo Jan 14, 2025
da73093
EXOGlobalAddressList - Improves export performance
niwamo Jan 14, 2025
0dc4a19
EXOGroupSettings - Improves export performance
niwamo Jan 14, 2025
4d49161
EXOMailboxPermission - Improves export performance
niwamo Jan 14, 2025
3a328c4
EXOManagementRole - Improves export performance
niwamo Jan 14, 2025
6baf978
EXOManagementRoleAssignment - Improves export performance
niwamo Jan 14, 2025
9ce3561
EXOManagementRoleEntry - Improves export performance
niwamo Jan 14, 2025
3abea1c
EXOMessageClassification - Improves export performance
niwamo Jan 14, 2025
f3cc1d7
EXORoleAssignmentPolicy - Improves export performance
niwamo Jan 14, 2025
9a06567
EXORoleGroup - Improves export performance
niwamo Jan 14, 2025
461392d
EXOSharedMailbox - Improves export performance
niwamo Jan 14, 2025
d386fa8
EXOTransportRule - Improves export performance
niwamo Jan 14, 2025
292d9e8
O365Group - Improves export performance
niwamo Jan 14, 2025
5265798
SPOSiteGroup - Improves export performance
niwamo Jan 14, 2025
ecc71cd
SPOSite - Improves export performance
niwamo Jan 14, 2025
c1c3143
SPOHubSite - Improves export performance
niwamo Jan 14, 2025
76b82f7
SCAuditConfigurationPolicy - Improves export performance
niwamo Jan 14, 2025
9e49f74
SCAutoSensitivityLabelPolicy - Improves export performance
niwamo Jan 14, 2025
371183d
SCAutoSensitivityLabelRule - Improves export performance
niwamo Jan 14, 2025
c6b0a88
SCCaseHoldPolicy - Improves export performance
niwamo Jan 14, 2025
f674aa4
SCCaseHoldRule - Improves export performance
niwamo Jan 14, 2025
ee4044d
SCComplianceCase - Improves export performance
niwamo Jan 14, 2025
125fde8
SCComplianceSearch - Improves export performance
niwamo Jan 14, 2025
1b5a459
SCComplianceSearchAction - Improves export performance
niwamo Jan 14, 2025
daf0c2a
SCComplianceTag - Improves export performance
niwamo Jan 14, 2025
a54fa98
SCDeviceConditionalAccessPolicy - Improves export performance
niwamo Jan 14, 2025
b0fe99d
SCDeviceConditionalAccessRule - Improves export performance
niwamo Jan 14, 2025
6f89c01
SCDeviceConfigurationPolicy - Improves export performance
niwamo Jan 14, 2025
96e65e2
SCDLPCompliancePolicy - Improves export performance
niwamo Jan 14, 2025
1d5fcbf
SCDLPComplianceRule - Improves export performance
niwamo Jan 14, 2025
c7bc601
SCFilePlanPropertyAuthority - Improves export performance
niwamo Jan 14, 2025
bc8ac1d
SCFilePlanPropertyCategory - Improves export performance
niwamo Jan 14, 2025
d71b88f
SCFilePlanPropertyCitation - Improves export performance
niwamo Jan 14, 2025
5bdc69b
SCFilePlanPropertyDepartment - Improves export performance
niwamo Jan 14, 2025
f28fe1f
SCFilePlanPropertyReferenceId - Improves export performance
niwamo Jan 14, 2025
07fc74d
SCFilePlanPropertySubCategory - Improves export performance
niwamo Jan 14, 2025
ac47cc3
SCLabelPolicy - Improves export performance
niwamo Jan 14, 2025
bcd69ae
SCProtectionAlert - Improves export performance
niwamo Jan 14, 2025
3aa397d
SCRetentionCompliancePolicy - Improves export performance
niwamo Jan 14, 2025
4c55452
SCRetentionComplianceRule - Improves export performance
niwamo Jan 14, 2025
2ef6b33
SCRetentionEventType - Improves export performance
niwamo Jan 14, 2025
31f088a
SCRoleGroup - Improves export performance
niwamo Jan 14, 2025
dc32b32
SCRoleGroupMember - Improves export performance
niwamo Jan 14, 2025
5b5ea68
SCSensitivityLabel - Improves export performance
niwamo Jan 14, 2025
f5c40ec
SCSupervisoryReviewPolicy - Improves export performance
niwamo Jan 14, 2025
e9b411b
SCSupervisoryReviewRule - Improves export performance
niwamo Jan 14, 2025
c2c7398
EXOGlobalAddressList - Enhance mocked Get-GlobalAddressList for unit …
niwamo Jan 15, 2025
742ca8a
AADServicePrincipal - adds Get-MgServicePrincipalOwner to test stubs
niwamo Jan 15, 2025
0fc8a8b
AADUser - adds Get-MgUserMemberOfAsGroup to test stubs
niwamo Jan 15, 2025
d6f5e2e
SCSupervisoryReviewPolicy - Fix placement of nullReturn instantiation
niwamo Jan 15, 2025
d8ab6f0
SPOTenantSettings - Adds *-MgAdminSharepointSetting stubs for tests
niwamo Jan 15, 2025
4d367c5
Update CHANGELOG for #5615 (export performance improvement)
niwamo Jan 15, 2025
0364a78
Merge branch 'Dev' into exportedInstance
ykuijs Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
FIXES [#5634](https://github.com/microsoft/Microsoft365DSC/issues/5634)
* M365DSCTelemetryEngine
* Report LCM details only if running as administrator.
* MISC
* Export Performance Improvements
Implements the changes described in [#5615](https://github.com/microsoft/Microsoft365DSC/issues/5615)

# 1.25.115.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,64 +84,58 @@ function Get-TargetResource
)
try
{
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters
}
catch
{
Write-Verbose -Message ($_)
}

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = $PSBoundParameters
$nullResult.Ensure = 'Absent'
try
{
$getValue = $null
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
if (-not $Script:exportedInstance)
{
if ($null -ne $Script:exportedInstances -and $Script:ExportMode)
try
{
$getValue = $Script:exportedInstances | Where-Object -FilterScript { $_.Id -eq $Id }
$ConnectionMode = New-M365DSCConnection -Workload 'MicrosoftGraph' `
-InboundParameters $PSBoundParameters
}
else
catch
{
Write-Verbose -Message ($_)
}

#Ensure the proper dependencies are installed in the current environment.
Confirm-M365DSCDependencies

#region Telemetry
$ResourceName = $MyInvocation.MyCommand.ModuleName.Replace('MSFT_', '')
$CommandName = $MyInvocation.MyCommand
$data = Format-M365DSCTelemetryParameters -ResourceName $ResourceName `
-CommandName $CommandName `
-Parameters $PSBoundParameters
Add-M365DSCTelemetryEvent -Data $data
#endregion

$nullResult = $PSBoundParameters
$nullResult.Ensure = 'Absent'

$getValue = $null
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDirectoryAdministrativeUnit -AdministrativeUnitId $Id -ErrorAction SilentlyContinue
}
}

if ($null -eq $getValue -and -not [string]::IsNullOrEmpty($DisplayName))
{
Write-Verbose -Message "Could not find an Azure AD Administrative Unit by Id, trying by DisplayName {$DisplayName}"
if (-Not [string]::IsNullOrEmpty($DisplayName))
if ($null -eq $getValue -and -not [string]::IsNullOrEmpty($DisplayName))
{
if ($null -ne $Script:exportedInstances -and $Script:ExportMode)
{
$getValue = $Script:exportedInstances | Where-Object -FilterScript { $_.DisplayName -eq $DisplayName }
}
else
Write-Verbose -Message "Could not find an Azure AD Administrative Unit by Id, trying by DisplayName {$DisplayName}"
if (-Not [string]::IsNullOrEmpty($DisplayName))
{
$getValue = Get-MgBetaDirectoryAdministrativeUnit -Filter "DisplayName eq '$DisplayName'" -ErrorAction Stop
}
}
#endregion
if ($null -eq $getValue)
{
Write-Verbose -Message "Could not find an Azure AD Administrative Unit with DisplayName {$DisplayName}"
return $nullResult
}
}
#endregion
if ($null -eq $getValue)
else
{
Write-Verbose -Message "Could not find an Azure AD Administrative Unit with DisplayName {$DisplayName}"
return $nullResult
$getValue = $Script:exportedInstance
}
$Id = $getValue.Id
Write-Verbose -Message "An Azure AD Administrative Unit with Id {$Id} and DisplayName {$DisplayName} was found."
Expand Down Expand Up @@ -1099,6 +1093,7 @@ function Export-TargetResource
AccessTokens = $AccessTokens
}

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params

if ($null -ne $Results.ScopedRoleMembers)
Expand Down
Loading