Reporting an Issue
when executing the command below on certain Team objects the error message above is returned. The command is used to change an owner to a member (there is more than 1 owner on this object). Only certain teams for this user is failing. I haven't been able to find a common factor among the teams that fail with this command.
Update-PnPTeamsUser -Team $TeamID -User $UserUPN -Role 'Member' -force
Expected behavior
The user's membership should be changed to Member.
Actual behavior
It fails with the message below:
Object reference not set to an instance of an object
Steps to reproduce behavior
$UserUPN ='JDoe@mycompany.com'
$TeamID = "xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb"
Update-PnPTeamsUser -Team $TeamID -User $UserUPN -Role 'Member' -force
What is the version of the Cmdlet module you are running?
2.5.0
Which operating system/environment are you running PnP PowerShell on?