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

Fix export and set of phone numbers #5855

Open
wants to merge 1 commit into
base: Dev
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log for Microsoft365DSC

# UNRELEASED

* AADUser
* Fixed an issue where the properties with numbers were not exported correctly.
FIXES [#4526](https://github.com/microsoft/Microsoft365DSC/issues/4526)

# 1.25.226.1

* AADConditionalAccessPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function Get-TargetResource
}

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', 'PasswordPolicies')
$propertiesToRetrieve = @('Id', 'UserPrincipalName', 'DisplayName', 'GivenName', 'Surname', 'UsageLocation', 'City', 'Country', 'Department', 'FaxNumber', 'MobilePhone', 'OfficeLocation', 'BusinessPhones', 'PostalCode', 'PreferredLanguage', 'State', 'StreetAddress', 'JobTitle', 'UserType', 'PasswordPolicies')
$user = Get-MgUser -UserId $UserPrincipalName -Property $propertiesToRetrieve -ErrorAction SilentlyContinue
if ($null -eq $user)
{
Expand Down Expand Up @@ -234,12 +234,12 @@ function Get-TargetResource
City = $user.City
Country = $user.Country
Department = $user.Department
Fax = $user.FacsimileTelephoneNumber
MobilePhone = $user.Mobile
Fax = $user.FaxNumber
MobilePhone = $user.MobilePhone
Office = $user.OfficeLocation
PasswordNeverExpires = $passwordNeverExpires
PasswordPolicies = $user.PasswordPolicies
PhoneNumber = $user.TelephoneNumber
PhoneNumber = $user.BusinessPhones | Select-Object -First 1
PostalCode = $user.PostalCode
PreferredLanguage = $user.PreferredLanguage
State = $user.State
Expand Down Expand Up @@ -444,18 +444,18 @@ function Set-TargetResource
Country = $Country
Department = $Department
DisplayName = $DisplayName
FacsimileTelephoneNumber = $Fax
FaxNumber = $Fax
GivenName = $FirstName
JobTitle = $Title
Mobile = $MobilePhone
MobilePhone = $MobilePhone
PasswordPolicies = $PasswordPolicies
OfficeLocation = $Office
PostalCode = $PostalCode
PreferredLanguage = $PreferredLanguage
State = $State
StreetAddress = $StreetAddress
Surname = $LastName
TelephoneNumber = $PhoneNumber
BusinessPhones = $PhoneNumber
UsageLocation = $UsageLocation
UserPrincipalName = $UserPrincipalName
UserType = $UserType
Expand Down