Tests/Testing-MockedObjects.ps1

# Module: Orbit.Teams
# Function: Test
# Author: David Eberhardt
# Updated: 13-AUG-2023

# Purpose: Mock Objects of the type GraphUser, GraphGroup, CsOnlineUser, CsOnlineApplicationInstance, etc.
#BODGE When translating from AzureAd to Graph, Cmdlet output was not re-tested. Cmdlets like Get-MgGroup may return objects differently
#TODO Re-query each object type, update object dependent on output
#TODO Filter only required elements. Multiple copies of this file are now used, only the objects needed should remain.
#region Licenses & ServicePlans
#region GraphUserLicenseServicePlans

#License: Microsoft 365 E5 Developer (Without Windows And Audio Conferencing)
$ServicePlansLic1 = @(
  [PSCustomObject]@{
    ProductName        = 'Azure Active Directory Premium P1'
    ServicePlanName    = 'AAD_PREMIUM'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Azure Active Directory Premium P2'
    ServicePlanName    = 'AAD_PREMIUM_P2'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Azure Information Protection Premium P1'
    ServicePlanName    = 'RMS_S_PREMIUM'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Azure Information Protection Premium P2'
    ServicePlanName    = 'RMS_S_PREMIUM2'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Common Data Service'
    ServicePlanName    = 'DYN365_CDS_O365_P3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Common Data Service - Viral'
    ServicePlanName    = 'DYN365_CDS_VIRAL'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Common Data Service For Teams'
    ServicePlanName    = 'CDS_O365_P3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Customer Lockbox'
    ServicePlanName    = 'LOCKBOX_ENTERPRISE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Data Classification In Microsoft 365'
    ServicePlanName    = 'MIP_S_Exchange'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Exchange Foundation'
    ServicePlanName    = 'EXCHANGE_S_FOUNDATION'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Exchange Online (Plan 2)'
    ServicePlanName    = 'EXCHANGE_S_ENTERPRISE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Flow Free'
    ServicePlanName    = 'FLOW_P2_VIRAL'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Graph Connectors Search With Index'
    ServicePlanName    = 'GRAPH_CONNECTORS_SEARCH_INDEX'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Information Protection And Governance Analytics - Premium'
    ServicePlanName    = 'Content_Explorer'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Information Protection For Office 365 - Premium'
    ServicePlanName    = 'MIP_S_CLP2'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Information Protection For Office 365 Â Standard'
    ServicePlanName    = 'MIP_S_CLP1'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Advanced Auditing'
    ServicePlanName    = 'M365_ADVANCED_AUDITING'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Apps For Enterprise'
    ServicePlanName    = 'OFFICESUBSCRIPTION'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Communication Compliance'
    ServicePlanName    = 'MICROSOFT_COMMUNICATION_COMPLIANCE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Defender'
    ServicePlanName    = 'MTP'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Phone System'
    ServicePlanName    = 'MCOEV'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Azure Active Directory Rights'
    ServicePlanName    = 'RMS_S_ENTERPRISE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Azure Multi-Factor Authentication'
    ServicePlanName    = 'MFA_PREMIUM'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Bookings'
    ServicePlanName    = 'MICROSOFTBOOKINGS'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Cloud App Security'
    ServicePlanName    = 'ADALLOM_S_STANDALONE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Communications Compliance'
    ServicePlanName    = 'COMMUNICATIONS_COMPLIANCE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Communications Dlp'
    ServicePlanName    = 'COMMUNICATIONS_DLP'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Customer Key'
    ServicePlanName    = 'CUSTOMER_KEY'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Data Investigations'
    ServicePlanName    = 'DATA_INVESTIGATIONS'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Defender For Identity'
    ServicePlanName    = 'ATA'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Defender For Office 365 (Plan 1)'
    ServicePlanName    = 'ATP_ENTERPRISE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Defender For Office 365 (Plan 2)'
    ServicePlanName    = 'THREAT_INTELLIGENCE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Excel Advanced Analytics'
    ServicePlanName    = 'EXCEL_PREMIUM'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Forms (Plan E5)'
    ServicePlanName    = 'FORMS_PLAN_E5'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Information Governance'
    ServicePlanName    = 'INFO_GOVERNANCE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Insider Risk Management'
    ServicePlanName    = 'INSIDER_RISK'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Insider Risk Management'
    ServicePlanName    = 'INSIDER_RISK_MANAGEMENT'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Intune'
    ServicePlanName    = 'INTUNE_A'
    ProvisioningStatus = 'PendingInput'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Ml-Based Classification'
    ServicePlanName    = 'ML_CLASSIFICATION'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Myanalytics (Full)'
    ServicePlanName    = 'EXCHANGE_ANALYTICS'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Planner'
    ServicePlanName    = 'PROJECTWORKMANAGEMENT'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Records Management'
    ServicePlanName    = 'RECORDS_MANAGEMENT'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Search'
    ServicePlanName    = 'MICROSOFT_SEARCH'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Staffhub'
    ServicePlanName    = 'Deskless'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Stream For Office 365 E5'
    ServicePlanName    = 'STREAM_O365_E5'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Teams'
    ServicePlanName    = 'TEAMS1'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Mobile Device Management For Office 365'
    ServicePlanName    = 'INTUNE_O365'
    ProvisioningStatus = 'PendingActivation'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Nucleus'
    ServicePlanName    = 'Nucleus'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Office 365 Advanced Ediscovery'
    ServicePlanName    = 'EQUIVIO_ANALYTICS'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Office 365 Advanced Security Management'
    ServicePlanName    = 'ADALLOM_S_O365'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Office 365 Privileged Access Management'
    ServicePlanName    = 'PAM_ENTERPRISE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Office 365 Safedocs'
    ServicePlanName    = 'SAFEDOCS'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Office For The Web'
    ServicePlanName    = 'SHAREPOINTWAC'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Power Apps For Office 365 (Plan 3)'
    ServicePlanName    = 'POWERAPPS_O365_P3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Power Automate For Office 365'
    ServicePlanName    = 'FLOW_O365_P3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Power Bi Pro'
    ServicePlanName    = 'BI_AZURE_P2'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Power Virtual Agents For Office 365'
    ServicePlanName    = 'POWER_VIRTUAL_AGENTS_O365_P3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Project For Office (Plan E5)'
    ServicePlanName    = 'PROJECT_O365_P3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Sharepoint (Plan 2)'
    ServicePlanName    = 'SHAREPOINTENTERPRISE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Skype For Business Online (Plan 2)'
    ServicePlanName    = 'MCOSTANDARD'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Sway'
    ServicePlanName    = 'SWAY'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'To-Do (Plan 3)'
    ServicePlanName    = 'BPOS_S_TODO_3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Viva Learning Seeded'
    ServicePlanName    = 'VIVA_LEARNING_SEEDED'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Whiteboard (Plan 3)'
    ServicePlanName    = 'WHITEBOARD_PLAN3'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'YammerEnterprise'
    ServicePlanName    = 'YAMMER_ENTERPRISE'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  }
)

# License: Microsoft Flow Free
$ServicePlansLic2 = @(

  [PSCustomObject]@{
    ProductName        = 'Common Data Service - Viral'
    ServicePlanName    = 'DYN365_CDS_VIRAL'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Exchange Foundation'
    ServicePlanName    = 'EXCHANGE_S_FOUNDATION'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  },
  [PSCustomObject]@{
    ProductName        = 'Flow Free'
    ServicePlanName    = 'FLOW_P2_VIRAL'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $False
  }
)

# Teams and PhoneSystem assigned and ACTIVE
$ServicePlansGoodRA = @(
  #TODO requires validation against Live Serivce - is this the only servicePlan?
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Phone System Virtual User'
    ServicePlanName    = 'MCOEV_VIRTUALUSER'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  }
)

# Teams and PhoneSystem assigned and ACTIVE
$ServicePlansGood1 = @(
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Phone System'
    ServicePlanName    = 'MCOEV'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Teams'
    ServicePlanName    = 'TEAMS1'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Skype For Business Online (Plan 2)'
    ServicePlanName    = 'MCOSTANDARD'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Intune'
    ServicePlanName    = 'INTUNE_A'
    ProvisioningStatus = 'PendingInput'
    RelevantForTeams   = $False
  }
)

# Teams and PhoneSystem assigned and DISABLED
$ServicePlansBad1 = @(
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Phone System'
    ServicePlanName    = 'MCOEV'
    ProvisioningStatus = 'Disabled'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Teams'
    ServicePlanName    = 'TEAMS1'
    ProvisioningStatus = 'Disabled'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Skype For Business Online (Plan 2)'
    ServicePlanName    = 'MCOSTANDARD'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Intune'
    ServicePlanName    = 'INTUNE_A'
    ProvisioningStatus = 'PendingInput'
    RelevantForTeams   = $False
  }
)

# Teams assigned and ACTIVE, PhoneSystem not assigned
$ServicePlansBad2 = @(
  [PSCustomObject]@{
    ProductName        = 'Microsoft Teams'
    ServicePlanName    = 'TEAMS1'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Skype For Business Online (Plan 2)'
    ServicePlanName    = 'MCOSTANDARD'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Intune'
    ServicePlanName    = 'INTUNE_A'
    ProvisioningStatus = 'PendingInput'
    RelevantForTeams   = $False
  }
)

