Skip to content

Commit

Permalink
Merge pull request #1162 from kris6673/dev
Browse files Browse the repository at this point in the history
Exclude unwanted domains from domain analyser
  • Loading branch information
JohnDuprey authored Oct 30, 2024
2 parents 9f82116 + e8e07cf commit 7235d3b
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,24 @@ function Push-DomainAnalyserTenant {
return
} else {
try {
$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) }
# Remove domains that are not wanted, and used for cloud signature services
$ExclusionDomains = @(
'*.microsoftonline.com'
'*.exclaimer.cloud'
'*.excl.cloud'
'*.codetwo.online'
'*.call2teams.com'
'*signature365.net'
)
$Domains = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/domains' -tenantid $Tenant.customerId | Where-Object { $_.isVerified -eq $true } | ForEach-Object {
$Domain = $_
foreach ($ExclusionDomain in $ExclusionDomains) {
if ($Domain.id -like $ExclusionDomain) {
$Domain = $null
}
}
$Domain
} | Where-Object { $_ -ne $null }

$TenantDomains = foreach ($d in $Domains) {
[PSCustomObject]@{
Expand Down

0 comments on commit 7235d3b

Please sign in to comment.