Private/PartnerMenu/Start-PartnerMenuTenantCreation.ps1
function Start-PartnerMenuTenantInitilization() { $TenantDomain = Read-Host "Please enter the tenant default domain (e.g. customerdomain.onmicrosoft.com)" Connect-CustomerGraph -CustomerTenantId $Script:config.PartnerTenantId -FlowType Delegated $Tenants = Get-MgContract -All $Tenants = $Tenants | Select-Object -Property DisplayName, DefaultDomainName, CustomerId, Id $Tenant = $Tenants | Where-Object { $_.DefaultDomainName -eq $TenantDomain } | Select-Object -First 1 if(!$Tenant) { Write-Error "Failed to find tenant with default domain: $($TenantDomain)" Read-Host "Press any key to continue.." Start-PartnerMenu } Clear-Host Get-PartnerMenuHeader -SectionString "($($Tenant.displayName)) - Tenant Initilization" Initialize-CustomerTenant -CustomerTenantId $Tenant.CustomerId Read-Host "Press any key to continue.." } |