powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[BUG] Add-PnPGroupMember for adding EntraID Group using Managed Identity in Azure Runbook doesn't work

Open PowerRanger83 opened this issue 1 year ago • 0 comments

Reporting an Issue or Missing Feature

I am running the following script in my Azure Automation Account runbook: Powershell 7.2 PnP 2.3.0

Connect-PnPOnline -ManagedIdentity -url "https://tenant.sharepoint.com/sites/MySiteCollection" $GroupName = Get-PnPGroup -AssociatedMemberGroup

Add-PnPGroupMember -LoginName "[email protected]" -Group $GroupName Add-PnPGroupMember -LoginName "c:0t.c|tenant|f559ca209-88d4-4b0a-9c21-0b9c8d453de0" -Group $GroupName

Expected behavior

Add-PnPGroup cmdlet adds the user as well as the EntraID Group to the specified Member Group

Actual behavior

The user gets added but for the EntraID Grouo I get an Error

The specified user c:0t.c|tenant|f559ca209-88d4-4b0a-9c21-0b9c8d453de0 could not be found.

I can verify that that the Groups Object ID exists!

Steps to reproduce behavior

Running the script abvove

What is the version of the Cmdlet module you are running?

2.3.0

Which operating system/environment are you running PnP PowerShell on?

  • [ ] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ x] Other : Azure Automation runbook runtime version 7.2

PowerRanger83 avatar Feb 23 '24 21:02 PowerRanger83