You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$TestResult=Test-CIPPStandardLicense-StandardName 'GroupTemplate'-TenantFilter $Tenant-RequiredCapabilities @('EXCHANGE_S_STANDARD','EXCHANGE_S_ENTERPRISE','EXCHANGE_S_STANDARD_GOV','EXCHANGE_S_ENTERPRISE_GOV','EXCHANGE_LITE') #No Foundation because that does not allow powershell access
@@ -67,6 +63,11 @@ function Invoke-CIPPStandardGroupTemplate {
67
63
if ($groupobj.groupType-in'Generic','azurerole','dynamic','Security') {
68
64
$GraphRequest=New-GraphPostRequest-uri 'https://graph.microsoft.com/beta/groups'-tenantid $tenant-type POST -body (ConvertTo-Json-InputObject $BodyToship-Depth 10) -verbose
69
65
} else {
66
+
if (!$TestResult) {
67
+
Write-LogMessage-API 'Standards'-tenant $tenant-message "Cannot create group $($groupobj.displayname) as the tenant is not licensed for Exchange."-Sev 'Error'
68
+
continue
69
+
}
70
+
70
71
if ($groupobj.groupType-eq'dynamicdistribution') {
71
72
$Params=@{
72
73
Name=$groupobj.Displayname
@@ -92,6 +93,10 @@ function Invoke-CIPPStandardGroupTemplate {
92
93
if ($groupobj.groupType-in'Generic','azurerole','dynamic') {
Write-LogMessage-API 'Standards'-tenant $tenant-message "Cannot update group $($groupobj.displayname) as the tenant is not licensed for Exchange."-Sev 'Error'
98
+
continue
99
+
}
95
100
if ($groupobj.groupType-eq'dynamicdistribution') {
0 commit comments