Skip to content

Commit

Permalink
Merge pull request #5642 from NikCharlebois/AADDeviceRegistrationPolicy
Browse files Browse the repository at this point in the history
Fixes issues when trying to disable AAD join
  • Loading branch information
NikCharlebois authored Jan 16, 2025
2 parents 90942ce + f813308 commit 129fc89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

# UNRELEASED

* AADDeviceRegistrationPolicy
* Fixes an error when trying to disable AAD join.
* FabricAdminTenantSettings
* Added support for the AllowGetOneLakeUDK, AllowMountDfCreation, AllowOneLakeUDK,
ArtifactOrgAppPreview properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,23 +352,23 @@ function Set-TargetResource
}

$azureADRegistrationAllowedToRegister = '#microsoft.graph.noDeviceRegistrationMembership'
if ($AzureAdJoinLocalAdminsRegisteringMode -eq 'All')
if ($AzureADAllowedToJoin -eq 'All')
{
$azureADRegistrationAllowedToRegister = '#microsoft.graph.allDeviceRegistrationMembership'
}
elseif ($AzureAdJoinLocalAdminsRegisteringMode -eq 'Selected')
elseif ($AzureADAllowedToJoin -eq 'Selected')
{
$azureADRegistrationAllowedToRegister = '#microsoft.graph.enumeratedDeviceRegistrationMembership'

$azureADRegistrationAllowedUsers = @()
foreach ($user in $AzureAdJoinLocalAdminsRegisteringUsers)
foreach ($user in $AzureADAllowedToJoinUsers)
{
$userInfo = Get-MgUser -UserId $user
$azureADRegistrationAllowedUsers += $userInfo.Id
}

$azureADRegistrationAllowedGroups = @()
foreach ($group in $AzureAdJoinLocalAdminsRegisteringGroups)
foreach ($group in $AzureADAllowedToJoinGroups)
{
$groupInfo = Get-MgGroup -Filter "DisplayName eq '$group'"
$azureADRegistrationAllowedGroups += $groupInfo.Id
Expand Down

0 comments on commit 129fc89

Please sign in to comment.