# Teams assigned and DISABLED, PhoneSystem assigned and ACTIVE
$ServicePlansBad3 = @(
  [PSCustomObject]@{
    ProductName        = 'Microsoft 365 Phone System'
    ServicePlanName    = 'MCOEV'
    ProvisioningStatus = 'Disabled'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Teams'
    ServicePlanName    = 'TEAMS1'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Skype For Business Online (Plan 2)'
    ServicePlanName    = 'MCOSTANDARD'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Intune'
    ServicePlanName    = 'INTUNE_A'
    ProvisioningStatus = 'PendingInput'
    RelevantForTeams   = $False
  }
)

# Teams not assigned, PhoneSystem not assigned
$ServicePlansBad4 = @(
  [PSCustomObject]@{
    ProductName        = 'Skype For Business Online (Plan 2)'
    ServicePlanName    = 'MCOSTANDARD'
    ProvisioningStatus = 'Success'
    RelevantForTeams   = $True
  },
  [PSCustomObject]@{
    ProductName        = 'Microsoft Intune'
    ServicePlanName    = 'INTUNE_A'
    ProvisioningStatus = 'PendingInput'
    RelevantForTeams   = $False
  }
)
#endregion

#region GraphUserLicense
# Fully Licensed
$GraphUserLicenseGood1 = [PSCustomObject]@{
  UserPrincipalName        = 'SamVimes@discworld.onmicrosoft.com'
  DisplayName              = 'Sir Samuel Vimes'
  ObjectId                 = '239943fa-1da2-4d80-8cec-cdd3c7239d2c'
  UsageLocation            = 'GB'
  Licenses                 = @(
    [PSCustomObject]@{
      ProductName         = 'Microsoft 365 E5 Developer (Without Windows And Audio Conferencing)'
      SkuPartNumber       = 'DEVELOPERPACK_E5'
      LicenseType         = 'Package'
      ParameterName       = 'Microsoft365E5Developer'
      IncludesTeams       = $True
      IncludesPhoneSystem = $True
      SkuId               = 'c42b9cae-ea4f-4ab7-9717-81576235ccac'
      ServicePlans        = $ServicePlansGood1
    },
    [PSCustomObject]@{
      ProductName         = 'Microsoft Flow Free'
      SkuPartNumber       = 'FLOW_FREE'
      LicenseType         = 'Package'
      ParameterName       = 'MicrosoftFlowFree'
      IncludesTeams       = $False
      IncludesPhoneSystem = $False
      SkuId               = 'f30db892-07e9-47e9-837c-80727f46fd3d'
      ServicePlans        = $ServicePlansGood1
    }
  )
  ServicePlans             = $ServicePlansGood1 # may need both 1 and 2
  AudioConferencing        = $False
  CommonAreaPhoneLicense   = $False
  PhoneSystemVirtualUser   = $False
  PhoneSystem              = $True
  PhoneSystemStatus        = 'Success'
  CallingPlanDomestic120   = $False
  CallingPlanDomestic      = $False
  CallingPlanInternational = $False
  OtherCallingPlan         = $False
  CommunicationsCredits    = $False
  CallingPlan              = $null
}

# Licensed but disabled
$GraphUserLicenseToRemedy1 = [PSCustomObject]@{
  UserPrincipalName        = 'SamVimes@discworld.onmicrosoft.com'
  DisplayName              = 'Sir Samuel Vimes'
  ObjectId                 = '239943fa-1da2-4d80-8cec-cdd3c7239d2c'
  UsageLocation            = 'GB'
  Licenses                 = @(
    [PSCustomObject]@{
      ProductName         = 'Microsoft 365 E5 Developer (Without Windows And Audio Conferencing)'
      SkuPartNumber       = 'DEVELOPERPACK_E5'
      LicenseType         = 'Package'
      ParameterName       = 'Microsoft365E5Developer'
      IncludesTeams       = $True
      IncludesPhoneSystem = $True
      SkuId               = 'c42b9cae-ea4f-4ab7-9717-81576235ccac'
      ServicePlans        = $ServicePlansBad1
    },
    [PSCustomObject]@{
      ProductName         = 'Microsoft Flow Free'
      SkuPartNumber       = 'FLOW_FREE'
      LicenseType         = 'Package'
      ParameterName       = 'MicrosoftFlowFree'
      IncludesTeams       = $False
      IncludesPhoneSystem = $False
      SkuId               = 'f30db892-07e9-47e9-837c-80727f46fd3d'
      ServicePlans        = $ServicePlansBad1
    }
  )
  ServicePlans             = $ServicePlansBad1
  AudioConferencing        = $False
  CommonAreaPhoneLicense   = $False
  PhoneSystemVirtualUser   = $False
  PhoneSystem              = $True
  PhoneSystemStatus        = 'Success'
  CallingPlanDomestic120   = $False
  CallingPlanDomestic      = $False
  CallingPlanInternational = $False
  OtherCallingPlan         = $False
  CommunicationsCredits    = $False
  CallingPlan              = $null
}
# Unlicensed
$GraphUserLicenseBad1 = [PSCustomObject]@{
  UserPrincipalName        = 'ReacherGilt@discworld.onmicrosoft.com'
  DisplayName              = 'Reacher Gilt'
  ObjectId                 = 'b233faf7-208d-47e2-8af2-5e5069f9aa91'
  UsageLocation            = 'GB'
  Licenses                 = @()
  ServicePlans             = @()
  AudioConferencing        = $False
  CommonAreaPhoneLicense   = $False
  PhoneSystemVirtualUser   = $False
  PhoneSystem              = $False
  PhoneSystemStatus        = $null
  CallingPlanDomestic120   = $False
  CallingPlanDomestic      = $False
  CallingPlanInternational = $False
  OtherCallingPlan         = $False
  CommunicationsCredits    = $False
  CallingPlan              = $null
}

$GraphUserLicenseRAGood1 = [PSCustomObject]@{
  #TODO Add License for RA ()
}

$GraphUserLicenseRAToRemedy1 = [PSCustomObject]@{
  #TODO Add License for RA ()
}

$GraphUserLicenseRABad1 = [PSCustomObject]@{
  #TODO Add License for RA ()
}
#endregion
#endregion


#region User Objects
#region CsOnlineUser - User Object
$CsOnlineUserGood1 = [PSCustomObject]@{
  AccountEnabled                         = $True
  Alias                                  = 'SamVimes'
  ApplicationAccessPolicy                = $null
  AssignedPlan                           = @('BPOS_S_Enterprise', 'Teams', 'MCOEV', 'MCOProfessional')
  CallingLineIdentity                    = $null
  City                                   = $null
  Company                                = $null
  Country                                = $null
  Department                             = $null
  DialPlan                               = 'GB'
  DisplayName                            = 'Sir Samuel Vimes'
  EnterpriseVoiceEnabled                 = $True
  ExternalAccessPolicy                   = $null
  FeatureTypes                           = @('Teams', 'PhoneSystem')
  GivenName                              = 'Samuel'
  HideFromAddressLists                   = $null
  HostingProvider                        = 'sipfed.online.lync.com'
  Identity                               = '239943fa-1da2-4d80-8cec-cdd3c7239d2c'
  InterpretedUserType                    = 'PureOnlineTeamsOnlyUser'
  IsSipEnabled                           = $True
  LastName                               = 'Vimes'
  LineUri                                = $null
  LocationPolicy                         = $null
  OnPremEnterpriseVoiceEnabled           = $null
  OnPremHostingProvider                  = 'Not Yet Supported.'
  OnPremLineUri                          = 'Not Yet Supported.'
  OnPremOptionFlags                      = $null
  OnPremSIPEnabled                       = $null
  OnPremSipAddress                       = @('SharePoint', 'SharePoint', 'exchange' )
  ProxyAddresses                         = @('SMTP=SamVimes@discworld.onmicrosoft.com' )
  ShadowProxyAddresses                   = @()
  SipAddress                             = 'sip=SamVimes@discworld.onmicrosoft.com'
  SoftDeletionTimestamp                  = $null
  StateOrProvince                        = $null
  Street                                 = $null
  TeamsAppPermissionPolicy               = $null
  TeamsAppSetupPolicy                    = $null
  TeamsAudioConferencingPolicy           = $null
  TeamsCallHoldPolicy                    = $null
  TeamsCallParkPolicy                    = $null
  TeamsCallingPolicy                     = $null
  TeamsCarrierEmergencyCallRoutingPolicy = $null
  TeamsChannelsPolicy                    = $null
  TeamsComplianceRecordingPolicy         = $null
  TeamsCortanaPolicy                     = $null
  TeamsEducationAssignmentsAppPolicy     = $null
  TeamsEmergencyCallRoutingPolicy        = $null
  TeamsEmergencyCallingPolicy            = $null
  TeamsEnhancedEncryptionPolicy          = $null
  TeamsFeedbackPolicy                    = $null
  TeamsFilesPolicy                       = $null
  TeamsIPPhonePolicy                     = $null
  TeamsMeetingBrandingPolicy             = $null
  TeamsMeetingBroadcastPolicy            = $null
  TeamsMeetingPolicy                     = 'MP-MSS Restricted'
  TeamsMessagingPolicy                   = $null
  TeamsMobilityPolicy                    = $null
  TeamsNetworkRoamingPolicy              = $null
  TeamsNotificationAndFeedsPolicy        = $null
  TeamsOwnersPolicy                      = $null
  TeamsShiftsAppPolicy                   = $null
  TeamsShiftsPolicy                      = $null
  TeamsSurvivableBranchAppliancePolicy   = $null
  TeamsSyntheticAutomatedCallPolicy      = $null
  TeamsTargetingPolicy                   = $null
  TeamsTasksPolicy                       = $null
  TeamsTemplatePermissionPolicy          = $null
  TeamsUpdateManagementPolicy            = $null
  TeamsUpgradeEffectiveMode              = 'TeamsOnly'
  TeamsUpgradeNotificationsEnabled       = $False
  TeamsUpgradeOverridePolicy             = $null
  TeamsUpgradePolicy                     = 'UpgradeToTeams'
  TeamsUpgradePolicyIsReadOnly           = 'ModeAndNotifications'
  TeamsVdiPolicy                         = $null
  TeamsVerticalPackagePolicy             = $null
  TeamsVideoInteropServicePolicy         = $null
  TeamsVoiceApplicationsPolicy           = $null
  TenantDialPlan                         = $null
  TenantId                               = '7271af30-bd30-4664-a407-c44dc3ca8b12'
  Title                                  = $null
  UsageLocation                          = 'GB'
  UserDirSyncEnabled                     = $null
  UserPrincipalName                      = 'SamVimes@discworld.onmicrosoft.com'
  WhenChanged                            = $null
}

