SharePoint/PnP-JS-Core

SPFX and AD Groups Permissions

Closed this issue · 1 comments

Category

[ ] Enhancement

[ ] Bug

[ #] Question

Version

Hello

Hope someone can put me on the right path with this question. I have some users added to an AD Group. The AD group is added to a SharePoint Group to provide permission.

Now from a SPFx web part, within code, how do i resolve users within the AD group if i query the SharePoint Group. This code did not work:
await web.siteGroups.getByName('SP Group Name').users

If the above is not possible, is it possible to query the AD Group directly. I am trying to do the following but not working either:
pnp.sp.utility.searchPrincipals("AD Group Name", PrincipalType.All, PrincipalSource.All, "", 10)

So my question is can we resolve users in an AD group that's added to a SharePoint group from SPFx code?
Or can we resolve users in an AD Group directly from SPFx code?

Thanks in advance

Hi @Mike-tech you can use graph to check group membership - the SharePoint methods aren't really designed to parse AD groups.


Thank you for your interest in the sp-pnp-js library. We wanted to mention that this library is being deprecated in July, 2018 in favor of the new scoped pnpjs libraries. You should begin transitioning your existing projects when possible, or start new projects with the new libraries. Please see the transition guide for more details on migrating and be sure to let us know if you have any questions. Thanks!