Skip to content

Get-MgReportEmailActivityUserDetail : A parameter cannot be found that matches parameter name 'UserId'. #3022

@KnutSander

Description

@KnutSander

Describe the bug

I am trying to use Get-MgReportEmailActivityUserDetail to get information only about a certain user, using the UserId parameter in the inputObject, but I am recieving the following error.

Get-MgReportEmailActivityUserDetail: 
Line |
   7 |  Get-MgReportEmailActivityUserDetail @inputObject -OutFile 'temp.csv'
     |                                      ~~~~~~~~~~~~
     | A parameter cannot be found that matches parameter name 'UserId'.

The input object looks like this:

$inputObject = @{
    Period = "D90"
    UserId = "[email protected]" 
}

I have tried several other parameters as well, but they also produce the same error.

Expected behavior

UserId is defined as one of the parameters that can be passed to the function in the documentation, so the expected behaviour is that I am allowed to pass it to the function and that it returns a result.

How to reproduce

  1. Connect to Microsoft Graph with at least "Reports.Read.All" privileges.
  2. Create an input object as described above
  3. Run the Get-MgReportEmailActivityUserDetail command with the inputObject and an OutFile.

SDK Version

2.22.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

Name                    |       Value
----                       |    -----
PSVersion             |         7.4.6
PSEdition              |        Core
GitCommitId         |           7.4.6
OS                          |   Microsoft Windows 10.0.26100
Platform                  |     Win32NT
PSCompatibleVersions |          {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion |     2.3
SerializationVersion         |  1.1.0.1
WSManStackVersion        |      3.0

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions