Unable to get groups with POSH

%3CLINGO-SUB%20id%3D%22lingo-sub-47531%22%20slang%3D%22en-US%22%3EUnable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47531%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20getting%20the%20following%20error.%20Can%20someone%20please%20tell%20me%20what%20I'm%20doing%20wrong%3F%20I'm%20a%20Global%20admin%20in%20the%20tenant.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-PnPMicrosoftGraph%20-Scopes%20%22Group.ReadWrite.All%22%2C%22User.Read.All%22%3C%2FP%3E%3CP%3EPS%20C%3A%5CScripts%26gt%3B%20Get-PnPUnifiedGroup%3CBR%20%2F%3EGet-PnPUnifiedGroup%20%3A%20Exception%20of%20type%20'Microsoft.Graph.ServiceException'%20was%20thrown.%3CBR%20%2F%3EAt%20line%3A1%20char%3A1%3CBR%20%2F%3E%2B%20Get-PnPUnifiedGroup%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20CategoryInfo%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20NotSpecified%3A%20(%3A)%20%5BGet-PnPUnifiedGroup%5D%2C%20ServiceException%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.Graph.ServiceException%2CSharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-47531%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EGroups%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-106385%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-106385%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20created%20an%20App%20registration%20via%3A%20%3CA%20href%3D%22https%3A%2F%2Fapps.dev.microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fapps.dev.microsoft.com%3C%2FA%3E%20(still%20trying%20to%20determine%20how%2Fwhy%20this%20is%20different%20than%20creating%20a%20registration%20directly%20in%20AzureAD)%2C%20and%20granted%20ALL%20of%20the%20Group%20and%20User%20related%20permissions%20to%20Graph%20(not%20just%20the%20ones%20specified%20above).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20I'm%20seeing%20some%20interesting%20(and%20inconsistent)%20behavior%20in%20using%20the%20Get-PnPUnifiedGroup%20command.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EScenario%201%3A%20When%20I%20connect%20without%20using%20the%20app%20registration%20I%20created%2C%20using%20%3CEM%3EConnect-PnPMicrosoftGraph%20-Scopes%20%22Group.ReadWrite.All%22%2C%3C%2FEM%3E%20then%20authenticating%20using%20an%20O365%20account%20with%20a%20Global%20Admin%20role.%3C%2FP%3E%3CP%3EWhen%20I%20run%20%3CEM%3EGet-PnPUnifiedGroup%3C%2FEM%3E%20without%20parameters%2C%20I%20get%20the%20exception%20identified%20in%20this%20thread.%26nbsp%3B%20However%2C%20if%20I%20attempt%20to%20specify%20a%20group%2C%20it%20does%20return%20a%20value%2C%20but%20for%20some%20reason%2C%20is%20not%20able%20to%20show%20the%20value%20for%20the%20Site%20URL.%26nbsp%3B%20If%20Site%20URL%20is%20a%20property%20of%20the%20group%20object%2C%20I%20can't%20understand%20how%20I%20would%20possibly%20get%20an%20access%20denied%20message%3A%3C%2FP%3E%3CP%3EDisplayName%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Group%20Id%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Site%20URL%3C%2FP%3E%3CP%3E-----------%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20--------%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20--------%3C%2FP%3E%3CP%3EThe%20A%20Team%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%2061987e15-6b1f-4e4a-8d19-b762c3b5a149%26nbsp%3B%26nbsp%3B%20Access%20denied.%20You%20do%20not%20have%20perm...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EScenario%202%3A%20When%20I%20connect%20(successfully...I%20can%20confirm%20by%20running%20%3CEM%3EGet-PnPAccessToken%3C%2FEM%3E)%20using%20the%20app%20registration%20I%20created%20and%20I%20attempt%20to%20run%20the%20Get-%3CEM%3EPnPUnifiedGroup%3C%2FEM%3E%20command%20with%20or%20without%20paramenters%2C%20I%20get%20the%20exception%20in%20both%20scenarios.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHas%20anyone%20else%20experienced%20this%20behavior%20and%2For%20have%20any%20thoughts%20on%20a%20solution%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-100616%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-100616%22%20slang%3D%22en-US%22%3E%3CP%3EI%20fixed%20my%20issue.%20%26nbsp%3BTurns%20out%20my%20app%20needed%20more%20permissions%20than%20the%20documentation%20let%20on.%20%26nbsp%3BI%20needed%20these%20permissions%3C%2FP%3E%3CP%3EDelegated%20Permissions%3C%2FP%3E%3CUL%3E%3CLI%3ESites.Read.All%3C%2FLI%3E%3CLI%3EUser.Read%3C%2FLI%3E%3CLI%3EDirectory.Read.all%3C%2FLI%3E%3CLI%3EGroup.Read.All%3C%2FLI%3E%3CLI%3EGroup.ReadWrite.All%3C%2FLI%3E%3CLI%3EUser.Read.All%3C%2FLI%3E%3C%2FUL%3E%3CP%3EApplication%20Permissions%3C%2FP%3E%3CUL%3E%3CLI%3EDirectory.Read.All%3C%2FLI%3E%3CLI%3EGroup.ReadWrite.All%3C%2FLI%3E%3CLI%3EUser.Read.All%3C%2FLI%3E%3C%2FUL%3E%3CP%3EI'm%20not%20100%25%20I%20need%20the%20Sites.Read.All%2C%20though.%20I%20haven't%20gone%20back%20to%20test%20that.%20I'm%20just%20happy%20to%20finally%20have%20it%20working.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-100130%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-100130%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20getting%20the%20same%20error%20and%20stacktrace%20is%20similar.%20%26nbsp%3BHas%20anyone%20figured%20this%20one%20out%20yet%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGet-PnPUnifiedGroup%20%3A%20Exception%20of%20type%20'Microsoft.Graph.ServiceException'%20was%20thrown.%3CBR%20%2F%3EAt%20C%3A%5CUsers%5Crvanandel%5CSharePoint%5CSharePoint%20Migration%20Project%20-%20Docu%5CEngagement%20Sites%5Ccreate-engagement.ps1%3A38%20char%3A14%3CBR%20%2F%3E%2B%20%24group%20%3D%20Get-PnPUnifiedGroup%20-Identity%20%24groupName%20-Verbose%3B%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BGet-PnPUnifiedGroup%5D%2C%20ServiceException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.Graph.ServiceException%2CSharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup%3CBR%20%2F%3E%3CBR%20%2F%3Eat%20Microsoft.Graph.HttpProvider.%3CSENDASYNC%3Ed__19.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3Eat%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%3CBR%20%2F%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3Eat%20Microsoft.Graph.BaseRequest.%3CSENDREQUESTASYNC%3Ed__34.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3Eat%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%3CBR%20%2F%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3Eat%20Microsoft.Graph.BaseRequest.%3CSENDASYNC%3Ed__32%601.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3Eat%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%3CBR%20%2F%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3Eat%20Microsoft.Graph.GraphServiceGroupsCollectionRequest.%3CGETASYNC%3Ed__4.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3Eat%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%3CBR%20%2F%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3Eat%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.%26lt%3B%26gt%3Bc__DisplayClass12_0.%26lt%3B%3CLISTUNIFIEDGROUPS%3Eb__0%26gt%3Bd.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3Eat%20System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()%3CBR%20%2F%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3Eat%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.ListUnifiedGroups(String%20accessToken%2C%20String%20displayName%2C%20String%20mailNickname%2C%20Int32%20startIndex%2C%20Int32%20end%3CBR%20%2F%3EIndex%2C%20Boolean%20includeSite%2C%20Int32%20retryCount%2C%20Int32%20delay)%3CBR%20%2F%3Eat%20SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup.ExecuteCmdlet()%3CBR%20%2F%3Eat%20System.Management.Automation.CommandProcessor.ProcessRecord()%3C%2FLISTUNIFIEDGROUPS%3E%3C%2FGETASYNC%3E%3C%2FSENDASYNC%3E%3C%2FSENDREQUESTASYNC%3E%3C%2FSENDASYNC%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-57254%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-57254%22%20slang%3D%22en-US%22%3E%3CP%3EAnd%20this%20is%20the%20output%20for%20the%20stack%20trace%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23f5f5f5%22%20face%3D%22Lucida%20Console%22%20size%3D%221%22%3EPS%20C%3A%5CGitHub%5CACEA%5CPowerShell%5CScripts%26gt%3B%20%24error%5B0%5D.Exception.StackTrace%3C%2FFONT%3E%3C%2FP%3E%3CP%3Eat%20Microsoft.Graph.HttpProvider.%3CSENDASYNC%3Ed__19.MoveNext()%3C%2FSENDASYNC%3E%3C%2FP%3E%3CP%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3C%2FP%3E%3CP%3Eat%20Microsoft.Graph.BaseRequest.%3CSENDREQUESTASYNC%3Ed__34.MoveNext()%3C%2FSENDREQUESTASYNC%3E%3C%2FP%3E%3CP%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3C%2FP%3E%3CP%3Eat%20Microsoft.Graph.BaseRequest.%3CSENDASYNC%3Ed__32%601.MoveNext()%3C%2FSENDASYNC%3E%3C%2FP%3E%3CP%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3C%2FP%3E%3CP%3Eat%20Microsoft.Graph.DriveRequest.%3CGETASYNC%3Ed__6.MoveNext()%3C%2FGETASYNC%3E%3C%2FP%3E%3CP%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3C%2FP%3E%3CP%3Eat%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.%26lt%3B%26gt%3Bc__DisplayClass3_0.%26lt%3B%3CGETUNIFIEDGROUPSITEURL%3Eb__0%26gt%3Bd.MoveNext()%3C%2FGETUNIFIEDGROUPSITEURL%3E%3C%2FP%3E%3CP%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3C%2FP%3E%3CP%3Eat%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.GetUnifiedGroupSiteUrl(String%20groupId%2C%20String%20accessToken%2C%20Int32%20re%3C%2FP%3E%3CP%3EtryCount%2C%20Int32%20delay)%3C%2FP%3E%3CP%3Eat%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.%26lt%3B%26gt%3Bc__DisplayClass10_0.%26lt%3B%3CLISTUNIFIEDGROUPS%3Eb__0%26gt%3Bd.MoveNext()%3C%2FLISTUNIFIEDGROUPS%3E%3C%2FP%3E%3CP%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3C%2FP%3E%3CP%3Eat%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3C%2FP%3E%3CP%3Eat%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.ListUnifiedGroups(String%20accessToken%2C%20String%20displayName%2C%20String%20ma%3C%2FP%3E%3CP%3EilNickname%2C%20Int32%20startIndex%2C%20Int32%20endIndex%2C%20Boolean%20includeSite%2C%20Int32%20retryCount%2C%20Int32%20delay)%3C%2FP%3E%3CP%3Eat%20SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup.ExecuteCmdlet()%3C%2FP%3E%3CP%3Eat%20System.Management.Automation.CommandProcessor.ProcessRecord()%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-57253%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-57253%22%20slang%3D%22en-US%22%3E%3CP%3EDear%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20the%20same%20issue%20and%20desperately%20looking%20for%20a%20solution...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F12444i5C25E0DBE2AD70C1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222017-03-28%2011_55_44-Administrator_%20Windows%20PowerShell%20ISE.png%22%20title%3D%222017-03-28%2011_55_44-Administrator_%20Windows%20PowerShell%20ISE.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI%20still%20can%20use%20the%20MS%20cmdlet%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F12446iA63A9A9AC0DDA4EE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222017-03-28%2011_57_05-Administrator_%20Windows%20PowerShell%20ISE.png%22%20title%3D%222017-03-28%2011_57_05-Administrator_%20Windows%20PowerShell%20ISE.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHelp%20please%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-48774%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-48774%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F122%22%20target%3D%22_blank%22%3E%40Erwin%20van%20Hunen%3C%2FA%3E%26nbsp%3Bthanks%20for%20the%20suggestion.%20This%20is%20what%20I%20get.%20I%20don't%20understand%20what%20this%20means%2C%20does%20it%20provide%20you%20any%20clues%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPS%20C%3A%5C%26gt%3B%20%24error%5B0%5D.Exception.StackTrace%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20Microsoft.Graph.HttpProvider.%3CSENDASYNC%3Ed__19.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20Microsoft.Graph.BaseRequest.%3CSENDREQUESTASYNC%3Ed__34.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20Microsoft.Graph.BaseRequest.%3CSENDASYNC%3Ed__32%601.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20Microsoft.Graph.DriveRequest.%3CGETASYNC%3Ed__6.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.%26lt%3B%26gt%3Bc__DisplayClass3_0.%26lt%3B%3CGETUNIFIEDGROUPSITEURL%3Eb__0%26gt%3Bd.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.GetUnifiedGroupSiteUrl(String%20groupId%2C%20String%20accessToken%2C%20Int32%20retryCount%2C%20Int32%20delay)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.%26lt%3B%26gt%3Bc__DisplayClass10_0.%26lt%3B%3CLISTUNIFIEDGROUPS%3Eb__0%26gt%3Bd.MoveNext()%3CBR%20%2F%3E---%20End%20of%20stack%20trace%20from%20previous%20location%20where%20exception%20was%20thrown%20---%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task%20task)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.ListUnifiedGroups(String%20accessToken%2C%20String%20displayName%2C%20String%20mailNickname%2C%20Int32%20startIndex%2C%20Int32%20endIndex%2C%20Boole%3CBR%20%2F%3Ean%20includeSite%2C%20Int32%20retryCount%2C%20Int32%20delay)%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup.ExecuteCmdlet()%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%20at%20System.Management.Automation.CommandProcessor.ProcessRecord()%3C%2FLISTUNIFIEDGROUPS%3E%3C%2FGETUNIFIEDGROUPSITEURL%3E%3C%2FGETASYNC%3E%3C%2FSENDASYNC%3E%3C%2FSENDREQUESTASYNC%3E%3C%2FSENDASYNC%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-47882%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47882%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Dean%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20just%20tried%20here%20but%20I%20get%20no%20errors.%20If%20you%20execute%20the%20cmdlet%20as%20said%2C%20and%20if%20you%26nbsp%3Bstill%20receive%20the%20error%2C%20can%20you%20enter%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%24error%5B0%5D.Exception.StackTrace%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eand%20post%20that%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-47756%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47756%22%20slang%3D%22en-US%22%3E%3CP%3Eok%2C%20thanks%2C%20I%20just%20tried%20again%20and%20got%20the%20same%20error.%3CBR%20%2F%3E%3CBR%20%2F%3EBTW%2C%20PNP%20PowerShell%20is%20fantastic.%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F122%22%20target%3D%22_blank%22%3E%40Erwin%20van%20Hunen%3C%2FA%3E%26nbsp%3Bhas%20done%20an%20amazing%20job%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-47755%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47755%22%20slang%3D%22en-US%22%3EFor%20what%20it%20is%20worth%2C%20I%20literally%20just%20installed%20PNP%20PowerShell%20yesterday%20to%20start%20playing%20with%20it%2C%20copied%20and%20pasted%20your%20code%20and%20it%20ran%20just%20fine.%20So%20the%20syntax%20is%20at%20least%20right.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-47751%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47751%22%20slang%3D%22en-US%22%3E%3CP%3Eadding%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5720%22%20target%3D%22_blank%22%3E%40Vesa%20Juvonen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-47740%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47740%22%20slang%3D%22en-US%22%3Eyes%2C%20that%20works%20correctly.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-47562%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-47562%22%20slang%3D%22en-US%22%3EDoes%20the%20std%20Get-UnifiedGroup%20powershell%20cmdlets%20work%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1200703%22%20slang%3D%22en-US%22%3ERe%3A%20Unable%20to%20get%20groups%20with%20POSH%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1200703%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F77942%22%20target%3D%22_blank%22%3E%40Rory%20Collins%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20using%20a%20script%20to%20check%20Unified%20groups%2C%20Last%20week%20it%20worked%2C%20but%20as%20of%20today%20we%20get%20the%20error%3A%3C%2FP%3E%3CP%3E%22The%20service%20is%20not%20available.%20Try%20the%20request%20again%20after%20a%20delay.%20There%20may%20be%20a%20Retry-After%20header.%22%3C%2FP%3E%3CP%3Efor%20SiteUrl.%26nbsp%3B%3C%2FP%3E%3CP%3EAnyone%20an%20idea%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Respected Contributor

