microsoftgraph / microsoftgraph/msgraph-sdk-powershell

Get-MgDirectoryDeletedItem does not return DeletedDateTime property value

Open
#3,244 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Question: SDK Status: Needs Investigation
Dominant language
C#
Stars
898
Forks
230
Avg merge
2d 5h
Merged PRs (30d)
31

Description

Describe the bug

When running the following command, only 4 fields appear to be populated with data:

  1. DisplayName
  2. Id
  3. Mail
  4. UserPrincipalName

Get-MgDirectoryDeletedItem -All

When I try to directly select the DeletedDateTime property, it is blank.

Get-MgDirectoryDeletedItem -All | Select-Object DisplayName, Id, Mail, DeletedDateTime

If it's not possible to populate all the object fields, could you at least populate this critical value?

See the last comments on this closed issue for another user requesting the same.

Expected behavior

DeletedDateTime property should be populated.

How to reproduce
  1. Execute Get-MgDirectoryDeletedItem | Get-Member, confirm that the DeletedDateTime property exists
  2. Execute Get-MgDirectoryDeletedItem -All | Select-Object DisplayName, Id, Mail, DeletedDateTime
  3. Confirm that the DeletedDateTime field is empty
SDK Version

2.26.1

Latest version known to work for scenario above?

No response

Known Workarounds

Invoke-GraphRequest

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running Get-MgDirectoryDeletedItem -All | Select-Object DisplayName, Id, Mail, DeletedDateTime and compare its output with Invoke-GraphRequest, the stated workaround. Check how the Get-MgDirectoryDeletedItem response exposes DeletedDateTime and verify the property is populated while preserving the documented reproduction steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.