Forum Discussion
How to get createddatetime,Assignedlicences using Get-AzureADUser from AzureAD
Hi All,
I would like to get the following properties
-Createddatetime - time users was created
-Assigned Licences
I tried the following below
Get-AzureADUser -All $true | Where-Object {$_.mail -like '*@domain'} | Select-Object ObjectId, DisplayName, UserPrincipalName, JobTitle, StreetAddress, ImmutableId, Department, CompanyName, FacsimileTelephoneNumber, AccountEnabled, UserType, passwordPolicies, createdDateTime, @{N="Licenses";E={$_.Licenses.AccountSkuId}} | Export-Csv -nti "outputfile"
But my createdDateTime retuned nothing and AssignedLicences is returning a collection.
How can i get a list of the assignlicences and the createdatetime?
Thanks
5 Replies
- farismalaebSteel ContributorHi,
Did it work with you as in the answer I propose 🙂 ... hopefully
if all is good, please Click on Best Response and hit the like button
Thanks- Patrick RoteIron Contributor
Thanks farismalaeb
Haven't tested MSOnline module as yet.
Can i get users createdDatetime using PNP at all?
Or its not possible?- farismalaebSteel Contributor
try it and let me know, but I am using the MSOnline module which give me almost all such details.
keep me posted.
Thanks
- farismalaebSteel Contributor
Hi,
based on my try I notice that the Get-AzureADUser dont have the CreateDateTime property.
also for the licensing you will need to use Get-AzureADUserLicenseDetail | select Sku*,ServicePlans
I am using Get-Msonline and its returning all the result you are looking for.
So I can get the WhenCreate property and Licenses. I guess its better to use the MSOnline module.
Both are connecting to the same AD.