I am getting the following error. Can someone please tell me what I'm doing wrong? I'm a Global admin in the tenant.

 

Connect-PnPMicrosoftGraph -Scopes "Group.ReadWrite.All","User.Read.All"

PS C:\Scripts> Get-PnPUnifiedGroup
Get-PnPUnifiedGroup : Exception of type 'Microsoft.Graph.ServiceException' was thrown.
At line:1 char:1
+ Get-PnPUnifiedGroup
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-PnPUnifiedGroup], ServiceException
    + FullyQualifiedErrorId : Microsoft.Graph.ServiceException,SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup

13 Replies
Does the std Get-UnifiedGroup powershell cmdlets work?
yes, that works correctly.

adding @Vesa Juvonen 

For what it is worth, I literally just installed PNP PowerShell yesterday to start playing with it, copied and pasted your code and it ran just fine. So the syntax is at least right.

ok, thanks, I just tried again and got the same error.

BTW, PNP PowerShell is fantastic. @Erwin van Hunen has done an amazing job

Hi Dean,

 

I just tried here but I get no errors. If you execute the cmdlet as said, and if you still receive the error, can you enter 

 

$error[0].Exception.StackTrace

 

and post that?

@Erwin van Hunen thanks for the suggestion. This is what I get. I don't understand what this means, does it provide you any clues?

 

