You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get-MgSite and Get-MgSubSite need to return the Permissions property #600
Permissions is a propery in both Get-MgSite and Get-MgSubSite but no data is returned for Permssions. Tried both commands using '-ExpandProperty' and '-Property' and there is still no data in the Permissions Property. I also need Permissions returned for Libraries, Files, and Folders.
I can indeed confirm that the SDK is missing Get-MgSitePermission command that should call /sites/{sitesId}/permissions. We need to update our modules mapping to cover this. This should be available in upcoming versions.
Thanks Peter!
I found some commands to gather permissions but I am betting that they will
be better and faster using Graph. The statements I found for Library
permissions on Stack Exchange don't report just the library
permissions either, they are reporting the Sites permissions. I might have
to manually check the permissions for each of my libraries that report
broken inheritance. At least I have that!
Kathy Blasco
Kathy B (@kathyblasco), as a workaround, you could use Invoke-MgGraphRequest to list site and driveItem permissions like this:
# Authenticate as usual.Connect-MgGraph# Get site permissionsInvoke-MgGraphRequest-Uri "v1.0/sites/$SiteId/permissions"# Get driveItem permissionsInvoke-MgGraphRequest-Uri "v1.0/drives/$DriveId/items/$DriveItemId/permissions"
Invoke-MgGraphRequest is a command that we recently added to the SDK for making arbitrary requests to Graph.
On Thu, Apr 1, 2021 at 10:50 AM Peter Ombwa ***@***.***> wrote:
@kathyblasco <https://github.com/kathyblasco>, as a workaround, you could
use Invoke-MgGraphRequest to list site and driveItem permissions like
this:
# Authenticate as usual.Connect-MgGraph
# Get site permissionsInvoke-MgGraphRequest -Uri "v1.0/sites/$SiteId/permissions"
# Get driveItem permissionsInvoke-MgGraphRequest -Uri "v1.0/drives/$DriveId/items/$DriveItemId/permissions"
Invoke-MgGraphRequest is a command that we recently added to the SDK for
making arbitrary requests to Graph.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#600 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHTMJGQXFLLETVHPE5FA2ADTGSI3HANCNFSM42CIGA2A>
.
I updated Microsoft.Graph to 1.10.0 but permissions output are still empty after running Get-MgSite -Property Permissions -SiteId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or Get-MgSitePermission -SiteId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
PS C:\Windows\system32> Get-Module
ModuleType Version Name
Script 1.10.0 Microsoft.Graph.Authentication
Script 1.10.0 Microsoft.Graph.Sites
Hello, I am running into the same issue even after updating to v1.10.0.
I have connect using app only authentication with the Sites.Fullcontrol.All permission:
The Microsoft.Graph.Sites module has version 1.10.0:
Running get-mgsite -siteid root, the permissions are still empty:
Running get-mgsitepermission -siteid root permissions are also empty:
In "app-CD..." API Permissions I added Application permission for SharePoint "sites.selected".
Successfully granted write permissions for "app-CD..." service principal in the SharePoint site id "2fb9..."
Connected to Microsoft Graph with scope Sites.FullControl.All and checked module version.
Ran Get-Mgsite and Get-MgSitePermission for the SharePoint side id "2fb9..." and it does not show that the "app-CD..." has write permissions on the the site.
I am not sure why this issue was closed. This is still not resolved. Generally, we don't need permissions to the Root site. WE need permissions to the sites we have created. The Owner/Member/Visitor groups of each individual site. I understand if the sub library or broken inheritance is taken away, but this top level permissions should be seen.
I am currently on Module Version 1.9.3 and this is still not showing up. Whether i look under Get-MGSite or Get-MGSitePermissions. If this was resolved please tell me how this can be addressed. currently:
Get-mgsite -All | Where {$.WebUrl -eq } | Get-MgSitePermission -siteId $.Id
Nor taking the Site ID as a variable or direct. The permissions still don't appear.
Peter Ombwa (@peombwa) Please reopen this issue.
Just like @teephysicist I'm receiving the same output.
App-only auth with Sites.Fullcontrol.All permission is used, site can be found, Get-MgSitePermission returns nothing, also no error. Invoke-MgGraphRequest -Uri "v1.0/sites/$SiteId/permissions" also returns an empty value.
The simplest and clearer method I've found to show the existing permissions is by using ToJsonString() method: $Perm = Get-MgSitePermission -SiteId $siteId $Perm.ToJsonString()
roles (read or write) are missing here. To get them, query with the PermissionId. I only have permission for 1 application. I suppose you need to adjust the $Perm index if several are defined: (Get-MgSitePermission -SiteId $siteId -PermissionId $perm.Id).ToJsonString()
Activity
peombwa commentedon Mar 31, 2021
Thanks for opening this bug.
I can indeed confirm that the SDK is missing
Get-MgSitePermissioncommand that should call/sites/{sitesId}/permissions. We need to update our modules mapping to cover this. This should be available in upcoming versions.peombwa commentedon Mar 31, 2021
For driveItems, we will need to wait for
drives/driveItem/{driveItem-id}/permissionsto be added the OpenAPI document that this SDK is generated from. This can be tracked here https://github.com/microsoftgraph/microsoft-graph-devx-api/issues/509.kathyblasco commentedon Apr 1, 2021
peombwa commentedon Apr 1, 2021
Kathy B (@kathyblasco), as a workaround, you could use
Invoke-MgGraphRequestto listsiteanddriveItempermissions like this:Invoke-MgGraphRequestis a command that we recently added to the SDK for making arbitrary requests to Graph.kathyblasco commentedon Apr 1, 2021
lbenkensteinGP commentedon Jun 24, 2022
I updated Microsoft.Graph to 1.10.0 but permissions output are still empty after running
Get-MgSite -Property Permissions -SiteId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxorGet-MgSitePermission -SiteId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.PS C:\Windows\system32> Get-Module
ModuleType Version Name
Script 1.10.0 Microsoft.Graph.Authentication
Script 1.10.0 Microsoft.Graph.Sites
peombwa commentedon Jun 27, 2022
The command works as expected in v1.10.0:

