You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write-Verbose-Message "Could not find matching AppRole entry in Desired values for {$($currentRole.DisplayName)}. Will remove role."
973
+
$fixedRole=$currentRole
974
+
$fixedRole.IsEnabled=$false
975
+
$fixedRoles+=$fixedRole
976
+
$rolesToRemove+=$currentRole.DisplayName
977
+
}
978
+
else
979
+
{
980
+
Write-Verbose-Message "Found matching AppRole entry in Desired values for {$($currentRole.DisplayName)}. Keeping same value as current, but setting to disable."
@@ -1039,6 +1152,10 @@ function Set-TargetResource
1039
1152
{
1040
1153
$roleId=$role.Id
1041
1154
}
1155
+
if ([System.String]::IsNullOrEmpty($roleId))
1156
+
{
1157
+
throw"Could not find associated role {$($permission.Name)} for API {$($sourceAPI)}"
1158
+
}
1042
1159
$appPermission=@{
1043
1160
Id=$roleId
1044
1161
Type='Role'
@@ -1054,6 +1171,7 @@ function Set-TargetResource
1054
1171
}
1055
1172
1056
1173
Write-Verbose-Message "Updating permissions for Azure AD Application {$($currentAADApp.DisplayName)} with RequiredResourceAccess:`r`n$($allRequiredAccess|Out-String)"
Copy file name to clipboardExpand all lines: Modules/Microsoft365DSC/DSCResources/MSFT_AADApplication/MSFT_AADApplication.schema.mof
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -82,10 +82,26 @@ class MSFT_MicrosoftGraphPreAuthorizedApplication
82
82
[Write, Description("The unique identifier for the scopes the client application is granted.")] String PermissionIds[];
83
83
};
84
84
85
+
[ClassVersion("1.0.0")]
86
+
class MSFT_MicrosoftGraphApiOauth2PermissionScopes
87
+
{
88
+
[Write, Description("A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences.")] String adminConsentDescription;
89
+
[Write, Description("The permission's title, intended to be read by an administrator granting the permission on behalf of all users.")] String adminConsentDisplayName;
90
+
[Write, Description("A description of the delegated permissions, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves.")] String userConsentDescription;
91
+
[Write, Description("A title for the permission, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves.")] String userConsentDisplayName;
92
+
[Write, Description("Specifies the value to include in the scp (scope) claim in access tokens. Must not exceed 120 characters in length.")] String value;
93
+
[Write, Description("When you create or update a permission, this property must be set to true (which is the default). To delete a permission, this property must first be set to false. At that point, in a subsequent call, the permission may be removed.")] Boolean isEnabled;
94
+
[Write, Description("The possible values are: User and Admin. Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf of themselves, or whether an administrator consent should always be required.")] String type;
95
+
[Write, Description("Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application.")] String id;
96
+
97
+
};
98
+
85
99
[ClassVersion("1.0.0")]
86
100
class MSFT_MicrosoftGraphApiApplication
87
101
{
88
102
[Write, Description("Lists the client applications that are preauthorized with the specified delegated permissions to access this application's APIs. Users aren't required to consent to any preauthorized application (for the permissions specified). However, any other permissions not listed in preAuthorizedApplications (requested through incremental consent for example) will require user consent."), EmbeddedInstance("MSFT_MicrosoftGraphPreAuthorizedApplication")] String PreAuthorizedApplications[];
103
+
[Write, Description("List of associated API scopes."), EmbeddedInstance("MSFT_MicrosoftGraphAPIOauth2PermissionScopes")] String Oauth2PermissionScopes[];
Copy file name to clipboardExpand all lines: Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleAssignmentScheduleRequest/MSFT_AADRoleAssignmentScheduleRequest.psm1
+17-3Lines changed: 17 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -148,10 +148,24 @@ function Get-TargetResource
148
148
[Array] $requests=Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest-Filter "PrincipalId eq '$($PrincipalInstance.Id)' and RoleDefinitionId eq '$($RoleDefinitionId)' and DirectoryScopeId eq '$($DirectoryScopeId)'"
149
149
if ($requests.Length-eq0)
150
150
{
151
-
return$nullResult
151
+
Write-Verbose-Message "Trying to retrieve by reverse RoleId retrieval"
152
+
$partialRequests=Get-MgBetaRoleManagementDirectoryRoleAssignmentScheduleRequest-Filter "PrincipalId eq '$($PrincipalInstance.Id)' and DirectoryScopeId eq '$($DirectoryScopeId)'"
Copy file name to clipboardExpand all lines: Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.psm1
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -138,7 +138,7 @@
138
138
$PrincipalValue=$PrincipalInstance.DisplayName
139
139
}
140
140
141
-
Write-Verbose-Message 'Found Principal'
141
+
Write-Verbose-Message "Found Principal {$PrincipalValue}"
Copy file name to clipboardExpand all lines: Modules/Microsoft365DSC/DSCResources/MSFT_EXOManagementRoleAssignment/MSFT_EXOManagementRoleAssignment.psm1
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -387,7 +387,7 @@ function Set-TargetResource
387
387
Write-Verbose-Message 'Waiting for 20 seconds for new permissions to be effective.'
388
388
Start-Sleep20
389
389
Write-Verbose-Message 'Disconnecting from Exchange Online'
0 commit comments