File tree Expand file tree Collapse file tree
Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Domain Analyser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,24 @@ function Push-DomainAnalyserTenant {
2020 return
2121 } else {
2222 try {
23- $Domains = New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/domains' - tenantid $Tenant.customerId | Where-Object { ($_.id -notlike ' *.microsoftonline.com' -and $_.id -NotLike ' *.exclaimer.cloud' -and $_.id -Notlike ' *.excl.cloud' -and $_.id -NotLike ' *.codetwo.online' -and $_.id -NotLike ' *.call2teams.com' -and $_.id -notlike ' *signature365.net' -and $_.isVerified ) }
23+ # Remove domains that are not wanted, and used for cloud signature services
24+ $ExclusionDomains = @ (
25+ ' *.microsoftonline.com'
26+ ' *.exclaimer.cloud'
27+ ' *.excl.cloud'
28+ ' *.codetwo.online'
29+ ' *.call2teams.com'
30+ ' *signature365.net'
31+ )
32+ $Domains = New-GraphGetRequest - uri ' https://graph.microsoft.com/beta/domains' - tenantid $Tenant.customerId | Where-Object { $_.isVerified -eq $true } | ForEach-Object {
33+ $Domain = $_
34+ foreach ($ExclusionDomain in $ExclusionDomains ) {
35+ if ($Domain.id -like $ExclusionDomain ) {
36+ $Domain = $null
37+ }
38+ }
39+ $Domain
40+ } | Where-Object { $_ -ne $null }
2441
2542 $TenantDomains = foreach ($d in $Domains ) {
2643 [PSCustomObject ]@ {
You can’t perform that action at this time.
0 commit comments