$CsOnlineUserToRemedy1 = [PSCustomObject]@{ # Maybe Change username (Angua?)
  AccountEnabled                         = $True
  Alias                                  = 'SamVimes'
  ApplicationAccessPolicy                = $null
  AssignedPlan                           = @('BPOS_S_Enterprise', 'Teams', 'MCOEV', 'MCOProfessional')
  CallingLineIdentity                    = $null
  City                                   = $null
  Company                                = $null
  Country                                = $null
  Department                             = $null
  DialPlan                               = 'GB'
  DisplayName                            = 'Sir Samuel Vimes'
  EnterpriseVoiceEnabled                 = $True
  ExternalAccessPolicy                   = $null
  FeatureTypes                           = @('Teams', 'PhoneSystem') # Check whether PhoneSystem shows up here if disabled
  GivenName                              = 'Samuel'
  HideFromAddressLists                   = $null
  HostingProvider                        = 'sipfed.online.lync.com'
  Identity                               = '239943fa-1da2-4d80-8cec-cdd3c7239d2c'
  InterpretedUserType                    = 'PureOnlineTeamsOnlyUser'
  IsSipEnabled                           = $True
  LastName                               = 'Vimes'
  LineUri                                = $null
  LocationPolicy                         = $null
  OnPremEnterpriseVoiceEnabled           = $null
  OnPremHostingProvider                  = 'Not Yet Supported.'
  OnPremLineUri                          = 'Not Yet Supported.'
  OnPremOptionFlags                      = $null
  OnPremSIPEnabled                       = $null
  OnPremSipAddress                       = @('SharePoint', 'SharePoint', 'exchange' )
  ProxyAddresses                         = @('SMTP=SamVimes@discworld.onmicrosoft.com' )
  ShadowProxyAddresses                   = @()
  SipAddress                             = 'sip=SamVimes@discworld.onmicrosoft.com'
  SoftDeletionTimestamp                  = $null
  StateOrProvince                        = $null
  Street                                 = $null
  TeamsAppPermissionPolicy               = $null
  TeamsAppSetupPolicy                    = $null
  TeamsAudioConferencingPolicy           = $null
  TeamsCallHoldPolicy                    = $null
  TeamsCallParkPolicy                    = $null
  TeamsCallingPolicy                     = $null
  TeamsCarrierEmergencyCallRoutingPolicy = $null
  TeamsChannelsPolicy                    = $null
  TeamsComplianceRecordingPolicy         = $null
  TeamsCortanaPolicy                     = $null
  TeamsEducationAssignmentsAppPolicy     = $null
  TeamsEmergencyCallRoutingPolicy        = $null
  TeamsEmergencyCallingPolicy            = $null
  TeamsEnhancedEncryptionPolicy          = $null
  TeamsFeedbackPolicy                    = $null
  TeamsFilesPolicy                       = $null
  TeamsIPPhonePolicy                     = $null
  TeamsMeetingBrandingPolicy             = $null
  TeamsMeetingBroadcastPolicy            = $null
  TeamsMeetingPolicy                     = 'MP-MSS Restricted'
  TeamsMessagingPolicy                   = $null
  TeamsMobilityPolicy                    = $null
  TeamsNetworkRoamingPolicy              = $null
  TeamsNotificationAndFeedsPolicy        = $null
  TeamsOwnersPolicy                      = $null
  TeamsShiftsAppPolicy                   = $null
  TeamsShiftsPolicy                      = $null
  TeamsSurvivableBranchAppliancePolicy   = $null
  TeamsSyntheticAutomatedCallPolicy      = $null
  TeamsTargetingPolicy                   = $null
  TeamsTasksPolicy                       = $null
  TeamsTemplatePermissionPolicy          = $null
  TeamsUpdateManagementPolicy            = $null
  TeamsUpgradeEffectiveMode              = 'TeamsOnly'
  TeamsUpgradeNotificationsEnabled       = $False
  TeamsUpgradeOverridePolicy             = $null
  TeamsUpgradePolicy                     = 'UpgradeToTeams'
  TeamsUpgradePolicyIsReadOnly           = 'ModeAndNotifications'
  TeamsVdiPolicy                         = $null
  TeamsVerticalPackagePolicy             = $null
  TeamsVideoInteropServicePolicy         = $null
  TeamsVoiceApplicationsPolicy           = $null
  TenantDialPlan                         = $null
  TenantId                               = '7271af30-bd30-4664-a407-c44dc3ca8b12'
  Title                                  = $null
  UsageLocation                          = 'GB'
  UserDirSyncEnabled                     = $null
  UserPrincipalName                      = 'SamVimes@discworld.onmicrosoft.com'
  WhenChanged                            = $null
}

$CsOnlineUserBad1 = [PSCustomObject]@{
  AccountEnabled                         = $True
  Alias                                  = 'ReacherGilt'
  ApplicationAccessPolicy                = $null
  AssignedPlan                           = @('BPOS_S_Enterprise', 'Teams', 'MCOProfessional')
  CallingLineIdentity                    = $null
  City                                   = $null
  Company                                = $null
  Country                                = $null
  Department                             = $null
  DialPlan                               = 'GB'
  DisplayName                            = 'Reacher Gilt'
  EnterpriseVoiceEnabled                 = $True
  ExternalAccessPolicy                   = $null
  FeatureTypes                           = @('Teams')
  GivenName                              = 'Reacher'
  HideFromAddressLists                   = $null
  HostingProvider                        = 'sipfed.online.lync.com'
  Identity                               = 'b233faf7-208d-47e2-8af2-5e5069f9aa91'
  InterpretedUserType                    = 'PureOnlineTeamsOnlyUser'
  IsSipEnabled                           = $True
  LastName                               = 'Gilt'
  LineUri                                = $null
  LocationPolicy                         = $null
  OnPremEnterpriseVoiceEnabled           = $null
  OnPremHostingProvider                  = 'Not Yet Supported.'
  OnPremLineUri                          = 'Not Yet Supported.'
  OnPremOptionFlags                      = $null
  OnPremSIPEnabled                       = $null
  OnPremSipAddress                       = @('SharePoint', 'SharePoint', 'exchange' )
  ProxyAddresses                         = @('SMTP=ReacherGilt@discworld.onmicrosoft.com' )
  ShadowProxyAddresses                   = @()
  SipAddress                             = 'sip=ReacherGilt@discworld.onmicrosoft.com'
  SoftDeletionTimestamp                  = $null
  StateOrProvince                        = $null
  Street                                 = $null
  TeamsAppPermissionPolicy               = $null
  TeamsAppSetupPolicy                    = $null
  TeamsAudioConferencingPolicy           = $null
  TeamsCallHoldPolicy                    = $null
  TeamsCallParkPolicy                    = $null
  TeamsCallingPolicy                     = $null
  TeamsCarrierEmergencyCallRoutingPolicy = $null
  TeamsChannelsPolicy                    = $null
  TeamsComplianceRecordingPolicy         = $null
  TeamsCortanaPolicy                     = $null
  TeamsEducationAssignmentsAppPolicy     = $null
  TeamsEmergencyCallRoutingPolicy        = $null
  TeamsEmergencyCallingPolicy            = $null
  TeamsEnhancedEncryptionPolicy          = $null
  TeamsFeedbackPolicy                    = $null
  TeamsFilesPolicy                       = $null
  TeamsIPPhonePolicy                     = $null
  TeamsMeetingBrandingPolicy             = $null
  TeamsMeetingBroadcastPolicy            = $null
  TeamsMeetingPolicy                     = 'MP-MSS Restricted'
  TeamsMessagingPolicy                   = $null
  TeamsMobilityPolicy                    = $null
  TeamsNetworkRoamingPolicy              = $null
  TeamsNotificationAndFeedsPolicy        = $null
  TeamsOwnersPolicy                      = $null
  TeamsShiftsAppPolicy                   = $null
  TeamsShiftsPolicy                      = $null
  TeamsSurvivableBranchAppliancePolicy   = $null
  TeamsSyntheticAutomatedCallPolicy      = $null
  TeamsTargetingPolicy                   = $null
  TeamsTasksPolicy                       = $null
  TeamsTemplatePermissionPolicy          = $null
  TeamsUpdateManagementPolicy            = $null
  TeamsUpgradeEffectiveMode              = 'TeamsOnly'
  TeamsUpgradeNotificationsEnabled       = $False
  TeamsUpgradeOverridePolicy             = $null
  TeamsUpgradePolicy                     = 'UpgradeToTeams'
  TeamsUpgradePolicyIsReadOnly           = 'ModeAndNotifications'
  TeamsVdiPolicy                         = $null
  TeamsVerticalPackagePolicy             = $null
  TeamsVideoInteropServicePolicy         = $null
  TeamsVoiceApplicationsPolicy           = $null
  TenantDialPlan                         = $null
  TenantId                               = '7271af30-bd30-4664-a407-c44dc3ca8b12'
  Title                                  = $null
  UsageLocation                          = 'GB'
  UserDirSyncEnabled                     = $null
  UserPrincipalName                      = 'ReacherGilt@discworld.onmicrosoft.com'
  WhenChanged                            = $null
}
#endregion

