Skip to content
Merged

Sync #6189

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
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,16 @@ function Get-TargetResource
{
Write-Verbose -Message "Retrieving Recipient Permissions by Identity {$Identity}, Trustee {$Trustee} and AccessRights {$AccessRights}"
$recipientPermission = Get-RecipientPermission -Identity $Identity -Trustee $Trustee -AccessRights $AccessRights -ErrorAction Stop
$recipientPermission = $recipientPermission | Where-Object -FilterScript {$_.Identity -eq $Identity}
$recipientPermissionValue = $recipientPermission | Where-Object -FilterScript {$_.Identity -eq $Identity}

if ($null -eq $recipientPermissionValue)
{
$userValue = Get-User -Identity $Identity
$recipientPermissionValue = $recipientPermission | Where-Object -FilterScript {
$_.Identity -eq $userValue.Identity -and $_.Trustee -eq $Trustee -and $_.AccessRights -eq $AccessRights
}
}
$recipientPermission = $recipientPermissionValue
}

if ($null -eq $recipientPermission)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ function Get-TargetResource
$roleGroupMembersValue = @()
foreach ($member in $roleGroupMembers)
{
if (-not [System.String]::IsNullOrEmpty($member.PrimarySmtpAddress))
{
$roleGroupMembersValue += $member.PrimarySmtpAddress
}
elseif (-not [System.String]::IsNullOrEmpty($member.WindowsLiveID))
if (-not [System.String]::IsNullOrEmpty($member.WindowsLiveID))
{
$roleGroupMembersValue += $member.WindowsLiveID
}
elseif (-not [System.String]::IsNullOrEmpty($member.WindowsEmailAddress))
{
$roleGroupMembersValue += $member.WindowsEmailAddress
}
elseif (-not [System.String]::IsNullOrEmpty($member.PrimarySmtpAddress))
{
$roleGroupMembersValue += $member.PrimarySmtpAddress
}
else
{
$roleGroupMembersValue += $member.DisplayName
Expand Down Expand Up @@ -381,7 +381,7 @@ function Test-TargetResource
foreach ($member in $Members)
{
Write-Verbose -Message "The current member {$member} is provided as a group display name."
$group = Get-Group -Identity $member -ErrorAction 'SilentlyContinue'
$group = Get-Group -Filter "DisplayName eq '$member'" -ErrorAction 'SilentlyContinue'

if ($null -ne $group)
{
Expand All @@ -401,6 +401,11 @@ function Test-TargetResource
{
$newMembersValue += $user.UserPrincipalName
}
else
{
# Case where the member is an app.
$newMembersValue += $member
}
}
}
$ValuesToCheck.Members = $newMembersValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function Get-TargetResource
#region resource generator code
if (-not [System.String]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrWhiteSpace($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function Get-TargetResource
#region resource generator code
if (-not [System.String]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ function Get-TargetResource
#region resource generator code
if (-not [System.String]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function Get-TargetResource
#region resource generator code
if (-not [System.String]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function Get-TargetResource
$getValue = $null
if (-not [System.String]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if (-not $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function Get-TargetResource
$getValue = $null
if (-not [System.String]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -Filter "Id eq '$Id'" -All -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1271,7 +1271,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if (-not $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function Get-TargetResource
#region resource generator code
if (-not [string]::IsNullOrEmpty($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

if ($null -eq $getValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function Get-TargetResource

if (-not [string]::IsNullOrWhiteSpace($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Get-TargetResource

if (-not [string]::IsNullOrWhiteSpace($id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Get-TargetResource

if (-not [string]::IsNullOrWhiteSpace($id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrWhiteSpace($id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrWhiteSpace($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrWhiteSpace($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrWhiteSpace($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrWhiteSpace($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ function Get-TargetResource
$getValue = $null
if (-not [string]::IsNullOrWhiteSpace($Id))
{
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -DeviceConfigurationId $Id -ErrorAction SilentlyContinue
$getValue = Get-MgBetaDeviceManagementDeviceConfiguration -All -Filter "Id eq '$Id'" -ErrorAction SilentlyContinue
}

#region resource generator code
Expand Down
Loading