Forum Discussion
escupham
Oct 31, 2017Iron Contributor
Get a report of all cloud accounts
I need to get a list of all cloud only accounts (onmicrosoft.com). I can see in Azure AD User Reports the Source field will help narrow this down for me as we sync our on-prem AD to the cloud, so th...
David Blodgett
Apr 17, 2018Copper Contributor
The trouble I'm having with this command is that it does not return all objects. While the documentation states that there is an -All flag that should achieve this,(https://docs.microsoft.com/en-us/powershell/module/azuread/get-azureaduser?view=azureadps-2.0) it does not appear to work.
Running Get-Help Get-AzureADUser does not show the -All flag.
PS C:\Windows\system32> Get-Help Get-AzureADUser
NAME
Get-AzureADUser
SYNOPSIS
Retrieves a specific user from Azure Active Directory
SYNTAX
Get-AzureADUser [-Top <Nullable`1[Int32]>] [-Filter <String>] [<CommonParameters>]
Get-AzureADUser [-SearchString <String>] [<CommonParameters>]
Get-AzureADUser -ObjectId <String> [<CommonParameters>]
DESCRIPTION
RELATED LINKS
REMARKS
To see the examples, type: "get-help Get-AzureADUser -examples".
For more information, type: "get-help Get-AzureADUser -detailed".
For technical information, type: "get-help Get-AzureADUser -full".
For online help, type: "get-help Get-AzureADUser -online"
VasilMichev
Apr 17, 2018MVP
"All" is a Boolean parameter, so you have to use it like this:
Get-AzureADUser -All $true
I know, stupid, just add it to the list of inconveniences for the module...
- David BlodgettApr 17, 2018Copper Contributor
Yes, I read that was the case, but it does not work. This is the result I get from that command.
PS C:\Windows\system32> Get-AzureADUser -All $True
Get-AzureADUser : A parameter cannot be found that matches parameter name 'All'.
At line:1 char:17
+ Get-AzureADUser -All $True
+ ~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-AzureADUser], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.Open.AzureAD16.PowerShell.GetUser- VasilMichevApr 17, 2018MVP
What version of the AzureAD module is that?
- David BlodgettApr 17, 2018Copper Contributor
I updated it in the process of trying to figure this out.
PS C:\Windows\system32> Get-Module -Name AzureAD
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 2.0.0.33 AzureAD {Add-AzureADApplicationOwner, Add-AzureADDeviceRegisteredOwner, Add-AzureADDeviceRegisteredUser, A...