#region Resource Accounts
$CsOnlineApplicationInstanceGood1 = [PSCustomObject]@{
  ApplicationId     = '11cd3e2e-fccb-42ad-ad00-878b93575e07'
  DisplayName       = 'Night Watch Emergency Line'
  ObjectId          = 'b8f75f14-586b-4e05-9c97-7fa372e525c5'
  PhoneNumber       = 'tel:+1234567890'
  TenantId          = '7271af30-bd30-4664-a407-c44dc3ca8b12'
  UserPrincipalName = 'NightWatchRA@discworld.onmicrosoft.com'
}

$CsOnlineApplicationInstanceBad1 = [PSCustomObject]@{
  ApplicationId     = 'ce933385-9390-45d1-9512-c8d228074e07'
  DisplayName       = 'Trunk Company Receptionist'
  ObjectId          = '0a015c1c-7b15-41ea-a5ca-0605cb755524'
  PhoneNumber       = $null
  TenantId          = '7271af30-bd30-4664-a407-c44dc3ca8b12'
  UserPrincipalName = 'TrunkCompanyReceptionist@discworld.onmicrosoft.com'
}
#endregion

#region Graph/Entra ID User
$GraphUserRAGood1 = [PSCustomObject]@{
  ExtensionProperty              = [PSCustomObject]@{
    'odata.metadata'            = 'https://graph.windows.net/7271af30-bd30-4664-a407-c44dc3ca8b12/$metadata#directoryObjects/@Element'
    'odata.type'                = 'Microsoft.DirectoryServices.User'
    createdDateTime             = 'Tue 19 Jul 2022 17:53:06'
    employeeId                  = $null
    onPremisesDistinguishedName = $null
    userIdentities              = @()
  }
  DeletionTimestamp              = $null
  ObjectId                       = '6647e937-7617-443b-ba3b-364a140534f8'
  ObjectType                     = 'User'
  AccountEnabled                 = $False
  AgeGroup                       = $null
  AssignedLicenses               = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    }
  )
  AssignedPlans                  = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = '6dc145d6-95dd-4191-b9c3-185575ee6f6b' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'Sway'
      ServicePlanId     = 'a23b959c - 7ce8-4e57-9140-b90eb88a9e97'
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = 'd2d51368 - 76c9-4317-ada2-a12c004c432f'
    }
  )
  City                           = $null
  CompanyName                    = $null
  ConsentProvidedForMinor        = $null
  Country                        = $null
  CreationType                   = $null
  Department                     = 'Microsoft Communication Application Instance'
  DirSyncEnabled                 = $null
  DisplayName                    = 'NightWatchRA'
  FacsimileTelephoneNumber       = $null
  GivenName                      = $null
  IsCompromised                  = $null
  ImmutableId                    = $null
  JobTitle                       = $null
  LastDirSyncTime                = $null
  LegalAgeGroupClassification    = $null
  Mail                           = 'NightWatchRA@discworld.onmicrosoft.com'
  MailNickName                   = 'NightWatchRA'
  Mobile                         = $null
  OnPremisesSecurityIdentifier   = $null
  OtherMails                     = @()
  PasswordPolicies               = $null
  PasswordProfile                = [PSCustomObject]@{
    Password                     = $null
    ForceChangePasswordNextLogin = $True
    EnforceChangePasswordPolicy  = $False
  }
  PhysicalDeliveryOfficeName     = $null
  PostalCode                     = $null
  PreferredLanguage              = $null
  ProvisionedPlans               = @(
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'MicrosoftCommunicationsOnline'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'SharePoint'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'exchange'
    }
  )
  ProvisioningErrors             = @()
  ProxyAddresses                 = { 'SMTP:NightWatchRA@discworld.onmicrosoft.com' }
  RefreshTokensValidFromDateTime = 'Tue 19 Jul 2022 17:53:05'
  ShowInAddressList              = $null
  SignInNames                    = @()
  SipProxyAddress                = 'NightWatchRA@discworld.onmicrosoft.com'
  State                          = $null
  StreetAddress                  = $null
  Surname                        = $null
  TelephoneNumber                = $null
  UsageLocation                  = 'US'
  UserPrincipalName              = 'NightWatchRA@discworld.onmicrosoft.com'
  UserState                      = $null
  UserStateChangedOn             = $null
  UserType                       = 'Member'
}

$GraphUserRAToRemedy1 = [PSCustomObject]@{
  ExtensionProperty              = [PSCustomObject]@{
    'odata.metadata'            = 'https://graph.windows.net/7271af30-bd30-4664-a407-c44dc3ca8b12/$metadata#directoryObjects/@Element'
    'odata.type'                = 'Microsoft.DirectoryServices.User'
    createdDateTime             = 'Tue 19 Jul 2022 17:53:06'
    employeeId                  = $null
    onPremisesDistinguishedName = $null
    userIdentities              = @()
  }
  DeletionTimestamp              = $null
  ObjectId                       = '6647e937-7617-443b-ba3b-364a140534f8'
  ObjectType                     = 'User'
  AccountEnabled                 = $False
  AgeGroup                       = $null
  AssignedLicenses               = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    }
  )
  AssignedPlans                  = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = '6dc145d6-95dd-4191-b9c3-185575ee6f6b' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'Sway'
      ServicePlanId     = 'a23b959c - 7ce8-4e57-9140-b90eb88a9e97'
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = 'd2d51368 - 76c9-4317-ada2-a12c004c432f'
    }
  )
  City                           = $null
  CompanyName                    = $null
  ConsentProvidedForMinor        = $null
  Country                        = $null
  CreationType                   = $null
  Department                     = 'Microsoft Communication Application Instance'
  DirSyncEnabled                 = $null
  DisplayName                    = 'NightWatchRA'
  FacsimileTelephoneNumber       = $null
  GivenName                      = $null
  IsCompromised                  = $null
  ImmutableId                    = $null
  JobTitle                       = $null
  LastDirSyncTime                = $null
  LegalAgeGroupClassification    = $null
  Mail                           = 'NightWatchRA@discworld.onmicrosoft.com'
  MailNickName                   = 'NightWatchRA'
  Mobile                         = $null
  OnPremisesSecurityIdentifier   = $null
  OtherMails                     = @()
  PasswordPolicies               = $null
  PasswordProfile                = [PSCustomObject]@{
    Password                     = $null
    ForceChangePasswordNextLogin = $True
    EnforceChangePasswordPolicy  = $False
  }
  PhysicalDeliveryOfficeName     = $null
  PostalCode                     = $null
  PreferredLanguage              = $null
  ProvisionedPlans               = @(
    [PSCustomObject]@{
      CapabilityStatus   = 'Disabled'
      ProvisioningStatus = 'Success'
      Service            = 'MicrosoftCommunicationsOnline'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'SharePoint'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'exchange'
    }
  )
  ProvisioningErrors             = @()
  ProxyAddresses                 = { 'SMTP:NightWatchRA@discworld.onmicrosoft.com' }
  RefreshTokensValidFromDateTime = 'Tue 19 Jul 2022 17:53:05'
  ShowInAddressList              = $null
  SignInNames                    = @()
  SipProxyAddress                = 'NightWatchRA@discworld.onmicrosoft.com'
  State                          = $null
  StreetAddress                  = $null
  Surname                        = $null
  TelephoneNumber                = $null
  UsageLocation                  = 'US'
  UserPrincipalName              = 'NightWatchRA@discworld.onmicrosoft.com'
  UserState                      = $null
  UserStateChangedOn             = $null
  UserType                       = 'Member'
}

