Based on your description, I understand that you want to grant permission for a group in some site collections. You could achieve through following PowerShell.
Note: The account to be used in the PowerShell should be the administrator of these site collections.
1.Create a csv file as following picture shows.
2.Please run below PowerShell.
$Credentials=Get-Credential
$DomainGroup = "DomainGroup1@domain.com"
$PermissionLevel = "Contribute"
$filePath = “the local path of csv file, such as C:\sites.csv”
$csv = Import-Csv $filePath
$a = $csv.Url
ForEach($_ in $a) {
Connect-pnponline $_ -Credential $Credentials
Set-PnPWebPermission -User $DomainGroup -AddRole $PermissionLevel -Identity "/"
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
@Helena van Eek
I am looking forward to your feedback if there is any update.
Please remember to update this thread if you have any progress.
Thank you for your understanding.