Get-MsolDevice
取得個別裝置或裝置清單。
Syntax
Get-MsolDevice
-Name <String>
[<CommonParameters>]
Get-MsolDevice
[-All]
[-ReturnRegisteredOwners]
[<CommonParameters>]
Get-MsolDevice
-DeviceId <Guid>
[<CommonParameters>]
Get-MsolDevice
-All
-LogonTimeBefore <DateTime>
[<CommonParameters>]
Get-MsolDevice
-ObjectId <Guid>
[<CommonParameters>]
Get-MsolDevice
-RegisteredOwnerUpn <String>
[<CommonParameters>]
Get-MsolDevice
-All
-IncludeSystemManagedDevices
[<CommonParameters>]
Description
Get-MsolDevice Cmdlet 會取得個別裝置或裝置清單。
範例
範例 1:取得裝置物件
PS C:\>Get-MsolDevice -Name "NIC0123"
此命令會取得名為 NIC0123 的裝置物件。
範例 2:取得裝置物件清單
PS C:\>Get-MsolDevice -All
此命令會取得裝置物件的清單。 由於未使用 ReturnRegisteredOwners 參數,因此裝置物件不包含 registeredOwners 屬性。
範例 3:取得包含 registeredOwners 屬性的裝置物件清單
PS C:\>Get-MsolDevice -All -ReturnRegisteredOwners
此命令會取得裝置物件的清單。 由於使用 ReturnRegisteredOwners 參數,因此裝置物件會包含 registeredOwners 屬性。
範例 4:依裝置識別碼取得裝置
PS C:\>Get-MsolDevice -DeviceId "1aa200c4-bdfb-42b5-9a1e-5f1bafbe4274"
此命令會取得具有對應裝置識別碼的裝置。
範例 5:依物件識別碼取得裝置物件
PS C:\>Get-MsolDevice -ObjectId "566F7EA7-7BF1-4F4A-AF23-A1B46DBD46D6"
此命令會取得具有對應物件識別碼的裝置。
範例 6:取得 UPN 註冊的裝置
PS C:\>Get-MsolDevice -RegisteredOwnerUpn "pattifuller@contoso.com"
此命令會取得使用者向名為 pattifuller@contoso.com 的 UPN 註冊的所有裝置。
範例 7:依活動取得裝置, (登入) 時間戳記
PS C:\>Get-MsolDevice -All -LogonTimeBefore 'January 1, 2017 12:00:00 AM'
Ths 命令會取得 2017 年 1 月 1 日之前具有 ApproximateLastLogonTimestamp 的所有裝置
範例 8:取得裝置並包含系統管理的裝置
PS C:\>Get-MsolDevice -All -IncludeSystemManagedDevices
此命令會取得所有裝置,並包含自動試驗裝置和其他與Intune (搭配使用的裝置,例如 EAS)
參數
-All
表示此 Cmdlet 會傳回所有結果。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DeviceId
指定這個 Cmdlet 取得之裝置的裝置識別碼。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IncludeSystemManagedDevices
指出此 Cmdlet 包含由系統管理的裝置,例如自動試驗。
Type: | SwitchParamater |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LogonTimeBefore
指定用來篩選裝置清單的日期 (UTC) 。
Type: | DateTime |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
指定這個 Cmdlet 取得之裝置的顯示名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ObjectId
指定這個 Cmdlet 取得之裝置的唯一物件識別碼。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RegisteredOwnerUpn
指定使用者物件,該物件是裝置的已註冊擁有者。 您必須提供使用者主體名稱 (UPN) 或 ObjectId,或傳遞包含使用者 UPN 或 ObjectId的 Microsoft.Online.Administration.User 物件的實例。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ReturnRegisteredOwners
表示這個 Cmdlet 會傳回裝置的 registeredOwners 屬性。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸出
Microsoft.Online.Administration.Device
此 Cmdlet 會傳回裝置物件,其中包含下列資訊:
- AccountEnabled:裝置的狀態:已啟用或停用。
- ObjectId:裝置的唯一識別碼。
- DeviceId:裝置的裝置識別碼。
- DisplayName:裝置的顯示名稱。
- DeviceObjectVersion:裝置的物件版本號碼。
- DeviceOSType:裝置作業系統類型。
- DeviceOSVersion:裝置作業系統版本號碼。
- DeviceTrustType:裝置信任類型。 此值可以是下列其中一項:已加入工作場所、已加入 AzureAD、已加入網域。
- DeviceTrustLevel:裝置信任層級。 此值可以是下列其中一項:已驗證、符合規範、受管理。
- DevicePhysicalIds:裝置實體識別碼。
- ApproximateLastLogonTimestamp:使用此裝置的最後一個登入時間戳記。
- AlternativeSecurityIds:裝置替代安全性識別碼。
- DirSyncEnabled:如果裝置已啟用 DirSync。
- LastDirSyncTime:裝置由 DirSync 同步處理的最後一個時間戳記。
- RegisteredOwners:裝置的已註冊擁有者。
- GraphDeviceObject:從圖形 API 傳回的裝置物件。
相關連結
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應