PS C:\> $error[0].Exception.StackTrace
   at Microsoft.Graph.HttpProvider.<SendAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Graph.BaseRequest.<SendAsync>d__32`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Graph.DriveRequest.<GetAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<>c__DisplayClass3_0.<<GetUnifiedGroupSiteUrl>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.GetUnifiedGroupSiteUrl(String groupId, String accessToken, Int32 retryCount, Int32 delay)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<>c__DisplayClass10_0.<<ListUnifiedGroups>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.ListUnifiedGroups(String accessToken, String displayName, String mailNickname, Int32 startIndex, Int32 endIndex, Boole
an includeSite, Int32 retryCount, Int32 delay)
   at SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup.ExecuteCmdlet()
   at System.Management.Automation.CommandProcessor.ProcessRecord()

Dear all,

 

I have the same issue and desperately looking for a solution...

 

2017-03-28 11_55_44-Administrator_ Windows PowerShell ISE.png

I still can use the MS cmdlet

2017-03-28 11_57_05-Administrator_ Windows PowerShell ISE.png

Help please?

And this is the output for the stack trace

 

PS C:\GitHub\ACEA\PowerShell\Scripts> $error[0].Exception.StackTrace

at Microsoft.Graph.HttpProvider.<SendAsync>d__19.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__34.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.Graph.BaseRequest.<SendAsync>d__32`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at Microsoft.Graph.DriveRequest.<GetAsync>d__6.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<>c__DisplayClass3_0.<<GetUnifiedGroupSiteUrl>b__0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.GetUnifiedGroupSiteUrl(String groupId, String accessToken, Int32 re

tryCount, Int32 delay)