$GraphUserRABad1 = [PSCustomObject]@{
  ExtensionProperty              = [PSCustomObject]@{
    'odata.metadata'            = 'https://graph.windows.net/7271af30-bd30-4664-a407-c44dc3ca8b12/$metadata#directoryObjects/@Element'
    'odata.type'                = 'Microsoft.DirectoryServices.User'
    createdDateTime             = 'Tue 19 Jul 2022 17:53:06'
    employeeId                  = $null
    onPremisesDistinguishedName = $null
    userIdentities              = @()
  }
  DeletionTimestamp              = $null
  ObjectId                       = '6647e937-7617-443b-ba3b-364a140534f8'
  ObjectType                     = 'User'
  AccountEnabled                 = $False
  AgeGroup                       = $null
  AssignedLicenses               = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    }
  )
  AssignedPlans                  = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = '6dc145d6-95dd-4191-b9c3-185575ee6f6b' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'Sway'
      ServicePlanId     = 'a23b959c - 7ce8-4e57-9140-b90eb88a9e97'
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = 'd2d51368 - 76c9-4317-ada2-a12c004c432f'
    }
  )
  City                           = $null
  CompanyName                    = $null
  ConsentProvidedForMinor        = $null
  Country                        = $null
  CreationType                   = $null
  Department                     = 'Microsoft Communication Application Instance'
  DirSyncEnabled                 = $null
  DisplayName                    = 'NightWatchRA'
  FacsimileTelephoneNumber       = $null
  GivenName                      = $null
  IsCompromised                  = $null
  ImmutableId                    = $null
  JobTitle                       = $null
  LastDirSyncTime                = $null
  LegalAgeGroupClassification    = $null
  Mail                           = 'NightWatchRA@discworld.onmicrosoft.com'
  MailNickName                   = 'NightWatchRA'
  Mobile                         = $null
  OnPremisesSecurityIdentifier   = $null
  OtherMails                     = @()
  PasswordPolicies               = $null
  PasswordProfile                = [PSCustomObject]@{
    Password                     = $null
    ForceChangePasswordNextLogin = $True
    EnforceChangePasswordPolicy  = $False
  }
  PhysicalDeliveryOfficeName     = $null
  PostalCode                     = $null
  PreferredLanguage              = $null
  ProvisionedPlans               = @(
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'SharePoint'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'exchange'
    }
  )
  ProvisioningErrors             = @()
  ProxyAddresses                 = { 'SMTP:NightWatchRA@discworld.onmicrosoft.com' }
  RefreshTokensValidFromDateTime = 'Tue 19 Jul 2022 17:53:05'
  ShowInAddressList              = $null
  SignInNames                    = @()
  SipProxyAddress                = 'NightWatchRA@discworld.onmicrosoft.com'
  State                          = $null
  StreetAddress                  = $null
  Surname                        = $null
  TelephoneNumber                = $null
  UsageLocation                  = 'US'
  UserPrincipalName              = 'NightWatchRA@discworld.onmicrosoft.com'
  UserState                      = $null
  UserStateChangedOn             = $null
  UserType                       = 'Member'
}

# Users OK
$GraphUserUserGood1 = [PSCustomObject]@{
  ExtensionProperty              = [PSCustomObject]@{
    'odata.metadata'            = 'https://graph.windows.net/7271af30-bd30-4664-a407-c44dc3ca8b12/$metadata#directoryObjects/@Element'
    'odata.type'                = 'Microsoft.DirectoryServices.User'
    createdDateTime             = 'Tue 19 Jul 2022 17:53:06'
    employeeId                  = $null
    onPremisesDistinguishedName = $null
    userIdentities              = @()
  }
  DeletionTimestamp              = $null
  ObjectId                       = '239943fa-1da2-4d80-8cec-cdd3c7239d2c'
  ObjectType                     = 'User'

  AccountEnabled                 = 'True'
  AgeGroup                       = $null
  AssignedLicenses               = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    }
  )
  AssignedPlans                  = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = '6dc145d6-95dd-4191-b9c3-185575ee6f6b' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'Sway'
      ServicePlanId     = 'a23b959c - 7ce8-4e57-9140-b90eb88a9e97'
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = 'd2d51368 - 76c9-4317-ada2-a12c004c432f'
    }
  )
  City                           = $null
  CompanyName                    = $null
  ConsentProvidedForMinor        = $null
  Country                        = $null
  CreationType                   = $null
  Department                     = $null
  DirSyncEnabled                 = $null
  DisplayName                    = 'Sir Samuel Vimes'
  FacsimileTelephoneNumber       = $null
  GivenName                      = 'Samuel'
  IsCompromised                  = $null
  ImmutableId                    = $null
  JobTitle                       = $null
  LastDirSyncTime                = $null
  LegalAgeGroupClassification    = $null
  Mail                           = 'SamVimes@discworld.onmicrosoft.com'
  MailNickName                   = 'SamVimes'
  Mobile                         = $null
  OnPremisesSecurityIdentifier   = $null
  OtherMails                     = @()
  PasswordPolicies               = 'None'
  PasswordProfile                = $null
  PhysicalDeliveryOfficeName     = $null
  PostalCode                     = $null
  PreferredLanguage              = $null
  ProvisionedPlans               = @(
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'MicrosoftCommunicationsOnline'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'SharePoint'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'exchange'
    }
  )
  ProvisioningErrors             = @()
  ProxyAddresses                 = { 'SMTP:SamVimes@discworld.onmicrosoft.com' }
  RefreshTokensValidFromDateTime = 'Tue 31 May 2022 20:33:02'
  ShowInAddressList              = $null
  SignInNames                    = @()
  SipProxyAddress                = 'SamVimes@discworld.onmicrosoft.com'
  State                          = $null
  StreetAddress                  = $null
  Surname                        = 'Vimes'
  TelephoneNumber                = $null
  UsageLocation                  = 'GB'
  UserPrincipalName              = 'SamVimes@discworld.onmicrosoft.com'
  UserState                      = $null
  UserStateChangedOn             = $null
  UserType                       = 'Member'
}

# PhoneSystem License Not Assigned
$GraphUserUserBad1 = [PSCustomObject]@{
  ExtensionProperty              = [PSCustomObject]@{
    'odata.metadata'            = 'https://graph.windows.net/7271af30-bd30-4664-a407-c44dc3ca8b12/$metadata#directoryObjects/@Element'
    'odata.type'                = 'Microsoft.DirectoryServices.User'
    createdDateTime             = 'Tue 19 Jul 2022 17:53:06'
    employeeId                  = $null
    onPremisesDistinguishedName = $null
    userIdentities              = @()
  }
  DeletionTimestamp              = $null
  ObjectId                       = 'b233faf7-208d-47e2-8af2-5e5069f9aa91'
  ObjectType                     = 'User'

  AccountEnabled                 = $false
  AgeGroup                       = $null
  AssignedLicenses               = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    }
  )
  AssignedPlans                  = @(
    [PSCustomObject]@{
      DisabledPlans = @()
      SkuId         = 'c42b9cae-ea4f-4ab7-9717-81576235ccac' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = '6dc145d6-95dd-4191-b9c3-185575ee6f6b' # Swap for multiple scenarios E5, E3+PS, PSVU and bad: E3,etc
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'Sway'
      ServicePlanId     = 'a23b959c - 7ce8-4e57-9140-b90eb88a9e97'
    },
    [PSCustomObject]@{
      AssignedTimestamp = 'Tue 19 Jul 2022 17:54:33'
      CapabilityStatus  = 'Enabled'
      Service           = 'exchange'
      ServicePlanId     = 'd2d51368 - 76c9-4317-ada2-a12c004c432f'
    }
  )
  City                           = $null
  CompanyName                    = $null
  ConsentProvidedForMinor        = $null
  Country                        = $null
  CreationType                   = $null
  Department                     = $null
  DirSyncEnabled                 = $null
  DisplayName                    = 'Reacher Gilt'
  FacsimileTelephoneNumber       = $null
  GivenName                      = 'Reacher'
  IsCompromised                  = $null
  ImmutableId                    = $null
  JobTitle                       = $null
  LastDirSyncTime                = $null
  LegalAgeGroupClassification    = $null
  Mail                           = 'ReacherGilt@discworld.onmicrosoft.com'
  MailNickName                   = 'ReacherGilt'
  Mobile                         = $null
  OnPremisesSecurityIdentifier   = $null
  OtherMails                     = @()
  PasswordPolicies               = 'None'
  PasswordProfile                = $null
  PhysicalDeliveryOfficeName     = $null
  PostalCode                     = $null
  PreferredLanguage              = $null
  ProvisionedPlans               = @(
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'MicrosoftCommunicationsOnline'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'SharePoint'
    },
    [PSCustomObject]@{
      CapabilityStatus   = 'Enabled'
      ProvisioningStatus = 'Success'
      Service            = 'exchange'
    }
  )
  ProvisioningErrors             = @()
  ProxyAddresses                 = { 'SMTP:ReacherGilt@discworld.onmicrosoft.com' }
  RefreshTokensValidFromDateTime = 'Tue 31 May 2022 20:33:02'
  ShowInAddressList              = $null
  SignInNames                    = @()
  SipProxyAddress                = 'ReacherGilt@discworld.onmicrosoft.com'
  State                          = $null
  StreetAddress                  = $null
  Surname                        = 'Gilt'
  TelephoneNumber                = $null
  UsageLocation                  = 'GB'
  UserPrincipalName              = 'ReacherGilt@discworld.onmicrosoft.com'
  UserState                      = $null
  UserStateChangedOn             = $null
  UserType                       = 'Member'
}

#endregion

