Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENHANCEMENT / FEATURE REQUEST - Filter on Property #4749

Closed
Raimer1988 opened this issue Jun 8, 2024 · 3 comments
Closed

ENHANCEMENT / FEATURE REQUEST - Filter on Property #4749

Raimer1988 opened this issue Jun 8, 2024 · 3 comments

Comments

@Raimer1988
Copy link

Description of the issue

Is there a way to filter out unwanted properties from the resources instead of filtering the actual resources?

For instance, If I'm running the following export:
Export-M365DSCConfiguration -Components @("AADApplication") -ApplicationId $ApplicationId -CertificateThumbprint $CertificateThumbprint -TenantId $TenantId

I get all the Entra ID applications and all of their properties.
Is it possible to get all the applications, but only subset of the properties (e.g. "AppId", "DisplayName" and "Permissions")?

As far as I understand, the "-Filter" parameter only filters out unwanted resources, not unwanted properties.
I'm looking for something that behaves more like "Select-Object" rather than "Where-Object".

Sorry if this post doesn't follow the proper guidelines. This is my first post on GitHub.

Love the Microsoft365DSC project!

Microsoft 365 DSC Version

1.24.424.1

Which workloads are affected

Azure Active Directory (Entra ID), Exchange Online, Intune, Office 365 Admin, OneDrive for Business, Planner, Power Platform, Security & Compliance Center, SharePoint Online, Teams

The DSC configuration

No response

Verbose logs showing the problem

No response

Environment Information + PowerShell Version

No response

@FabienTschanz
Copy link
Contributor

The purpose of Desired State Configuration is to represent an object in its entirety to make sure that the object corresponds to the one we want to have. If that object is missing, we need enough information to recreate the object again, thus making it a requirement to export all information.

Unfortunately Microsoft365DSC doesn't support what you want directly, but you could export a configuration and "manually" parse the information with ConvertTo-DSCObject, which returns a list of all resources with its properties. There you could then filter out all the properties you need. That's a bit more of a dirty workaround, but it probably works for your case.

@andikrueger
Copy link
Collaborator

As @FabienTschanz points out, there is no such option available in M365DSC as we want to have all available information of a resource within the exports.

Could you describe your use-case a bit more?

@Raimer1988
Copy link
Author

As @FabienTschanz points out, there is no such option available in M365DSC as we want to have all available information of a resource within the exports.

Could you describe your use-case a bit more?

Thank you for your replies @FabienTschanz and @andikrueger .

Our specific use-case is investigating possibilities for scaling the Microsoft365DSC solution.
For instance, we have a tenant with apx. 13.000 O365 groups (and corresponding SharePoint sites) and exporting the data for this amount of groups/sites takes a very long time, which impacts the possibilities for enforcing the settings we might want.

In this scenario I was thinking that we might not necessarily care about each setting ("SocialBarOnSitePagesDisabled"), for each SharePoint site, but only a few select settings ("OverrideTenantAnonymousLinkExpirationPolicy").
If we were able to export only the settings we want, pr. resource type, then we might be able to decrease the time it takes to make such an export.

As FabienTschanz said, we could edit the exported file after the fact, for enforcement. However this will not help when we will want to generate a delta report, later.

It seems as though this specific use is not supported however and that's fine. I was just trying to look into what our possibilities were.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants