Get list of Devices from Azure AD, with Filter.
Hi Everyone,
Here is another simple script once again for you, to list devices from Azure AD with a filter on Display Name.
I want the list of devices where their names start with EWR or for that matter it can be anything else, depending on your requirement. Please make sure that Azure AD PowerShell module is installed before running this script.
I am getting four things in the results. DeviceType, AccountEnabled, Operating System and Display Name.
Connect-AzureAD
Write-Output "List of Devices from Azure AD"
Write-Output ""
Write-Output "Device --- Enabled --- Device OS --- Displayname"
$FormatEnumerationLimit = -1
$meetingroomsample = "ewr*"
$develist =Get-AzureADDevice -All $true | where displayname -Like "$meetingroomsample"
foreach ($device in $devicelist)
{
Write-Output ( $device.objecttype + "`t--- " + $device.accountenabled + "`t --- " + $device.deviceostype + "`t --- " + $device.displayname )
}
Output generated like this:

