Get-AzureADDevice未显示所有设备 [英] Get-AzureADDevice not showing all devices

查看:49
本文介绍了Get-AzureADDevice未显示所有设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想问一下我在此简单的powershell命令中是否做错了什么.

我输入

 连接 -  AzureAD  
 获取 -   AzureADDevice  

获取 -

Azure门户> Azure Active Directory>设备 >  连续点击加载更多内容 strong>它说有100多个设备.

我在做错什么吗?

谢谢您的帮助!

解决方案

不用担心!默认情况下, 仅返回前100个对象:

搜索用户的最常见方法是使用Get-AzureADUser(它返回目录中的所有用户),然后根据您要查找的属性值进行过滤,例如

 Get-AzureADUser |其中(


<_blockquote> _.City -eq"London")


您可能希望PowerShell返回城市"属性的值等于伦敦"的所有用户.但是...默认情况下,Get-AzureADUser cmdlet仅返回找到的前100个对象,随后的Where cmdlet会将这前100个对象过滤到 查找城市等于伦敦的用户.如果您要查找的用户存在于您的目录中,但在Get-azureADUser cmdlet返回的前100个用户中不存在,则不会返回该用户.

要使Get-AzureADUser cmdlet返回所有用户,可以使用-All参数,如

 Get-AzureADUser-全部


现在,将返回所有用户对象,并且过滤器将对目录中的所有用户对象起作用.因此,找到城市等于伦敦的所有用户的正确方法是:

 Get-AzureADUser-全部


Hi All,

I just like to ask if I am doing anything wrong in this simple powershell command.

I am not an expert in powershell or Azure so please bear with me.

I type 

Connect-AzureAD Get-AzureADDevice

Get-AzureADDevice | Measure-Object | Select Count


When I type the last command it says that there are just 100 devices. But when I go from the browser toAzure portal > Azure Active Directory > Devices > Continuously click Load more it says that there are more than 100 devices.

Is there something I am doing wrong?

Thanks for all your help guys!

解决方案

No worries!  By default, only the first 100 objects are returned:

The most common way to search for a user is to use Get-AzureADUser - which returns all users in your directory - and then filter on the property values you are looking for, e.g.

Get-AzureADUser | Where (


_.City -eq "London")


You would expect PowerShell to return all users where the value for the City property equals London. However... the Get-AzureADUser cmdlet by default only returns the first 100 objects it finds, and the subsequent Where cmdlet filters these first 100 objects to find users where the City equals London. If the user you are looking for exists in your directory but is not in the first 100 users that are returned by the Get-azureADUser cmdlet, that user will not be returned.

To get the Get-AzureADUser cmdlet to return all users, you would use the -All parameter, as in

Get-AzureADUser -All


True

Now all user objects are returned, and the filter works on all user objects in your directory. So the correct way to find all users where City equals London is:

Get-AzureADUser -All


这篇关于Get-AzureADDevice未显示所有设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