Please note that the API only supports application permissions. See https://docs.microsoft.com/en-us/graph/api/site-list-permissions?view=graph-rest-1.0&tabs=http#permissions.
See https://docs.microsoft.com/en-us/powershell/microsoftgraph/app-only?toc=%2Fgraph%2Ftoc.json&view=graph-powershell-1.0&viewFallbackFrom=graph-rest-1.0&tabs=azure-portal for how to use app-only authentication with the PowerShell SDK.
matthijstuenter commentedon Jul 19, 2022
Hello, I am running into the same issue even after updating to v1.10.0.




I have connect using app only authentication with the Sites.Fullcontrol.All permission:
The Microsoft.Graph.Sites module has version 1.10.0:
Running get-mgsite -siteid root, the permissions are still empty:
Running get-mgsitepermission -siteid root permissions are also empty:
lbenkensteinGP commentedon Jul 20, 2022
Am I doing something wrong?
I tested again, here are all the steps I did:
Created a new SharePoint site, site id: "2fb9..."
Created a new App Registration: "app-CD..."
In "app-CD..." API Permissions I added Application permission for SharePoint "sites.selected".

Successfully granted write permissions for "app-CD..." service principal in the SharePoint site id "2fb9..."

Connected to Microsoft Graph with scope Sites.FullControl.All and checked module version.

Ran Get-Mgsite and Get-MgSitePermission for the SharePoint side id "2fb9..." and it does not show that the "app-CD..." has write permissions on the the site.


Asaurdiff-Tillamook commentedon Aug 1, 2022
I am not sure why this issue was closed. This is still not resolved. Generally, we don't need permissions to the Root site. WE need permissions to the sites we have created. The Owner/Member/Visitor groups of each individual site. I understand if the sub library or broken inheritance is taken away, but this top level permissions should be seen.
I am currently on Module Version 1.9.3 and this is still not showing up. Whether i look under Get-MGSite or Get-MGSitePermissions. If this was resolved please tell me how this can be addressed. currently:
Get-mgsite -All | Where {$.WebUrl -eq } | Get-MgSitePermission -siteId $.Id
Nor taking the Site ID as a variable or direct. The permissions still don't appear.
Skaldhor commentedon Aug 2, 2022
Peter Ombwa (@peombwa) Please reopen this issue.
Just like @teephysicist I'm receiving the same output.
App-only auth with Sites.Fullcontrol.All permission is used, site can be found,
Get-MgSitePermissionreturns nothing, also no error.Invoke-MgGraphRequest -Uri "v1.0/sites/$SiteId/permissions"also returns an empty value.tberta commentedon Oct 10, 2023
The simplest and clearer method I've found to show the existing permissions is by using ToJsonString() method:
$Perm = Get-MgSitePermission -SiteId $siteId$Perm.ToJsonString()roles (read or write) are missing here. To get them, query with the PermissionId. I only have permission for 1 application. I suppose you need to adjust the
$Permindex if several are defined:(Get-MgSitePermission -SiteId $siteId -PermissionId $perm.Id).ToJsonString()