在 AzureADSignInLogs 查詢中包含某些結果時遇到問題。
我有以下宣告,但想包括更多的結果System.Objects。
Get-AzureADAuditSignInLogs |
Where-Object{$_.ClientAppUsed -like 'Exchange ActiveSync'} |
Format-Table CreatedDateTime, UserPrincipalName, AppDisplayName, ClientAppUsed
最后,我想包含一個屬于 Status 父級的 ErrorCode:
螢屏截圖:Get-AzureADSignInLogs 的 Powershell 結果
但我不確定如何深入獲取資訊然后顯示它。有可能Format-Table嗎?還是必須有其他方式?
uj5u.com熱心網友回復:
您將在使用 Format-Table 之前處理資料,因為這會從物件的角度更改資料的結構。
請參閱下面的內容,其中我在 select-object 陳述句中使用了計算屬性。
Get-AzureADAuditSignInLogs |
Where-Object{$_.ClientAppUsed -like 'Exchange ActiveSync'} |
Select-Object CreatedDateTime, UserPrincipalName, AppDisplayName, ClientAppUsed, @{Name = "ErrorCode"; Expression = {$_.Status.ErrorCode}} |
Format-Table
由于我沒有高級許可證,因此無法在 Azure 中測驗上述內容。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/370381.html
