Skip to content

Commit

Permalink
Merge pull request #3162 from microsoft/Dev
Browse files Browse the repository at this point in the history
Release 1.23.412.1
  • Loading branch information
ykuijs authored Apr 12, 2023
2 parents 5a453e7 + 584b70f commit d243657
Show file tree
Hide file tree
Showing 101 changed files with 16,648 additions and 1,837 deletions.
27 changes: 2 additions & 25 deletions .github/workflows/Unit Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,9 @@ jobs:
- name: Install Modules
shell: pwsh
run: |
$Manifest = Import-PowerShellDataFile './Modules/Microsoft365DSC/Dependencies/Manifest.psd1'
foreach ($module in $Manifest.Dependencies)
{
Write-Verbose -Message "Installing module: $($module.ModuleName)"
if ($module.AllowPreRelease)
{
try
{
Install-Module $module.ModuleName -AllowPreRelease -Force -Scope AllUsers
}
catch
{}
}
else
{
try
{
Install-Module $module.ModuleName -RequiredVersion $module.RequiredVersion -Force -Scope AllUsers
}
catch
{}
}
}
Install-Module ReverseDSC -Force -Scope AllUsers
Install-Module PSDesiredStateConfiguration -Force -Scope AllUsers
Install-Module Pester -Force -SkipPublisherCheck -RequiredVersion 5.4.0 -Scope AllUsers
Install-Module Pester -Force -SkipPublisherCheck -Scope AllUsers
[System.Environment]::SetEnvironmentVariable('M365DSCTelemetryEnabled', $false, [System.EnvironmentVariableTarget]::Machine);
- name: Run Quality Checks
shell: pwsh
Expand Down
67 changes: 50 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,40 @@
# Change log for Microsoft365DSC

# 1.23.405.1
# 1.23.412.1

