Get-EntraDeletedUser
Microsoft Entra IDで論理的に削除された (最近削除された) ユーザーを取得します。
構文
GetQuery (既定)
Get-EntraDeletedUser
[-Top <Int32>]
[-All]
[-Filter <String>]
[-Property <String[]>]
[<CommonParameters>]
GetVague
Get-EntraDeletedUser
[-SearchString <String>]
[-All]
[-Property <String[]>]
[<CommonParameters>]
GetById
Get-EntraDeletedUser
-UserId <String>
[-All]
[-Property <String[]>]
[<CommonParameters>]
説明
Get-EntraDeletedUser コマンドレットは、ディレクトリから論理的に削除された (最近削除された) ユーザーを取得します。 削除されたユーザーは 30 日以内に回復でき、その後は完全に削除されます。
例
例 1: ディレクトリ内の削除されたユーザーを取得する
Connect-Entra -Scopes 'User.Read.All'
Get-EntraDeletedUser | Select-Object Id, UserPrincipalName, DisplayName, AccountEnabled, DeletedDateTime, DeletionAgeInDays, UserType | Format-Table -AutoSize
Id UserPrincipalName DisplayName AccountEnabled DeletedDateTime DeletionAgeInDays UserType
-- ----------------- ----------- -------------- --------------- ----------------- --------
dddddddd-3333-4444-5555-eeeeeeeeeeee dddddddd-3333-4444-5555-eeeeeeeeeeeeAveryS@contoso.com Avery Smith False 2/12/2025 1:15:34 PM 3 Member
この例では、Microsoft Entra ID内のすべての回復可能な削除済みユーザーを取得する方法を示します。
例 2: All パラメーターを使用してディレクトリ内の削除されたユーザーを取得する
Connect-Entra -Scopes 'User.Read.All'
Get-EntraDeletedUser -All | Select-Object Id, UserPrincipalName, DisplayName, AccountEnabled, DeletedDateTime, DeletionAgeInDays, UserType | Format-Table -AutoSize
Id UserPrincipalName DisplayName AccountEnabled DeletedDateTime DeletionAgeInDays UserType
-- ----------------- ----------- -------------- --------------- ----------------- --------
dddddddd-3333-4444-5555-eeeeeeeeeeee dddddddd-3333-4444-5555-eeeeeeeeeeeeAveryS@contoso.com Avery Smith False 2/12/2025 1:15:34 PM 3 Member
この例では、All パラメーターを使用して、回復可能なすべての削除済みユーザーを取得する方法を示します。
例 3: 削除された上位 2 人のユーザーを取得する
Connect-Entra -Scopes 'User.Read.All'
Get-EntraDeletedUser -Top 2 | Select-Object Id, UserPrincipalName, DisplayName, AccountEnabled, DeletedDateTime, DeletionAgeInDays, UserType | Format-Table -AutoSize
Id UserPrincipalName DisplayName AccountEnabled DeletedDateTime DeletionAgeInDays UserType
-- ----------------- ----------- -------------- --------------- ----------------- --------
dddddddd-3333-4444-5555-eeeeeeeeeeee dddddddd-3333-4444-5555-eeeeeeeeeeeeAveryS@contoso.com Avery Smith False 2/12/2025 1:15:34 PM 3 Member
この例では、ディレクトリ内の回復可能な削除された上位 2 人のユーザーを取得する方法を示します。
-Limitのエイリアスとして-Topを使用できます。
例 4: 文字列 'Avery Smith' を含む削除されたユーザーを取得する
Connect-Entra -Scopes 'User.Read.All'
Get-EntraDeletedUser -SearchString 'Avery Smith' | Select-Object Id, UserPrincipalName, DisplayName, AccountEnabled, DeletedDateTime, DeletionAgeInDays, UserType | Format-Table -AutoSize
Id UserPrincipalName DisplayName AccountEnabled DeletedDateTime DeletionAgeInDays UserType
-- ----------------- ----------- -------------- --------------- ----------------- --------
dddddddd-3333-4444-5555-eeeeeeeeeeee dddddddd-3333-4444-5555-eeeeeeeeeeeeAveryS@contoso.com Avery Smith False 2/12/2025 1:15:34 PM 3 Member
この例では、指定した文字列を含むディレクトリ内の削除されたユーザーを取得する方法を示します。
例 5: 削除されたユーザーを表示名でフィルター処理する
Connect-Entra -Scopes 'User.Read.All'
Get-EntraDeletedUser -Filter "displayName eq 'Avery Smith'" | Select-Object Id, UserPrincipalName, DisplayName, AccountEnabled, DeletedDateTime, DeletionAgeInDays, UserType | Format-Table -AutoSize
Id UserPrincipalName DisplayName AccountEnabled DeletedDateTime DeletionAgeInDays UserType
-- ----------------- ----------- -------------- --------------- ----------------- --------
dddddddd-3333-4444-5555-eeeeeeeeeeee dddddddd-3333-4444-5555-eeeeeeeeeeeeAveryS@contoso.com Avery Smith False 2/12/2025 1:15:34 PM 3 Member
この例では、指定した表示名を持つディレクトリ内の削除されたユーザーを取得する方法を示します。
例 6: UserId で削除されたユーザーを取得する
Connect-Entra -Scopes 'User.Read.All'
Get-EntraDeletedUser -UserId 'dddddddd-3333-4444-5555-eeeeeeeeeeee' | Select-Object Id, UserPrincipalName, DisplayName, AccountEnabled, DeletedDateTime, DeletionAgeInDays, UserType | Format-Table -AutoSize
Id UserPrincipalName DisplayName AccountEnabled DeletedDateTime DeletionAgeInDays UserType
-- ----------------- ----------- -------------- --------------- ----------------- --------
dddddddd-3333-4444-5555-eeeeeeeeeeee dddddddd-3333-4444-5555-eeeeeeeeeeeeAveryS@contoso.com Avery Smith False 2/12/2025 1:15:34 PM 3 Member
この例では、UserId で指定された削除されたユーザーを取得する方法を示します。
-
-UserIdパラメーターは、削除されたユーザー UserId を指定します。
パラメーター
-All
すべてのページを一覧表示します。
パラメーターのプロパティ
| 型: | System.Management.Automation.SwitchParameter |
| 規定値: | False |
| ワイルドカードのサポート: | False |
| DontShow: | False |
パラメーター セット
(All)
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | False |
| プロパティ名別のパイプラインからの値: | False |
| 残りの引数からの値: | False |
-Filter
OData v4.0 フィルター ステートメントを指定します。 このパラメーターは、返されるオブジェクトを制御します。
パラメーターのプロパティ
| 型: | System.String |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
パラメーター セット
GetQuery
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | True |
| プロパティ名別のパイプラインからの値: | True |
| 残りの引数からの値: | False |
-Property
返されるプロパティを指定します。
パラメーターのプロパティ
| 型: | System.String[] |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
| Aliases: | Select |
パラメーター セット
(All)
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | False |
| プロパティ名別のパイプラインからの値: | False |
| 残りの引数からの値: | False |
-SearchString
検索文字列を指定します。
パラメーターのプロパティ
| 型: | System.String |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
パラメーター セット
GetVague
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | True |
| プロパティ名別のパイプラインからの値: | True |
| 残りの引数からの値: | False |
-Top
返されるレコードの最大数を指定します。
パラメーターのプロパティ
| 型: | System.Int32 |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
| Aliases: | 極限 |
パラメーター セット
GetQuery
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | True |
| プロパティ名別のパイプラインからの値: | True |
| 残りの引数からの値: | False |
-UserId
取得する削除されたユーザーの ObjectId またはユーザー プリンシパル名。
パラメーターのプロパティ
| 型: | System.String |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
| Aliases: | オブジェクト識別子, UPN, アイデンティティ, ユーザープリンシパルネーム, Id |
パラメーター セット
GetById
| 配置: | Named |
| 必須: | True |
| パイプラインからの値: | True |
| プロパティ名別のパイプラインからの値: | True |
| 残りの引数からの値: | False |
CommonParameters
このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。
入力
System.String
System.Nullable'1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] System.Nullable'1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]