비즈니스용 Microsoft 365 Basic 및 Business Standard 기본 이동성 및 보안 Microsoft 365 관리 센터 또는 Microsoft Graph PowerShell의 활성 디바이스 페이지를 사용하여 organization 디바이스에 대한 세부 정보를 가져올 수 있습니다.
기본 이동성 및 보안 대한 자세한 내용은 비즈니스용 Microsoft 365의 기본 이동성 및 보안 개요를 참조하세요.
시작하기 전에 알아야 할 사항은 무엇인가요?
에서 기본 이동성 및 보안 https://admin.microsoft.com/Adminportal/Home?#/IntuneDevices/?isMifo=true활성 디바이스 페이지를 엽니다.
아직 설치하지 않은 경우 관리자 권한 PowerShell 창에서 다음 명령을 실행하여 Microsoft Graph PowerShell SDK를 설치합니다( 관리자 권한으로 실행을 선택하여 여는 PowerShell 창).
Install-Module Microsoft.Graph -Scope AllUsers
NuGet 공급자를 설치하거나 PSGallery에서 설치하는 방법에 대한 지시문에 예 라고 대답합니다.
예정된 스크립트를 실행하려면 컴퓨터의 PowerShell 실행 정책을 RemoteSigned로 설정해야 합니다(기본적으로는 아님). 자세한 내용은 PowerShell 실행 정책을 RemoteSigned로 설정을 참조하세요.
이 문서의 절차를 수행하려면 권한이 할당되어야 합니다. 다음과 같은 옵션을 선택할 수 있습니다.
Microsoft Entra 권한: 전역 관리자* 또는 디렉터리 읽기 권한자 역할의 멤버 자격은 사용자에게 Microsoft 365의 다른 기능에 필요한 권한과 권한을 제공합니다.
중요
* 사용 권한이 가장 적은 역할을 사용하는 것이 좋습니다. 사용 권한이 낮은 계정을 사용하면 organization 대한 보안을 개선하는 데 도움이 됩니다. 전역 관리자는 기존 역할을 사용할 수 없는 경우 긴급 시나리오로 제한해야 하는 매우 권한이 높은 역할입니다.
위임된 관리자 계정을 사용하여 기본 이동성 및 보안 관리할 수 없습니다. 위임된 관리에 대한 자세한 내용은 파트너: 위임된 관리 제공을 참조하세요.
활성 디바이스 페이지를 사용하여 디바이스 세부 정보 보기
기본 이동성 및 보안 페이지의 개요 탭에서 https://compliance.microsoft.com/basicmobilityandsecurity디바이스 관리를 선택합니다. 또는 활성 디바이스 페이지로 직접 이동하려면 를 사용합니다 https://admin.microsoft.com/Adminportal/Home?#/IntuneDevices/?isMifo=true.
활성 디바이스 페이지의 완전 관리형 탭에서 디바이스 목록에 다음 속성이 표시됩니다.
- 장치 이름
- 표시 이름
- Username
- 운영 체제
- 디바이스 작업
- 마지막 검사
디바이스 목록을 보통에서 압축 간격 으로 변경하려면 목록 간격을 압축 또는 보통으로 변경한 다음, 압축 목록을 선택합니다
.
검색 상자 및 해당 값을 사용하여 특정 디바이스를 찾습니다.
특정 디바이스에 대한 세부 정보를 보려면 첫 번째 열 옆에 있는 검사 상자가 아닌 행의 아무 곳이나 클릭합니다. 열리는 세부 정보 플라이아웃에는 다음 정보가 포함됩니다.
- 표시 이름
- Username
- OS 버전
- 디바이스 작업
- 마지막 검사
- 관리 유형
- 일련 번호
팁
디바이스(공장 재설정,
회사 데이터 제거 또는
삭제)에 대한 작업을 수행하려면 기본 이동성 및 보안 등록된 디바이스 초기화를 참조하세요.
Microsoft Graph PowerShell을 사용하여 디바이스 세부 정보 보기
Microsoft Graph PowerShell의 디바이스 cmdlet은 인식된 디바이스의 등록 및 규정 준수 상태 표시합니다.
-
isManaged 속성:
- True: 디바이스가 기본 이동성 및 보안 등록되어 있습니다.
- False: 디바이스가 기본 이동성 및 보안 등록되지 않았습니다.
-
isCompliant 속성:
- True: 디바이스는 기본 이동성 및 보안 해당 정책의 설정을 준수합니다.
- False: 디바이스가 기본 이동성 및 보안 해당 정책의 설정을 준수하지 않습니다.
이 정보는 다음 다이어그램에 나와 있습니다.
Get-MgDevice cmdlet을 사용하여 디바이스 세부 정보 보기
PowerShell 창을 열고 다음 명령을 실행하여 Microsoft Graph의 Microsoft 365 organization 연결합니다.
Connect-MgGraph -Scopes Device.Read.All,User.Read.All
연결에 대한 자세한 내용은 Microsoft Graph PowerShell에 로그인을 참조하세요.
다음 명령을 실행합니다.
Get-MgDevice -All -ExpandProperty "registeredOwners" | Where-Object {($_.RegisteredOwners -ne $null) -and ($_.RegisteredOwners.Count -gt 0)}
화면 너비, PowerShell 창의 너비 및 PowerShell 창의 글꼴 크기에 따라 다음 정보가 표시됩니다.
- DeletedDateTime
- Id
- AccountEnabled
- ApproximateLastSignInDateTime
- ComplianceExpirationDateTime
- DeviceId
- DeviceMetadata
- DeviceVersion
- DisplayName
- IsCompliant
- IsManaged
자세한 구문 및 매개 변수 정보는 Get-MgDevice를 참조하세요.
디바이스 세부 정보를 가져오는 PowerShell 스크립트 만들기
다음 텍스트를 메모장에 복사하고 찾기 쉬운 위치에 (PowerShell 스크립트 파일)로
Get-MgGraphDeviceOwnership.ps1
저장합니다. 예를 들어 파일을 C:\My Documents 폴더에 저장합니다.param ( [Parameter(Mandatory = $false)] [PSObject[]]$Users = @(), [Parameter(Mandatory = $false)] [Switch]$Export, [Parameter(Mandatory = $false)] [String]$ExportFileName = "UserDeviceOwnership_" + (Get-Date -Format "yyMMdd_HHMMss") + ".csv", [Parameter(Mandatory = $false)] [String]$ExportPath = [Environment]::GetFolderPath("Desktop") ) #Clearing the screen Clear-Host #Preparing the output object $deviceOwnership = @() if ($users.Count -eq 0) { Write-Output "No user has been provided, gathering data for all devices in the tenant" #Getting all Devices and their registered owners $devices = Get-MgDevice -All -Property * -ExpandProperty registeredOwners #For each device which has a registered owner, extract the device data and the registered owner data foreach ($device in $devices) { $DeviceOwners = $device | Select-Object -ExpandProperty 'RegisteredOwners' #Checking if the DeviceOwners Object is empty if ($DeviceOwners -ne $null) { foreach ($DeviceOwner in $DeviceOwners) { $OwnerDictionary = $DeviceOwner.AdditionalProperties $OwnerDisplayName = $OwnerDictionary.Item('displayName') $OwnerUPN = $OwnerDictionary.Item('userPrincipalName') $OwnerID = $deviceOwner.Id $deviceOwnership += [PSCustomObject]@{ DeviceDisplayName = $device.DisplayName DeviceId = $device.DeviceId DeviceOSType = $device.OperatingSystem DeviceOSVersion = $device.OperatingSystemVersion DeviceTrustLevel = $device.TrustType DeviceIsCompliant = $device.IsCompliant DeviceIsManaged = $device.IsManaged DeviceObjectId = $device.Id DeviceOwnerID = $OwnerID DeviceOwnerDisplayName = $OwnerDisplayName DeviceOwnerUPN = $OwnerUPN ApproximateLastLogonTimestamp = $device.ApproximateLastSignInDateTime } } } } } else { #Checking that userid is present in the users object Write-Output "List of users has been provided, gathering data for all devices owned by the provided users" foreach ($user in $users) { $devices = Get-MgUserOwnedDevice -UserId $user.Id -Property * foreach ($device in $devices) { $DeviceHashTable = $device.AdditionalProperties $deviceOwnership += [PSCustomObject]@{ DeviceId = $DeviceHashTable.Item('deviceId') DeviceOSType = $DeviceHashTable.Item('operatingSystem') DeviceOSVersion = $DeviceHashTable.Item('operatingSystemVersion') DeviceTrustLevel = $DeviceHashTable.Item('trustType') DeviceDisplayName = $DeviceHashTable.Item('displayName') DeviceIsCompliant = if ($DeviceHashTable.ContainsKey('isCompliant')) {$DeviceHashTable.Item('isCompliant')} else {$null} DeviceIsManaged = if ($DeviceHashTable.ContainsKey('isManaged')) {$DeviceHashTable.Item('isManaged')} else {$null} DeviceObjectId = $device.Id DeviceOwnerUPN = $user.UserPrincipalName DeviceOwnerID = $user.Id DeviceOwnerDisplayName = $user.DisplayName ApproximateLastLogonTimestamp = $DeviceHashTable.Item('approximateLastSignInDateTime') } } } } $deviceOwnership if ($export) { $exportFile = Join-Path -Path $exportPath -ChildPath $exportFileName $deviceOwnership | Export-Csv -Path $exportFile -NoTypeInformation Write-Output "Data has been exported to $exportFile" }
PowerShell 창을 열고 다음 명령을 실행하여 Microsoft Graph의 Microsoft 365 organization 연결합니다.
Connect-MgGraph -Scopes Device.Read.All,User.Read.All
연결에 대한 자세한 내용은 Microsoft Graph PowerShell에 로그인을 참조하세요.
다음 구문을 사용하여 스크립트를 실행합니다.
& <path to script>\Get-MgGraphDeviceOwnership.ps1 [-Users <UserIds>] [-Export] [-ExportPath "<File path>"] [-ExportFileName "<FileName>"]
- Users 매개 변수를 사용하지 않으면 스크립트는 organization 모든 디바이스에 대한 정보를 반환합니다. 다음 예제에서는 개별 사용자 또는 그룹 구성원에 대해 Users 매개 변수를 사용하는 방법을 보여 줍니다.
-
내보내기 스위치는 스크립트의 결과를 CSV 파일로 내보냅니다.
ExportPath 또는 ExportFileName 매개 변수를 사용하지 않는 경우 기본 경로는 Desktop 폴더이고 기본 파일 이름은 입니다
UserDeviceOwnership_<Date>_<Time>.csv
. - 스크립트가 있는 폴더(예: PowerShell 창에서 명령
cd C:\My Documents
실행)로 이동하면 스크립트를 실행할 때 모든 명령에서 을 로.\
바꿀& C:\My Documents\
수 있습니다.
이 예제에서는 지정된 사용자에 대한 디바이스 세부 정보를 반환합니다.
& C:\My Documents\Get-MgGraphDeviceOwnership.ps1 -Users (Get-MgUser -UserId "laura@contoso.com")
다음은 FinanceStaff 보안 그룹의 사용자에 대한 디바이스 세부 정보를 반환하고 결과를 지정된 파일 및 위치로 내보내는 예제입니다.
$groupId = Get-MgGroup -Filter "displayName eq 'FinanceStaff'" | Select-Object -ExpandProperty Id
$Users = Get-MgGroupMember -GroupId $groupId | Select-Object -ExpandProperty Id | ForEach-Object {Get-MgUser -UserId $_}
& C:\My Documents\Get-MgGraphDeviceOwnership.ps1 -User $Users -Export -ExportPath "C:\My Documents" -ExportFileName "Contoso FinanceStaff Devices 2024-12-19.csv"