* IntuneDeviceEnrollmentPlatformRestriction
* [BREAKING CHANGE] Updated resource to manage single and default platform restriction policies
FIXES [#2347](https://github.com/microsoft/Microsoft365DSC/issues/2347)
* IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10
* AADUser
* Password property will only used with New-MgUser and ignored for updates
FIXES [#3093](https://github.com/microsoft/Microsoft365DSC/issues/3093)
* IntuneDeviceConfigurationAdministrativeTemplatePolicyWindows10
* Initial release
FIXES [#2833](https://github.com/microsoft/Microsoft365DSC/issues/2833)
* IntuneDeviceConfigurationCustomPolicyWindows10
* Initial Release
FIXES [#2830](https://github.com/microsoft/Microsoft365DSC/issues/2830)
* IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10
FIXES [#3068](https://github.com/microsoft/Microsoft365DSC/issues/3068)
* IntuneDeviceConfigurationDomainJoinPolicyWindows10
* Initial release
* IntuneDeviceConfigurationPolicyWindows10
* [BREAKING CHANGE] Added complex parameters as embedded CIM (DefenderDetectedMalwareActions, EdgeHomeButtonConfiguration, EdgeSearchEngine, NetworkProxyServer, Windows10AppsForceUpdateSchedule)
* Resource regenerated with DRG
* FIXES[#2867](https://github.com/microsoft/Microsoft365DSC/issues/2867)
* FIXES[#2868](https://github.com/microsoft/Microsoft365DSC/issues/2868)
* IntuneDeviceEnrollmentStatusPageWindows10
* [BREAKING CHANGE] Renamed resource IntuneDeviceEnrollmentConfigurationWindows10 to IntuneDeviceEnrollmentStatusPageWindows10
* Added support for property Assignments.
* Added support for property Priority
* FIXES [#2933](https://github.com/microsoft/Microsoft365DSC/issues/2933)
* IntuneDeviceConfigurationFirmwareInterfacePolicyWindows10
* Initial release
* IntuneDeviceConfigurationWindowsTeamPolicyWindows10
* Initial release
* O365SearchAndIntelligenceConfigurations
* Initial release.
* TeamsUpdateManagementPolicy
* Added support for the Forced value for the AllowPublicPreview property.
* DRG
* Fixed layout and display issues in module file
* MISC
* Changed Get-MgDeviceManagementDeviceConfiguration to use the cmdlet switches rather than filtering output once returned.
Fixes #3082
* M365DSCUtil: Fixed an issue when calling Assert-M365DSCBlueprint with App credentials
FIXES [#3153](https://github.com/microsoft/Microsoft365DSC/issues/3153)
* Added check to validate that the Release Notes in the module manifest are not longer than
10,000 characters, which will prevent publishing the module to the PowerShell Gallery
* DEPENDENCIES
* Updated Microsoft.PowerApps.Administration.PowerShell dependencies to version 2.0.159.

# 1.23.405.1

* AADAdministrativeUnit
* [BREAKING CHANGE] Setting Id as Key parameter and DisplayName as Required
* Fixes extraction of the Members property.
Expand Down Expand Up @@ -88,6 +103,11 @@
* [BREAKING CHANGE] Setting Identity as Key parameter and DisplayName as Required
* IntuneAttackSurfaceReductionRulesPolicyWindows10ConfigManager
* [BREAKING CHANGE] Fix resource
* IntuneDeviceConfigurationHealthMonitoringConfigurationPolicyWindows10
* Initial Release
FIXES [#2830](https://github.com/microsoft/Microsoft365DSC/issues/2830)
* IntuneDeviceConfigurationNetworkBoundaryPolicyWindows10
* Initial release
* IntuneDeviceConfigurationPolicyAndroidDeviceAdministrator, IntuneDeviceConfigurationPolicyAndroidDeviceOwner,
IntuneDeviceConfigurationPolicyAndroidOpenSourceProject, IntuneDeviceConfigurationPolicyMacOS,
IntuneDeviceConfigurationPolicyiOS, IntuneExploitProtectionPolicyWindows10SettingCatalog,
Expand All @@ -98,6 +118,19 @@
* [BREAKING CHANGE] Setting Id as Key parameter and DisplayName as Required
* Properly escapes single quotes from CIMInstances string values.
FIXES [#3117](https://github.com/microsoft/Microsoft365DSC/issues/3117)
* IntuneDeviceConfigurationPolicyWindows10
* [BREAKING CHANGE] Added complex parameters as embedded CIM (DefenderDetectedMalwareActions, EdgeHomeButtonConfiguration, EdgeSearchEngine, NetworkProxyServer, Windows10AppsForceUpdateSchedule)
* Resource regenerated with DRG
FIXES[#2867](https://github.com/microsoft/Microsoft365DSC/issues/2867)
FIXES[#2868](https://github.com/microsoft/Microsoft365DSC/issues/2868)
* IntuneDeviceEnrollmentPlatformRestriction
* [BREAKING CHANGE] Updated resource to manage single and default platform restriction policies
FIXES [#2347](https://github.com/microsoft/Microsoft365DSC/issues/2347)
* IntuneDeviceEnrollmentStatusPageWindows10
* [BREAKING CHANGE] Renamed resource IntuneDeviceEnrollmentConfigurationWindows10 to IntuneDeviceEnrollmentStatusPageWindows10
* Added support for property Assignments.
* Added support for property Priority
FIXES [#2933](https://github.com/microsoft/Microsoft365DSC/issues/2933)
* IntuneWifiConfigurationPolicyAndroidEnterpriseDeviceOwner
* [BREAKING CHANGE] Setting Id as Key parameter and DisplayName as Required
* [BREAKING CHANGE] Corrected typo in resource name (Entreprise to Enterprise)
Expand Down
69 changes: 38 additions & 31 deletions Modules/Microsoft365DSC/DSCResources/MSFT_AADUser/MSFT_AADUser.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -462,51 +462,58 @@ function Set-TargetResource
}
#endregion

if ($null -ne $Password)
if ($null -ne $user.UserPrincipalName)
{
$passwordValue = $Password.GetNetworkCredential().Password
Write-Verbose -Message "Updating Office 365 User $UserPrincipalName Information"

if ($null -ne $Password)
{
Write-Verbose -Message "PasswordProfile property will not be updated"
}

$CreationParams.Add('UserId', $UserPrincipalName)
Update-MgUser @CreationParams
}
else
{
try

if ($null -ne $Password)
{
# This only works in PowerShell 5.1
$passwordValue = [System.Web.Security.Membership]::GeneratePassword(30, 2)
$passwordValue = $Password.GetNetworkCredential().Password
}
catch
else
{
$TokenSet = @{
U = [Char[]]'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
L = [Char[]]'abcdefghijklmnopqrstuvwxyz'
N = [Char[]]'0123456789'
S = [Char[]]'!"#$%&''()*+,-./:;<=>?@[\]^_`{|}~'
if ($PSVersionTable.PSVersion.Major -eq 5)
{
Add-Type -AssemblyName System.Web
$passwordValue = [System.Web.Security.Membership]::GeneratePassword(30, 2)
}
else
{
$TokenSet = @{
U = [Char[]]'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
L = [Char[]]'abcdefghijklmnopqrstuvwxyz'
N = [Char[]]'0123456789'
S = [Char[]]'!"#$%&''()*+,-./:;<=>?@[\]^_`{|}~'
}

$Upper = Get-Random -Count 5 -InputObject $TokenSet.U
$Lower = Get-Random -Count 5 -InputObject $TokenSet.L
$Number = Get-Random -Count 5 -InputObject $TokenSet.N
$Special = Get-Random -Count 5 -InputObject $TokenSet.S
$Upper = Get-Random -Count 8 -InputObject $TokenSet.U
$Lower = Get-Random -Count 8 -InputObject $TokenSet.L
$Number = Get-Random -Count 8 -InputObject $TokenSet.N
$Special = Get-Random -Count 8 -InputObject $TokenSet.S

$StringSet = $Upper + $Lower + $Number + $Special
$StringSet = $Upper + $Lower + $Number + $Special

$stringPassword = (Get-Random -Count 15 -InputObject $StringSet) -join ''
$passwordValue = ConvertTo-SecureString $stringPassword -AsPlainText -Force
$stringPassword = (Get-Random -Count 30 -InputObject $StringSet) -join ''
$passwordValue = ConvertTo-SecureString $stringPassword -AsPlainText -Force
}
}
}

$PasswordProfile = @{
Password = $passwordValue
}
$CreationParams.Add('PasswordProfile', $PasswordProfile)
$PasswordProfile = @{
Password = $passwordValue
}
$CreationParams.Add('PasswordProfile', $PasswordProfile)

if ($user.UserPrincipalName)
{
Write-Verbose -Message "Updating Office 365 User $UserPrincipalName Information"
$CreationParams.Add('UserId', $UserPrincipalName)
Update-MgUser @CreationParams
}
else
{
Write-Verbose -Message "Creating Office 365 User $UserPrincipalName"
$CreationParams.Add('AccountEnabled', $true)
$CreationParams.Add('MailNickName', $UserPrincipalName.Split('@')[0])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MSFT_AADUser : OMI_BaseResource
[Write, Description("The list of Azure Active Directory roles assigned to the user.")] String Roles[];
[Write, Description("The country code the user will be assigned to")] String UsageLocation;
[Write, Description("The account SKU Id for the license to be assigned to the user")] String LicenseAssignment[];
[Write, Description("The password for the account. The parameter is a PSCredential object, but only the Password component will be used"), EmbeddedInstance("MSFT_Credential")] String Password;
[Write, Description("The password for the account. The parameter is a PSCredential object, but only the Password component will be used. If Password is not supplied for a new resource a new random password will be generated. Property will only be used when creating the user and not on subsequent updates."), EmbeddedInstance("MSFT_Credential")] String Password;
[Write, Description("The City name of the user")] String City;
[Write, Description("The Country name of the user")] String Country;
[Write, Description("The Department name of the user")] String Department;
Expand Down
Loading

0 comments on commit d243657

Please sign in to comment.