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

The argument "Preview" does not belong to the set "Export,Purge,Retention" #3498

Closed
1 of 10 tasks
808d1 opened this issue Jul 25, 2023 · 5 comments · Fixed by #3520 or #3568
Closed
1 of 10 tasks

The argument "Preview" does not belong to the set "Export,Purge,Retention" #3498

808d1 opened this issue Jul 25, 2023 · 5 comments · Fixed by #3520 or #3568
Labels

Comments

@808d1
Copy link

808d1 commented Jul 25, 2023

Description of the issue

When exporting the Security And Compliance workload, I am receiving a lot of errors referencing a missing ValidateSet attribute in MSFT_SCComplianceSearchAction.psm1 for every call to the "Get-CurrentAction" function.

...

Microsoft 365 DSC Version

1.23.719.1

Workload

  • Azure Active Directory
  • Exchange Online
  • Office 365 Admin
  • OneDrive for Business
  • Planner
  • Power Platform
  • Security & Compliance Center
  • SharePoint Online
  • Teams
  • other

The DSC configuration

Extracting SCComplianceSearchAction using CertificateThumbprint

Verbose logs showing the problem

Cannot validate argument on parameter 'Action'. The argument "Preview" does not belong to the set "Export,Purge,Retention" specified by the ValidateSet attribute.
"Error retrieving data:"
at Get-TargetResource, C:.....\Modules\Microsoft365DSC\1.23.719.1\DSCResources\MSFT_SCComplianceSearchAction.psm1:line 105

Environment Information + PowerShell Version

Microsoft Windows 10 Enterprise
EnterpriseEdition
64-bit
2009
19041.1.amd64fre.vb_release.191206-1406
en-US
{en-US}

PSVersion 5.1.19041.3031
@andikrueger andikrueger added Bug Something isn't working Security & Compliance Center V1.23.719.1 Version 1.23.719.1 labels Jul 26, 2023
@NikCharlebois
Copy link
Collaborator

The solution does support the Preview value. What version of Microsoft365DSC are you using? It may be worth updating to the latest version with update-M365dscmodule,

@NikCharlebois NikCharlebois removed the Bug Something isn't working label Jul 27, 2023
@ricmestre
Copy link
Contributor

@NikCharlebois The resource supports Preview but the problem exists in the ancillary function Get-CurrentAction which is missing it from the ValidateSet

@808d1
Copy link
Author

808d1 commented Jul 27, 2023

The solution does support the Preview value. What version of Microsoft365DSC are you using? It may be worth updating to the latest version with update-M365dscmodule,

I am using the latest version released yesterday. There are Preview search actions defined in our tenant that are being pulled from the Get-ComplianceSearchAction on line 719 of MSFT_SCComplianceSearchActions. If Preview search actions aren't supported, can we at least filter them out of the results retrieved by Get-ComplianceSearchAction? Also, Preview is being accounted for in Get-TargetResource, Set-TargetResource, and Test-TargetResource, it's just missing in Get-CurrentAction.

@NikCharlebois
Copy link
Collaborator

Got it. Get-CurrentAction should not have enforced a ValidateSet. Out of curiosity, are you able to use the -Preview on the New-ComplianceSearchAction cmdlet for your tenant? That parameter seems to exist in the documentation, but isn't exposed by the cmdlet. Do you know how these Preview actions were created in the first place on the tenant?

@NikCharlebois NikCharlebois added Bug Something isn't working Pending Information labels Jul 27, 2023
@808d1
Copy link
Author

808d1 commented Jul 27, 2023

Got it. Get-CurrentAction should not have enforced a ValidateSet. Out of curiosity, are you able to use the -Preview on the New-ComplianceSearchAction cmdlet for your tenant? That parameter seems to exist in the documentation, but isn't exposed by the cmdlet. Do you know how these Preview actions were created in the first place on the tenant?

I'm not sure how these were created in my company, they were created before I started. I am able to use the -Preview but only after assigning myself eDiscovery Manager and Admin. Here's a sample script I successfully ran in my personal sandbox tenant:

Import-Module ExchangeOnlineManagement
Connect-IPPSSession

#Create a search query specifying a name, where to look, and the search parameters
New-ComplianceSearch -Name "Test4Nick" -ExchangeLocation 'All' -ContentMatchQuery "(c:c)(Subject: 'Urgent Request') "

#Start the search query created above
Start-ComplianceSearch -Identity 'Test4Nick'

#Check status of the search query
Get-ComplianceSearch -Identity 'Test4Nick'

#Preview the results to compare with the web-results,
New-ComplianceSearchAction -SearchName 'Test4Nick' -Preview

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

Successfully merging a pull request may close this issue.

4 participants