Skip to content

Commit

Permalink
Add exclaimer domain exclusion and change DA to use TenantGUID
Browse files Browse the repository at this point in the history
  • Loading branch information
kris6673 committed Apr 9, 2024
1 parent 2b0187d commit cf9e895
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions DomainAnalyser_All/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ try {

$Result = [PSCustomObject]@{
Tenant = $Tenant.Tenant
TenantID = $Tenant.TenantGUID
GUID = $($Domain.Replace('.', ''))
LastRefresh = $(Get-Date (Get-Date).ToUniversalTime() -UFormat '+%Y-%m-%dT%H:%M:%S.000Z')
Domain = $Domain
Expand Down
8 changes: 6 additions & 2 deletions DomainAnalyser_GetTenantDomains/run.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ $TenantDomains = $Tenants | ForEach-Object -Parallel {
$Tenant = $_
# Get Domains to Lookup
try {
$Domains = New-GraphGetRequest -uri 'https://graph.microsoft.com/v1.0/domains' -tenantid $Tenant.defaultDomainName | Where-Object { ($_.id -notlike '*.microsoftonline.com' -and $_.id -NotLike '*.exclaimer.cloud' -and $_.id -NotLike '*.codetwo.online' -and $_.id -NotLike '*.call2teams.com' -and $_.isVerified) }
$Domains = New-GraphGetRequest -uri 'https://graph.microsoft.com/v1.0/domains' -tenantid $Tenant.defaultDomainName | 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 $_.isVerified) }

foreach ($d in $domains) {
[PSCustomObject]@{
Tenant = $Tenant.defaultDomainName
TenantGUID = $Tenant.customerId
InitialDomainName = $Tenant.initialDomainName
Domain = $d.id
AuthenticationType = $d.authenticationType
IsAdminManaged = $d.isAdminManaged
Expand Down Expand Up @@ -57,11 +60,12 @@ if ($TenantCount -gt 0) {
$Filter = "PartitionKey eq 'TenantDomains' and RowKey eq '{0}'" -f $Tenant.Domain
$Domain = Get-CIPPAzDataTableEntity @DomainTable -Filter $Filter

if (!$Domain) {
if (!$Domain -or $null -eq $Domain.TenantGUID) {
$DomainObject = [pscustomobject]@{
DomainAnalyser = ''
TenantDetails = $TenantDetails
TenantId = $Tenant.Tenant
TenantGUID = $Tenant.TenantGUID
DkimSelectors = ''
MailProviders = ''
RowKey = $Tenant.Domain
Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Get-CIPPDomainAnalyser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function Get-CIPPDomainAnalyser {
# Get all the things

if ($TenantFilter -ne 'AllTenants') {
$DomainTable.Filter = "TenantId eq '{0}'" -f $TenantFilter
$DomainTable.Filter = "TenantGUID eq '{0}'" -f $TenantFilter
}

try {
Expand Down

0 comments on commit cf9e895

Please sign in to comment.