Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2598 #2641

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
* AADUser
* Fixes an issue where provided password wa never honored.
FIXES [#2599](https://github.com/microsoft/Microsoft365DSC/issues/2599)
* Added support for the PasswordPolicies property.
FIXES [#2598](https://github.com/microsoft/Microsoft365DSC/issues/2598)
* PlannerBucket & PlannerPlan
* Changed invalid permissions in the setting.json files
* Changed invalid permissions in the setting.json files.
FIXES [#2629](https://github.com/microsoft/Microsoft365DSC/issues/2629)
* TeamsChannel
* Fixes an issue where channels weren't created if a non-existing GroupId was specified.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function Get-TargetResource
[System.Boolean]
$PasswordNeverExpires = $false,

[Parameter()]
[System.String]
$PasswordPolicies,

[Parameter()]
[System.String]
$PhoneNumber,
Expand Down Expand Up @@ -163,7 +167,7 @@ function Get-TargetResource
try
{
Write-Verbose -Message "Getting Office 365 User $UserPrincipalName"
$propertiesToRetrieve = @('Id', 'UserPrincipalName', 'DisplayName', 'GivenName', 'Surname', 'UsageLocation', 'City', 'Country', 'Department', 'FacsimileTelephoneNumber', 'Mobile', 'OfficeLocation', 'TelephoneNumber', 'PostalCode', 'PreferredLanguage', 'State', 'StreetAddress', 'JobTitle', 'UserType')
$propertiesToRetrieve = @('Id', 'UserPrincipalName', 'DisplayName', 'GivenName', 'Surname', 'UsageLocation', 'City', 'Country', 'Department', 'FacsimileTelephoneNumber', 'Mobile', 'OfficeLocation', 'TelephoneNumber', 'PostalCode', 'PreferredLanguage', 'State', 'StreetAddress', 'JobTitle', 'UserType', 'PasswordPolicies')
$user = Get-MgUser -UserId $UserPrincipalName -Property $propertiesToRetrieve -ErrorAction SilentlyContinue
if ($null -eq $user)
{
Expand Down Expand Up @@ -207,6 +211,7 @@ function Get-TargetResource
MobilePhone = $user.Mobile
Office = $user.OfficeLocation
PasswordNeverExpires = $passwordNeverExpires
PasswordPolicies = $user.PasswordPolicies
PhoneNumber = $user.TelephoneNumber
PostalCode = $user.PostalCode
PreferredLanguage = $user.PreferredLanguage
Expand Down Expand Up @@ -297,6 +302,10 @@ function Set-TargetResource
[System.Boolean]
$PasswordNeverExpires = $false,

[Parameter()]
[System.String]
$PasswordPolicies,

[Parameter()]
[System.String]
$PhoneNumber,
Expand Down Expand Up @@ -619,6 +628,10 @@ function Test-TargetResource
[System.Boolean]
$PasswordNeverExpires = $false,

[Parameter()]
[System.String]
$PasswordPolicies,

[Parameter()]
[System.String]
$PhoneNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class MSFT_AADUser : OMI_BaseResource
[Write, Description("The Mobile Phone Number of the user")] String MobilePhone;
[Write, Description("The Office Name of the user")] String Office;
[Write, Description("Specifies whether the user password expires periodically. Default value is false")] Boolean PasswordNeverExpires;
[Write, Description("Specifies password policies for the user.")] String PasswordPolicies;
[Write, Description("The Phone Number of the user")] String PhoneNumber;
[Write, Description("The Postal Code of the user")] String PostalCode;
[Write, Description("The Prefered location to store data of the user")] String PreferredDataLocation;
Expand Down