We require an PowerShell script to find which Resource Group is not having IAM Role Assigned.
Please find below the PowerShell scripts for your reference, and let me know the PowerShell script for to finding which Resource Group is not having IAM Role Assigned.
Inviting Multiple Uers.
Install-Module AzureADPreview Connect-AzureAD -TenantId $invitations = import-csv C:\Users\dummy\Desktop\users.csv $messageInfo = New-Object Microsoft.Open.MSGraph.Model.InvitedUserMessageInfo $messageInfo.customizedMessageBody = "Hello. You are invited to the xyz.onmicrosoft.com." foreach ($email in $invitations)
{New-AzureADMSInvitation-InvitedUserEmailAddress $email.InvitedUserEmailAddress
-InvitedUserDisplayName $email.Name-InviteRedirectUrl https://myapps.microsoft.com
-InvitedUserMessageInfo $messageInfo ` -SendInvitationMessage $true }
Creating multiple resource groups.
Connect-AzureRmAccount -Tenant -Subscription import-csv C:\Users\dummy\Desktop\excel02.csv | ForEach-Object {New-AzureRmResourceGroup -Name $_.Name -Location centralIndia
Assigning iam role in bulk
Connect-AzureRmAccount -Tenant -Subscription import-csv C:\Users\dummy\Desktop\excel05.csv | ForEach-Object {New-AzureRMRoleAssignment -SignInName $.Users -RoleDefinitionName "Owner" -ResourceGroupName $.RG}
Getting Role Assignment in bulk.
Connect-AzureRmAccount -Tenant -Subscription #Get-AzureRmRoleAssignment -ResourceGroupName MridulAggarwal -SignInName [email protected] import-csv C:\Users\nawabjanm\Desktop\excel05.csv | ForEach-Object {Get-AzureRmRoleAssignment -ResourceGroupName $.RG -SignInName $.Users} | FL > D:\r20.csv