Replies: 1 comment 2 replies
-
First a tip If you paste in results, simple start the with a line with three back ticks (```), then paste your results and end with 3 back ticks on a new line.
If you write the first line as ```powershell then it will actually use color coding: Connect-PnPOnline -Url https://contoso.sharepoint.com
Get-PnPList Now to your issue, the only reason I can come with up that causes this error is that the user actually doesn't exist within your tenant? If you want to invite an external user you will have to provide at least the email address (and not the LoginName). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings,
When I try to add a user to a SharePoint group using the title, I get the following:
PS C:\Users\REDACTED\OneDrive - REDACTED\Documents\scripts\PowerShell> Get-PnPGroup
Id Title LoginName
-- ----- ---------
5 REDACTED - Membres REDACTED - Membres
4 REDACTED - Visiteurs REDACTED - Visiteurs
3 Propriétaires de REDACTED Propriétaires de REDACTED
PS C:\Users\REDACTED\OneDrive - REDACTED\Documents\scripts\PowerShell> Add-PnPGroupMember -LoginName "[email protected]" -Group "Propriétaires de REDACTED"
Add-PnPGroupMember : La référence d'objet n'est pas définie à une instance d'un objet.
Au caractère Ligne:1 : 1
+ Add-PnPGroupMember -LoginName "[email protected]" -Group "Propr ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Add-PnPGroupMember], NullReferenceException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Principals.AddUserToGroup
Although, the ID works fine, am I doing something incorrectly?
Please note that the error message in English would be: "Object reference not set to an instance of an object."
May someone help me out with this issue please?
Thank you for your time and help, it is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions