I am trying to set list item permissions using powershell. The script below seems to be working fine, but granted permissions Type, in SharePoint GUI, seen as User. The one added using the GUI (or SP Workflow) however, seen as Domain Group.
Could you please check the the script, and help me achieve the permissions to be set as Domain Group?
foreach($item in $lib.Items){
$account = $spWeb.EnsureUser("i:0#.f|membersprovider|claim")
$assignment = New-Object Microsoft.SharePoint.SPRoleAssignment($account)
$assignment.RoleDefinitionBindings.Add($read)
$item.BreakRoleInheritance($true)
$item.RoleAssignments.Add($assignment)
$item.Update()
}