#Region Graph/Entra ID Group
#TODO what is considered a 'good' group? MailEnabled? How to check for a Microsoft 365 Group
$GraphGroup = [PSCustomObject]@{
  DeletionTimestamp            = $null
  ObjectId                     = 'eba4dabb-dee2-4fcf-ba42-a191e0fdc6af'
  ObjectType                   = 'Group'
  Description                  = 'Committee for Equal Heights'
  DirSyncEnabled               = $null
  DisplayName                  = 'Equal Heights'
  LastDirSyncTime              = $null
  Mail                         = 'equalheights@discworld.onmicrosoft.com'
  MailEnabled                  = $True
  MailNickName                 = 'equalheights'
  OnPremisesSecurityIdentifier = $null
  ProvisioningErrors           = @()
  ProxyAddresses               = @('SMTP:equalheights@discworld.onmicrosoft.com')
  SecurityEnabled              = $False
}






#endregion
#endregion


#region Groups
$MgGroupGood1 = [Microsoft.Graph.PowerShell.Models.MicrosoftGraphGroup]@{
  AcceptedSenders               = $null
  AllowExternalSenders          = $null
  AppRoleAssignments            = $null
  AssignedLabels                = $null
  AssignedLicenses              = $null
  AutoSubscribeNewMembers       = $null
  Calendar                      = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphCalendar]@{}
  CalendarView                  = $null
  Classification                = $null
  Conversations                 = $null
  CreatedDateTime               = 'Sun 25 Dec 2022 05=45=10'
  CreatedOnBehalfOf             = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject]@{}
  DeletedDateTime               = $null
  Description                   = $null
  DisplayName                   = 'Committee for Equal Heights'
  Drive                         = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphDrive]=@{}
  Drives                        = $null
  Events                        = $null
  ExpirationDateTime            = $null
  Extensions                    = $null
  GroupLifecyclePolicies        = $null
  GroupTypes                    = { 'Unified' }
  HasMembersWithLicenseErrors   = $null
  HideFromAddressLists          = $null
  HideFromOutlookClients        = $null
  Id                            = 'baa40d88-cd83-4a24-8cd9-1846b28388fa'
  IsArchived                    = $null
  IsAssignableToRole            = $null
  IsSubscribedByMail            = $null
  LicenseProcessingState        = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphLicenseProcessingState]@{}
  Mail                          = 'equalheights@discworld.onmicrosoft.com'
  MailEnabled                   = $True
  MailNickname                  = 'noHeightDiscrimination'
  MemberOf                      = $null
  Members                       = $null
  MembersWithLicenseErrors      = $null
  MembershipRule                = $null
  MembershipRuleProcessingState = $null
  OnPremisesDomainName          = $null
  OnPremisesLastSyncDateTime    = $null
  OnPremisesNetBiosName         = $null
  OnPremisesProvisioningErrors  = {}
  OnPremisesSamAccountName      = $null
  OnPremisesSecurityIdentifier  = $null
  OnPremisesSyncEnabled         = $null
  Onenote                       = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphOnenote]@{}
  Owners                        = $null
  PermissionGrants              = $null
  Photo                         = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphProfilePhoto]@{}
  Photos                        = $null
  Planner                       = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphPlannerGroup]@{}
  PreferredDataLocation         = $null
  PreferredLanguage             = $null
  ProxyAddresses                = { 'SPO=SPO_69d74024-0c21-4f8c-a7ae-cc7841b19c72@SPO_3fcca77d-eb8e-483a-a313-668ffa74e7ba',
    'SMTP=equalheights@discworld.onmicrosoft.com' }
  RejectedSenders               = $null
  RenewedDateTime               = 'Sun 25 Dec 2022 05=45=10'
  SecurityEnabled               = $False
  SecurityIdentifier            = 'S-1-12-1-238720723-1078180580-2721807001-1722324191'
  Settings                      = $null
  Sites                         = $null
  Team                          = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphTeam]@{ }
  Theme                         = $null
  Threads                       = $null
  TransitiveMemberOf            = $null
  TransitiveMembers             = $null
  UnseenCount                   = $null
  Visibility                    = 'Public'
  AdditionalProperties          = {
    @{ creationOptions = [System.Object[]]@{} }
    @{ resourceBehaviorOptions = [System.Object[]]@{} }
    @{ resourceProvisioningOptions = [System.Object[]]@{} }
    @{ serviceProvisioningErrors = [System.Object[]]@{} }
  }
}
$MgGroupGood2 = [Microsoft.Graph.PowerShell.Models.MicrosoftGraphGroup]@{
  AcceptedSenders               = $null
  AllowExternalSenders          = $null
  AppRoleAssignments            = $null
  AssignedLabels                = $null
  AssignedLicenses              = $null
  AutoSubscribeNewMembers       = $null
  Calendar                      = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphCalendar]@{}
  CalendarView                  = $null
  Classification                = $null
  Conversations                 = $null
  CreatedDateTime               = 'Sun 25 Dec 2022 05=45=10'
  CreatedOnBehalfOf             = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject]@{}
  DeletedDateTime               = $null
  Description                   = $null
  DisplayName                   = 'Ankh Morpork Watch - Night Watch'
  Drive                         = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphDrive]=@{}
  Drives                        = $null
  Events                        = $null
  ExpirationDateTime            = $null
  Extensions                    = $null
  GroupLifecyclePolicies        = $null
  GroupTypes                    = { 'Unified' }
  HasMembersWithLicenseErrors   = $null
  HideFromAddressLists          = $null
  HideFromOutlookClients        = $null
  Id                            = 'c3a541b6-d0a8-4899-a171-2c25dbb12436'
  IsArchived                    = $null
  IsAssignableToRole            = $null
  IsSubscribedByMail            = $null
  LicenseProcessingState        = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphLicenseProcessingState]@{}
  Mail                          = 'nightwatch@discworld.onmicrosoft.com'
  MailEnabled                   = $True
  MailNickname                  = 'AMnightwatch'
  MemberOf                      = $null
  Members                       = $null
  MembersWithLicenseErrors      = $null
  MembershipRule                = $null
  MembershipRuleProcessingState = $null
  OnPremisesDomainName          = $null
  OnPremisesLastSyncDateTime    = $null
  OnPremisesNetBiosName         = $null
  OnPremisesProvisioningErrors  = {}
  OnPremisesSamAccountName      = $null
  OnPremisesSecurityIdentifier  = $null
  OnPremisesSyncEnabled         = $null
  Onenote                       = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphOnenote]@{}
  Owners                        = $null
  PermissionGrants              = $null
  Photo                         = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphProfilePhoto]@{}
  Photos                        = $null
  Planner                       = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphPlannerGroup]@{}
  PreferredDataLocation         = $null
  PreferredLanguage             = $null
  ProxyAddresses                = { 'SPO=SPO_735d51af-d0a2-4644-8545-b95c761a655d@SPO_09d1b60c-9d15-4422-9d7a-617b28223afe',
    'SMTP=nightwatch@discworld.onmicrosoft.com' }
  RejectedSenders               = $null
  RenewedDateTime               = 'Sun 25 Dec 2022 05=45=10'
  SecurityEnabled               = $False
  SecurityIdentifier            = 'S-1-12-1-238720723-1078180580-2721807001-1722324191'
  Settings                      = $null
  Sites                         = $null
  Team                          = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphTeam]@{ }
  Theme                         = $null
  Threads                       = $null
  TransitiveMemberOf            = $null
  TransitiveMembers             = $null
  UnseenCount                   = $null
  Visibility                    = 'Public'
  AdditionalProperties          = {
    @{ creationOptions = [System.Object[]]@{} }
    @{ resourceBehaviorOptions = [System.Object[]]@{} }
    @{ resourceProvisioningOptions = [System.Object[]]@{} }
    @{ serviceProvisioningErrors = [System.Object[]]@{} }
  }
}
$MgGroupBad1 = [Microsoft.Graph.PowerShell.Models.MicrosoftGraphGroup]@{
  AcceptedSenders               = $null
  AllowExternalSenders          = $null
  AppRoleAssignments            = $null
  AssignedLabels                = $null
  AssignedLicenses              = $null
  AutoSubscribeNewMembers       = $null
  Calendar                      = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphCalendar]@{}
  CalendarView                  = $null
  Classification                = $null
  Conversations                 = $null
  CreatedDateTime               = 'Sun 25 Dec 2022 05=45=10'
  CreatedOnBehalfOf             = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphDirectoryObject]@{}
  DeletedDateTime               = $null
  Description                   = $null
  DisplayName                   = 'Guild of Assassins'
  Drive                         = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphDrive]=@{}
  Drives                        = $null
  Events                        = $null
  ExpirationDateTime            = $null
  Extensions                    = $null
  GroupLifecyclePolicies        = $null
  GroupTypes                    = { 'Unified' }
  HasMembersWithLicenseErrors   = $null
  HideFromAddressLists          = $null
  HideFromOutlookClients        = $null
  Id                            = '2b36c736-5972-4e43-9842-0cfa8471a058'
  IsArchived                    = $null
  IsAssignableToRole            = $null
  IsSubscribedByMail            = $null
  LicenseProcessingState        = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphLicenseProcessingState]@{}
  Mail                          = 'assassinsguild@discworld.onmicrosoft.com'
  MailEnabled                   = $True
  MailNickname                  = 'InhumersUnited'
  MemberOf                      = $null
  Members                       = $null
  MembersWithLicenseErrors      = $null
  MembershipRule                = $null
  MembershipRuleProcessingState = $null
  OnPremisesDomainName          = $null
  OnPremisesLastSyncDateTime    = $null
  OnPremisesNetBiosName         = $null
  OnPremisesProvisioningErrors  = {}
  OnPremisesSamAccountName      = $null
  OnPremisesSecurityIdentifier  = $null
  OnPremisesSyncEnabled         = $null
  Onenote                       = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphOnenote]@{}
  Owners                        = $null
  PermissionGrants              = $null
  Photo                         = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphProfilePhoto]@{}
  Photos                        = $null
  Planner                       = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphPlannerGroup]@{}
  PreferredDataLocation         = $null
  PreferredLanguage             = $null
  ProxyAddresses                = { 'SPO=SPO_efb4f086-1923-4427-8952-ca2634d36580@SPO_5e2c2a20-0b00-4f08-af66-1b1b3b416b69',
    'SMTP=assassinsguild@discworld.onmicrosoft.com' }
  RejectedSenders               = $null
  RenewedDateTime               = 'Sun 25 Dec 2022 05=45=10'
  SecurityEnabled               = $False
  SecurityIdentifier            = 'S-1-12-1-238720723-1078180580-2721807001-1722324191'
  Settings                      = $null
  Sites                         = $null
  Team                          = $null # Nested Object not required. [Microsoft.Graph.PowerShell.Models.MicrosoftGraphTeam]@{ }
  Theme                         = $null
  Threads                       = $null
  TransitiveMemberOf            = $null
  TransitiveMembers             = $null
  UnseenCount                   = $null
  Visibility                    = 'Public'
  AdditionalProperties          = {
    @{ creationOptions = [System.Object[]]@{} }
    @{ resourceBehaviorOptions = [System.Object[]]@{} }
    @{ resourceProvisioningOptions = [System.Object[]]@{} }
    @{ serviceProvisioningErrors = [System.Object[]]@{} }
  }
}
# All Groups for loading with -All and searching for them
$MgGroupAll = @($MgGroupGood1, $MgGroupGood2, $MgGroupBad1)
#endregion