at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<>c__DisplayClass10_0.<<ListUnifiedGroups>b__0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.ListUnifiedGroups(String accessToken, String displayName, String ma

ilNickname, Int32 startIndex, Int32 endIndex, Boolean includeSite, Int32 retryCount, Int32 delay)

at SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup.ExecuteCmdlet()

at System.Management.Automation.CommandProcessor.ProcessRecord()

 

I am getting the same error and stacktrace is similar.  Has anyone figured this one out yet?

 

Get-PnPUnifiedGroup : Exception of type 'Microsoft.Graph.ServiceException' was thrown.
At C:\Users\rvanandel\SharePoint\SharePoint Migration Project - Docu\Engagement Sites\create-engagement.ps1:38 char:14
+ $group = Get-PnPUnifiedGroup -Identity $groupName -Verbose;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-PnPUnifiedGroup], ServiceException
+ FullyQualifiedErrorId : Microsoft.Graph.ServiceException,SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup

at Microsoft.Graph.HttpProvider.<SendAsync>d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.<SendAsync>d__32`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.GraphServiceGroupsCollectionRequest.<GetAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<>c__DisplayClass12_0.<<ListUnifiedGroups>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.ListUnifiedGroups(String accessToken, String displayName, String mailNickname, Int32 startIndex, Int32 end
Index, Boolean includeSite, Int32 retryCount, Int32 delay)
at SharePointPnP.PowerShell.Commands.Graph.GetUnifiedGroup.ExecuteCmdlet()
at System.Management.Automation.CommandProcessor.ProcessRecord()

 

I fixed my issue.  Turns out my app needed more permissions than the documentation let on.  I needed these permissions

Delegated Permissions

  • Sites.Read.All
  • User.Read
  • Directory.Read.all
  • Group.Read.All
  • Group.ReadWrite.All
  • User.Read.All

Application Permissions

  • Directory.Read.All
  • Group.ReadWrite.All
  • User.Read.All

I'm not 100% I need the Sites.Read.All, though. I haven't gone back to test that. I'm just happy to finally have it working.

 

 

I've created an App registration via: https://apps.dev.microsoft.com (still trying to determine how/why this is different than creating a registration directly in AzureAD), and granted ALL of the Group and User related permissions to Graph (not just the ones specified above).

 

However, I'm seeing some interesting (and inconsistent) behavior in using the Get-PnPUnifiedGroup command.

 

Scenario 1: When I connect without using the app registration I created, using Connect-PnPMicrosoftGraph -Scopes "Group.ReadWrite.All", then authenticating using an O365 account with a Global Admin role.

When I run Get-PnPUnifiedGroup without parameters, I get the exception identified in this thread.  However, if I attempt to specify a group, it does return a value, but for some reason, is not able to show the value for the Site URL.  If Site URL is a property of the group object, I can't understand how I would possibly get an access denied message:

DisplayName                   Group Id                               Site URL

-----------                   --------                               --------

The A Team                     61987e15-6b1f-4e4a-8d19-b762c3b5a149   Access denied. You do not have perm...

 

Scenario 2: When I connect (successfully...I can confirm by running Get-PnPAccessToken) using the app registration I created and I attempt to run the Get-PnPUnifiedGroup command with or without paramenters, I get the exception in both scenarios.

 

Has anyone else experienced this behavior and/or have any thoughts on a solution?

@Rory Collins 

We are using a script to check Unified groups, Last week it worked, but as of today we get the error:

"The service is not available. Try the request again after a delay. There may be a Retry-After header."

for SiteUrl. 

Anyone an idea?