Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois committed Apr 8, 2020
1 parent 58eab82 commit 59bb047
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,7 @@ function Set-TargetResource
{
$emails += $email + ";"
}
if ($emails.EndsWith(';'))
{
$emails = $emails.SubString(0, $emails.Length-1)
}
$emails = $emails.TrimEnd(';')
$creationParams.AlternateNotificationEmails = $emails
New-AzureADMSGroupLifecyclePolicy @creationParams
}
Expand All @@ -163,10 +160,7 @@ function Set-TargetResource
{
$emails += $email + ";"
}
if ($emails.EndsWith(';'))
{
$emails = $emails.SubString(0, $emails.Length-1)
}
$emails = $emails.TrimEnd(';')
$updateParams.AlternateNotificationEmails = $emails
$updateParams.Add("Id", (Get-AzureADMSGroupLifecyclePolicy).Id)

Expand Down Expand Up @@ -217,8 +211,6 @@ function Test-TargetResource
Write-Verbose -Message "Testing configuration of AzureAD Groups Lifecycle Policy"

$CurrentValues = Get-TargetResource @PSBoundParameters

Write-Verbose -Message "Current Values: $(Convert-O365DscHashtableToString -Hashtable $CurrentValues)"
Write-Verbose -Message "Target Values: $(Convert-O365DscHashtableToString -Hashtable $PSBoundParameters)"

$ValuesToCheck = $PSBoundParameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ class MSFT_AADMSGroupLifecyclePolicy : OMI_BaseResource
[Required, Description("The number of days a group can exist before it needs to be renewed.")] UInt32 GroupLifetimeInDays;
[Required, Description("This parameter allows the admin to select which office 365 groups the policy will apply to. 'None' will create the policy in a disabled state. 'All' will apply the policy to every Office 365 group in the tenant. 'Selected' will allow the admin to choose specific Office 365 groups that the policy will apply to."), ValueMap{"All","None", "Selected"}, Values{"All","None", "Selected"}] String ManagedGroupTypes;
[Required, Description("Notification emails for groups that have no owners will be sent to these email addresses.")] String AlternateNotificationEmails[];
[Write, Description("Specify if the Azure AD Groups Naming Policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Specify if the Azure AD Groups Lifecycle Policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Required, Description("Credentials of the Azure Active Directory Admin"), EmbeddedInstance("MSFT_Credential")] String GlobalAdminAccount;
};

0 comments on commit 59bb047

Please sign in to comment.