#region Teams, Channels, etc.
#region Team
$TeamGood = [PSCustomObject]@{
  GroupId                           = '6c105977-d636-419a-b5f3-4885375e432a'
  InternalId                        = '19:6knN4Rzr3_NUiCsVwEtrHvYWbp_MzqbPp9fEyqujZVc1@thread.tacv2'
  DisplayName                       = 'Night Watch'
  Description                       = 'Night Watch'
  Visibility                        = 'Public'
  MailNickName                      = 'NightWatch'
  Classification                    = $null
  Archived                          = $False
  AllowGiphy                        = $True
  GiphyContentRating                = 'moderate'
  AllowStickersAndMemes             = $True
  AllowCustomMemes                  = $True
  AllowGuestCreateUpdateChannels    = $False
  AllowGuestDeleteChannels          = $False
  AllowCreateUpdateChannels         = $True
  AllowCreatePrivateChannels        = $True
  AllowDeleteChannels               = $True
  AllowAddRemoveApps                = $True
  AllowCreateUpdateRemoveTabs       = $True
  AllowCreateUpdateRemoveConnectors = $True
  AllowUserEditMessages             = $True
  AllowUserDeleteMessages           = $True
  AllowOwnerDeleteMessages          = $True
  AllowTeamMentions                 = $True
  AllowChannelMentions              = $True
  ShowInTeamsSearchAndSuggestions   = $True
}
#endregion

#region TeamChannel - Output of Get-TeamChanenl
$TeamChannelGood = @(
  [PSCustomObject]@{
    Id             = '19:5e61bcffc0e54c5d915b17f6a0796a42@thread.tacv2'
    DisplayName    = 'Night Watch - Duty Roster'
    Description    = 'Duty roster for the Night Watch'
    MembershipType = 'Standard'
  },
  [PSCustomObject]@{
    Id             = '19:6knN4Rzr3_NUiCsVwEtrHvYWbp_MzqbPp9fEyqujZVc1@thread.tacv2'
    DisplayName    = 'General'
    Description    = 'General Enquiries'
    MembershipType = 'Standard'
  },
  [PSCustomObject]@{
    Id             = '19:e4236b10aa244631be8f16eb14c7d982@thread.tacv2'
    DisplayName    = 'Night Watch - Noise Complaints'
    Description    = 'Noise Complaints'
    MembershipType = 'Standard'
  }
)
#endregion

#region Channel
$ChannelGood = [PSCustomObject]@{
  Id             = '19:5e61bcffc0e54c5d915b17f6a0796a42@thread.tacv2'
  DisplayName    = 'Night Watch - Duty Roster'
  Description    = 'Duty roster for the Night Watch'
  MembershipType = 'Standard'
}
#endregion
#endregion


#region Language, AudioFiles, Prompts, CQ-Triggers
#region Language
$LanguageObjectEN_AU = @{
  Id                     = 'en-AU'
  DisplayName            = 'English (Australia)'
  Voices                 = @('WilliamNeural', 'NatashaNeural')
  VoiceResponseSupported = $True
}

$LanguageObjectEN_US = @{
  Id                     = 'en-US'
  DisplayName            = 'English (United States)'
  Voices                 = @('GuyNeural', 'JessaNeural', 'AriaNeural', 'JennyNeural')
  VoiceResponseSupported = $True
}

$LanguageObjectNL_NL = @{
  Id                     = 'nl-NL'
  DisplayName            = 'Dutch (Netherlands)'
  Voices                 = @('ColetteNeural', 'FennaNeural', 'MaartenNeural')
  VoiceResponseSupported = $False
}

