SharePoint/PnP-PowerShell has provide a great efforts to minimize code and increase productivity in SharePoint Online Development.
Recently we have to remove bulk amount of user from SharePoint Group. We decided to go with pnp power shell script to do it. As per the document Link – Remove User From Group below is the code.
Remove-PnPUserFromGroup -LoginName <String> -Identity <GroupPipeBind> [-Web <WebPipeBind>] i.e.
PS:> Remove-PnPUserFromGroup -LoginName email@example.com -GroupName 'Marketing Site Members' But above code didn't work. Actually we have to provide the -LoginName string like "i:firstname.lastname@example.org" and its work.Below is the working script. Remove-PnPUserFromGroup -LoginName "i:email@example.com" -GroupName 'Document'