Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois committed Dec 8, 2022
1 parent d73f86b commit 855df50
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
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

0 comments on commit 855df50

Please sign in to comment.