#region Creating ArgumentCompleter for LanguageId
#FIX this does not work yet! - still getting System.Management.Automation.ParameterBindingValidationException when testing
$AllLanguageObjects = [PSCustomObject]@(
  @{
    Id                     = 'ar-EG'
    DisplayName            = 'Arabic (Egypt)'
    Voices                 = 'SalmaNeural'
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'ar-SA'
    DisplayName            = 'Arabic (Saudi Arabia)'
    Voices                 = 'ZariyahNeural'
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'bg-BG'
    DisplayName            = 'Bulgarian (Bulgaria)'
    Voices                 = { 'KalinaNeural', 'BorislavNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'ca-ES'
    DisplayName            = 'Catalan (Spain)'
    Voices                 = { 'AlbaNeural', 'JoanaNeural', 'EnricNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'cs-CZ'
    DisplayName            = 'Czech (Czech)'
    Voices                 = { 'AntoninNeural', 'VlastaNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'cy-GB'
    DisplayName            = 'Welsh (United Kingdom)'
    Voices                 = { 'NiaNeural', 'AledNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'da-DK'
    DisplayName            = 'Danish (Denmark)'
    Voices                 = { 'JeppeNeural', 'ChristelNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'de-AT'
    DisplayName            = 'German (Austria)'
    Voices                 = { 'IngridNeural', 'JonasNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'de-CH'
    DisplayName            = 'German (Switzerland)'
    Voices                 = { 'JanNeural', 'LeniNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'de-DE'
    DisplayName            = 'German (Germany)'
    Voices                 = { 'KatjaNeural', 'ConradNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'el-GR'
    DisplayName            = 'Greek (Greek)'
    Voices                 = { 'AthinaNeural', 'NestorasNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'en-AU'
    DisplayName            = 'English (Australia)'
    Voices                 = { 'WilliamNeural', 'NatashaNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'en-CA'
    DisplayName            = 'English (Canada)'
    Voices                 = { 'LiamNeural', 'ClaraNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'en-GB'
    DisplayName            = 'English (United Kingdom)'
    Voices                 = { 'RyanNeural', 'LibbyNeural', 'MiaNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'en-IE'
    DisplayName            = 'English (Ireland)'
    Voices                 = { 'ConnorNeural', 'EmilyNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'en-IN'
    DisplayName            = 'English (India)'
    Voices                 = { 'PrabhatNeural', 'NeerjaNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'en-PH'
    DisplayName            = 'English (Philippines)'
    Voices                 = { 'JamesNeural', 'RosaNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'en-US'
    DisplayName            = 'English (United States)'
    Voices                 = { 'GuyNeural', 'JessaNeural', 'AriaNeural', 'JennyNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'en-ZA'
    DisplayName            = 'English (South Africa)'
    Voices                 = { 'LeahNeural', 'LukeNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'es-ES'
    DisplayName            = 'Spanish (Spain)'
    Voices                 = { 'ElviraNeural', 'AlvaroNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'es-MX'
    DisplayName            = 'Spanish (Mexico)'
    Voices                 = { 'DaliaNeural', 'JorgeNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'et-EE'
    DisplayName            = 'Estonian (Estonia)'
    Voices                 = { 'AnuNeural', 'KertNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'fi-FI'
    DisplayName            = 'Finnish (Finland)'
    Voices                 = { 'NooraNeural', 'HarriNeural', 'SelmaNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'fr-BE'
    DisplayName            = 'French (Belgium)'
    Voices                 = { 'CharlineNeural', 'GerardNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'fr-CA'
    DisplayName            = 'French (Canada)'
    Voices                 = { 'SylvieNeural', 'AntoineNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'fr-CH'
    DisplayName            = 'French (Switzerland)'
    Voices                 = { 'ArianeNeural', 'FabriceNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'fr-FR'
    DisplayName            = 'French (France)'
    Voices                 = { 'DeniseNeural', 'HenriNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'he-IL'
    DisplayName            = 'Hebrew (Israel)'
    Voices                 = { 'AvriNeural', 'HilaNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'hi-IN'
    DisplayName            = 'Hindi (India)'
    Voices                 = { 'SwaraNeural', 'MadhurNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'hr-HR'
    DisplayName            = 'Croatian (Croatia)'
    Voices                 = { 'GabrijelaNeural', 'SreckoNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'hu-HU'
    DisplayName            = 'Hungarian (Hungary)'
    Voices                 = { 'NoemiNeural', 'TamasNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'id-ID'
    DisplayName            = 'Indonesian (Indonesia)'
    Voices                 = 'GadisNeural'
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'it-IT'
    DisplayName            = 'Italian (Italy)'
    Voices                 = { 'ElsaNeural', 'IsabellaNeural', 'DiegoNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'lt-LT'
    DisplayName            = 'Lithuanian (Lithuania)'
    Voices                 = { 'LeonasNeural', 'OnaNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'lv-LV'
    DisplayName            = 'Latvian (Latvia)'
    Voices                 = { 'EveritaNeural', 'NilsNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'ja-JP'
    DisplayName            = 'Japanese (Japan)'
    Voices                 = { 'NanamiNeural', 'KeitaNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'ko-KR'
    DisplayName            = 'Korean (Korea)'
    Voices                 = { 'SunHiNeural', 'InJoonNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'nb-NO'
    DisplayName            = 'Norwegian', 'Bokmål (Norway)'
    Voices                 = { 'IselinNeural', 'FinnNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'nl-BE'
    DisplayName            = 'Dutch (Belgium)'
    Voices                 = { 'DenaNeural', 'ArnaudNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'nl-NL'
    DisplayName            = 'Dutch (Netherlands)'
    Voices                 = { 'ColetteNeural', 'FennaNeural', 'MaartenNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'pl-PL'
    DisplayName            = 'Polish (Poland)'
    Voices                 = { 'ZofiaNeural', 'MarekNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'pt-BR'
    DisplayName            = 'Portuguese (Brazil)'
    Voices                 = { 'FranciscaNeural', 'AntonioNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'pt-PT'
    DisplayName            = 'Portuguese (Portugal)'
    Voices                 = { 'FernandaNeural', 'DuarteNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'ro-RO'
    DisplayName            = 'Romanian (Romania)'
    Voices                 = { 'AlinaNeural', 'EmilNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'ru-RU'
    DisplayName            = 'Russian (Russia)'
    Voices                 = { 'DariyaNeural', 'DmitryNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'sk-SK'
    DisplayName            = 'Slovak (Slovakia)'
    Voices                 = { 'LukasNeural', 'ViktoriaNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'sl-SI'
    DisplayName            = 'Slovenian (Slovenia)'
    Voices                 = { 'PetraNeural', 'RokNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'sv-SE'
    DisplayName            = 'Swedish (Sweden)'
    Voices                 = { 'HilleviNeural', 'MattiasNeural', 'SofieNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'th-TH'
    DisplayName            = 'Thai (Thai)'
    Voices                 = { 'AcharaNeural', 'NiwatNeural', 'PremwadeeNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'tr-TR'
    DisplayName            = 'Turkish (Turkey)'
    Voices                 = { 'EmelNeural', 'AhmetNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'vi-VN'
    DisplayName            = 'Vietnamese (Vietnam)'
    Voices                 = { 'HoaiMyNeural', 'NamMinhNeural' }
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'zh-CN'
    DisplayName            = 'Chinese (Simplified', 'PRC)'
    Voices                 = { 'XiaoxiaoNeural', 'XiaoyouNeural', 'YunyangNeural', 'YunyeNeural' }
    VoiceResponseSupported = $True
  }, @{
    Id                     = 'zh-HK'
    DisplayName            = 'Chinese (Traditional', 'Hong Kong S.A.R.)'
    Voices                 = 'HiuGaaiNeural'
    VoiceResponseSupported = $False
  }, @{
    Id                     = 'zh-TW'
    DisplayName            = 'Chinese (Traditional', 'Taiwan)'
    Voices                 = { 'HsiaoYuNeural', 'HsiaoChenNeural' }
    VoiceResponseSupported = $False
  }
)
#$AllLanguageObjects.PSObject.TypeNames.Insert(0, 'Microsoft.Rtc.Management.Hosted.OAA.Models.Language')
#endregion
#endregion

#region AudioFile
$AudioFile1 = @{
  Id                = 'c765ec9ec1d742bdbab836547af9eab8'
  FileName          = 'file.mp3'
  ApplicationId     = 'HuntGroup'
  MarkedForDeletion = $True
}
#endregion

#region New-TeamsCallQueueTrigger
$TeamsCallQueueTriggerText1 = @{
  Type      = 'TextToSpeechPrompt'
  Prompt    = 'OverflowPrompt'
  Value     = 'There are too many people waiting'
  Parameter = 'Overflow*TextToSpeechPrompt'
}

$TeamsCallQueueTriggerText2 = @{
  Type      = 'TextToSpeechPrompt'
  Prompt    = 'TimeoutPrompt'
  Value     = 'Sorry, we are busy'
  Parameter = 'Timeout*TextToSpeechPrompt'
}

$TeamsCallQueueTriggerFile1 = @{
  Type      = 'AudioFilePrompt'
  Prompt    = 'NoAgentPrompt'
  Value     = '9efd8d3a5d7e4fde9e8a37c2bccad5f6'
  Parameter = 'NoAgent*AudioFilePrompt'
}
#endregion

#region Checkpoint-TeamsCallQueuePrompt
$TeamsCallQueuePromptGreeting1 = @{
  Type      = 'TextToSpeechPrompt'
  Prompt    = 'Greeting'
  Value     = 'Welcome to Contoso'
  Parameter = 'WelcomeTextToSpeechPrompt'
}

$TeamsCallQueuePromptGreeting2 = @{
  Type      = 'AudioFilePrompt'
  Prompt    = 'Greeting'
  Value     = 'f7efaa28c93c444aa1b054487f384a12'
  Parameter = 'WelcomeMusicAudioFileId'
}

$TeamsCallQueuePromptMusic = @{
  Type      = 'AudioFilePrompt'
  Prompt    = 'MusicOnHold'
  Value     = '88e207cb19c443f9a626f6c9e93f9648'
  Parameter = 'MusicOnHoldAudioFileId'
}

$TeamsCallQueuePromptText1 = @{
  Type      = 'TextToSpeechPrompt'
  Prompt    = 'OverflowPrompt'
  Value     = 'There are too many people waiting'
  Parameter = 'Overflow*TextToSpeechPrompt'
}

$TeamsCallQueuePromptText2 = @{
  Type      = 'TextToSpeechPrompt'
  Prompt    = 'TimeoutPrompt'
  Value     = 'Sorry, we are busy'
  Parameter = 'Timeout*TextToSpeechPrompt'
}

$TeamsCallQueuePromptFile1 = @{
  Type      = 'AudioFilePrompt'
  Prompt    = 'NoAgentPrompt'
  Value     = '9efd8d3a5d7e4fde9e8a37c2bccad5f6'
  Parameter = 'NoAgent*AudioFilePrompt'
}
#endregion
#endregion

#region CallableEntity
<# This will not work as the Class is not yet imported
$TCE_User = [OrbitCallableEntity]::new( 'User@domain.com', 'ea786976-e4c1-4351-912a-58718ef3845e', 'User', 'User')
$TCE_RA = [OrbitCallableEntity]::new( 'ResourceAccount@domain.com', '8d72f1a6-1219-4c00-bcd1-605ee5531df8', 'ResourceAccount', 'ApplicationEndpoint')
$TCE_Channel = [OrbitCallableEntity]::new( 'ChannelName', 'aa8dd453-f7b3-4fa1-8d04-554ae6e56285', 'Channel', 'Channel')
$TCE_Group = [OrbitCallableEntity]::new( 'GroupName', '151d7807-4610-45f5-bc53-5d547083b990', 'Group', 'SharedVoicemail')
$TCE_TelUri = [OrbitCallableEntity]::new( '+15551234567', '+15551234567', 'TelURI', 'ExternalPstn')
$TCE_Unknown = [OrbitCallableEntity]::new( "Not Determined Entity", $null, 'Unknown', $null )
#>

$TCE_User = @{
  Entity     = 'User@domain.com'
  Identity   = 'ea786976-e4c1-4351-912a-58718ef3845e'
  ObjectType = 'User'
  Type       = 'User'
}
$TCE_RA = @{
  Entity     = 'ResourceAccount@domain.com'
  Identity   = '8d72f1a6-1219-4c00-bcd1-605ee5531df8'
  ObjectType = 'ResourceAccount'
  Type       = 'ApplicationEndpoint'
}
$TCE_Channel = @{
  Entity     = 'ChannelName'
  Identity   = 'aa8dd453-f7b3-4fa1-8d04-554ae6e56285'
  ObjectType = 'Channel'
  Type       = 'Channel'
}
$TCE_Group = @{
  Entity     = 'GroupName'
  Identity   = '151d7807-4610-45f5-bc53-5d547083b990'
  ObjectType = 'Group'
  Type       = 'SharedVoicemail'
}
$TCE_TelUri = @{
  Entity     = '+15551234567'
  Identity   = '+15551234567'
  ObjectType = 'TelURI'
  Type       = 'ExternalPstn'
}
$TCE_Unknown = @{
  Entity     = 'Not Determined Entity'
  Identity   = $null
  ObjectType = 'Unknown'
  Type       = $null
}
#endregion