Microsoft Secure Tech Accelerator
Apr 13 2023, 07:00 AM - 12:00 PM (PDT)
Microsoft Tech Community

How to search activities using user's login ID using REST API?

New Contributor

I am new to this. So far got few filters working with powershell.

But I can't make it work with entity. For now I copied the entity ID from the portal's URL.  Example: [{ “id”: “entity-id”, “saas”: 11161, “inst”: 0 }]).  Here is my query..


$Body = @{
    limit = 10
    skip = 0
    filters = @{
        entity = @{
            eq = '[{"id":"d75c39d9-0cd4-48cb-825c-9b6850ea0c3e","saas":"11161","inst":"0"}]'



2 Replies

Hi Brajesh,

This filter accepts entity pksthat looks like this:

{ "id": "entity-id", "saas": 11161, "inst": 0 }


You may use “eq” or “neq” with a list of entities pks, for example:






            "eq":[{"id":"entity-id", "saas":11161, "inst":0}]







I am using powershell Invoke-RestMethod and kind of following this example.  Codes you mentioned I think for curl, as per API documentation. Not sure if they will work in powershell cmdlet.

Any idea how to search using UPN instead of entity ID?