Get-ComplianceSearch

Glenn Maxwell 10,751 Reputation points
2020-08-21T02:40:59+00:00

Hi all

When i use the below commands i get the complete results ran by all the users ,how do i pull the results which i have ran with my user account max@mydomain.com

Get-ComplianceSearch
Get-ComplianceSearchAction
Get-ComplianceSearchAction | fl Name,SearchName,Identity

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,368 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lydia Zhou - MSFT 2,371 Reputation points Microsoft Employee
    2020-08-24T05:22:11.367+00:00

    Please pay attention that, a "}" is missed for the commands provided by AD-7937. Based on my test, "?{$.CreatedBy -eq 'Administrator'}" and "?{$.RunBy -eq 'Administrator'}" can work as expected.

    Here are my test results:

    Get-ComplianceSearch  
    Get-ComplianceSearch -ResultSize unlimited | ?{$_.CreatedBy -eq 'Administrator'}  
    Get-ComplianceSearch -ResultSize unlimited | ?{$_.RunBy -eq 'Administrator'}  
    

    19778-541.png

    Get-ComplianceSearchAction  
    Get-ComplianceSearchAction -ResultSize unlimited | ?{$_.CreatedBy -eq 'Administrator'} | fl Name,SearchName,Identity  
    Get-ComplianceSearchAction -ResultSize unlimited | ?{$_.RunBy -eq 'Administrator'} | fl Name,SearchName,Identity  
    

    19804-542.png


    If the response is helpful, please click "Accept Answer" and upvote it.


3 additional answers

Sort by: Most helpful
  1. Andy David - MVP 145K Reputation points MVP
    2020-08-21T13:23:01.497+00:00

    Note the CreatedBy and RunBy fields use the Display Name of the user who created, so make sure you using correct name of the user

    19465-image.png

    0 comments No comments

  2. Glenn Maxwell 10,751 Reputation points
    2020-08-21T14:37:06.513+00:00

    will the below work for me

    Get-ComplianceSearchAction -ResultSize unlimited | ?{$.CreatedBy -eq 'Administrator' | fl Name,SearchName,Identity
    Get-ComplianceSearchAction -ResultSize unlimited | ?{$
    .RunBy -eq 'Administrator' | fl Name,SearchName,Identity

    0 comments No comments

  3. Andy David - MVP 145K Reputation points MVP
    2020-08-21T14:43:19.88+00:00

    Yes, if that is who ran it.
      
Get-ComplianceSearchAction -ResultSize unlimited | ?{$._CreatedBy -eq 'Administrator'} | fl Name,SearchName,Identity  
Get-ComplianceSearchAction -ResultSize unlimited | ?{$._RunBy -eq 'Administrator'} | fl Name,SearchName,Identity

    0 comments No comments