pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

Get-pnptenantsite conditional access defaults to Full Access #2596

Open msnaveen opened 4 years ago

msnaveen commented 4 years ago

I would start saying thanks for the wonderful Module to work with. Well i was working with this module and i figured out that whenever we run get-pnptenantsite -detailed | select ConditionalAccessPolicy,URL i always get the ConditiopnalAccessPolicy to be AllowFullAccess even if i do this for single URL it gives me the correct information. I am using the latest Versions. We are trying to get the information of more than 300 K Sites for a big enterprise.

$sites = Get-PnPTenantSite -Detailed -IncludeOneDriveSites foreach ($site in $sites) { $site | Select-Object Url, ConditionalAccessPolicy
} The ConditionalAccessPolicy output defaults to full access

was able to get the details but it is running the same command twice NON WORKING $sites = Get-PnPTenantSite -Detailed -IncludeOneDriveSites foreach ($site in $sites) { $site | Select-Object Url, ConditionalAccessPolicy } WORKING $sites = Get-PnPTenantSite -Detailed -IncludeOneDriveSites |select url foreach ($site in $sites) { Get-PnPTenantSite -Url $site.Url | Select-Object Url,ConditionalAccessPolicy}

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

msnaveen commented 4 years ago

I think https://github.com/pnp/PnP-PowerShell/issues/2598 this issue is also is same as mine. so can we have a Traige and get this please fixed.

vinitvt1 commented 4 years ago

@wobba @stevebeauge @ibondy i feel the issue is with "GetSitePropertiesFromSharePointByFilters" where in its not returning correct results for -detailed .. could you please check on it

wobba commented 4 years ago

I would defer this as an API bug to be logged at sp-dev-docs.

We set IncludeDetail=true in the SPOSitePropertiesEnumerableFilter request when using Tenant.GetSitePropertiesFromSharePointByFilters. Doing fixes in PnP to remedy this seems not to be the right approach.

XabiBeltza commented 4 years ago

Any updates? This keeps happening...

wobba commented 4 years ago

@XabiBeltza I don't know if anyone has logged it as an issue per my suggestion.

aaronnavratil commented 4 years ago

@Wobba - Presuming you are referring to the function "SPOSitePropertiesEnumerableFilter" documented here https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-csom/dn140320(v=office.15) is the filter value also set to null or an empty string by the PowerShell call? Per the "Remarks" section of the documentation page?

same issue plagues the Sharepoint-Online module https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/get-sposite?view=sharepoint-ps

wobba commented 4 years ago

We assign what is passed in, if nothing it should be null. Code is straight forward if you want to test combinations https://github.com/pnp/PnP-PowerShell/blob/master/Commands/Admin/GetTenantSite.cs#L71

aaronnavratil commented 4 years ago

Right - any manner of filter including an empty string '' makes no difference, so as you indicate, likely an api problem. I'm a bit naive, where is the sp-dev-docs page where I can create the bug/report.

wobba commented 4 years ago

https://github.com/SharePoint/sp-dev-docs

prashant1380 commented 4 years ago

Seems like this issue is still open and I am also getting the same wrong output