<\/div>\n<\/aside>\n\n
That will give you plenty of examples.<\/p>\n
You need to install Microsoft Graph first<\/p>\n
Install-Module Microsoft.Graph -Scope CurrentUser\n<\/code><\/pre>\nConnect to Microsoft Graph<\/p>\n
Connect-MgGraph -Scopes 'User.Read.All'\n<\/code><\/pre>\nFrom there you could do something like<\/p>\n
Get-MgUser -UserId [email protected] | fl\n<\/code><\/pre>\nThat will show you all the properties for that user.<\/p>\n
Then just select the ones you want to return:<\/p>\n
Get-MgUser -UserId [email protected] | Select attrib1,attrib2,attrib3, etc.\n<\/code><\/pre>\nLast logon is harder, you have to search a different log for that one.<\/p>","upvoteCount":4,"datePublished":"2024-06-12T06:32:41.027Z","url":"https://community.spiceworks.com/t/fetch-user-details-o365/1085760/2","author":{"@type":"Person","name":"PatrickFarrell","url":"https://community.spiceworks.com/u/PatrickFarrell"}},{"@type":"Answer","text":"
\nBlockquote \nLast logon is harder, you have to search a different log for that one.<\/p>\n<\/blockquote>\n
Last logon can be retrieved with the same “User.Read.All” scope. For example:<\/p>\n
$User = Get-MgUser -Property \"signInActivity\" -filter \"userprincipalname eq '[email protected] ' \"\n$User.signInActivity.LastSignInDateTime\n<\/code><\/pre>","upvoteCount":3,"datePublished":"2024-06-12T20:19:58.631Z","url":"https://community.spiceworks.com/t/fetch-user-details-o365/1085760/3","author":{"@type":"Person","name":"Evan7191","url":"https://community.spiceworks.com/u/Evan7191"}},{"@type":"Answer","text":"Interesting, will have to try. I need to work more on my graph powershell modules, just haven’t had time with everything going on.<\/p>","upvoteCount":0,"datePublished":"2024-06-13T02:33:01.300Z","url":"https://community.spiceworks.com/t/fetch-user-details-o365/1085760/4","author":{"@type":"Person","name":"PatrickFarrell","url":"https://community.spiceworks.com/u/PatrickFarrell"}},{"@type":"Answer","text":"
Manage Engine has a nice module that will give you tons on info (it’s not free) but it may be what you’re looking for. M365 Manager Plus<\/p>","upvoteCount":0,"datePublished":"2024-06-14T13:05:22.302Z","url":"https://community.spiceworks.com/t/fetch-user-details-o365/1085760/5","author":{"@type":"Person","name":"cadams","url":"https://community.spiceworks.com/u/cadams"}},{"@type":"Answer","text":"
I don’t current use Admindroid, but I’ll throw a spice up on this. I did at another org, and it was a great product at a good price.<\/p>","upvoteCount":1,"datePublished":"2024-06-24T14:29:56.679Z","url":"https://community.spiceworks.com/t/fetch-user-details-o365/1085760/7","author":{"@type":"Person","name":"PatrickFarrell","url":"https://community.spiceworks.com/u/PatrickFarrell"}},{"@type":"Answer","text":"\n\n
<\/div>\n
Corey_A:<\/div>\n
\nManage Engine has a nice module that will give you tons on info (it’s not free) but it may be what you’re looking for. M365 Manager Plus<\/p>\n<\/blockquote>\n<\/aside>\n
ManageEngine has great reporting. Under the hood they are a bit of a mess but as far as the reporting and alerting goes, couldn’t ask for much more.<\/p>","upvoteCount":1,"datePublished":"2024-06-24T14:31:07.715Z","url":"https://community.spiceworks.com/t/fetch-user-details-o365/1085760/8","author":{"@type":"Person","name":"PatrickFarrell","url":"https://community.spiceworks.com/u/PatrickFarrell"}}]}}
HI friends,
I am connected to M365 , I need your advise to fetch on excell bellow mentions items .
user Name,
user surname ,
user email adresse email
user 365 account
manager name
user last logon
How can I achieve this with or without powershell .
Thank you very much
2 Spice ups
The first few are easy:
That will give you plenty of examples.
You need to install Microsoft Graph first
Install-Module Microsoft.Graph -Scope CurrentUser
Connect to Microsoft Graph
Connect-MgGraph -Scopes 'User.Read.All'
From there you could do something like
Get-MgUser -UserId spicerex@spiceworks.com | fl
That will show you all the properties for that user.
Then just select the ones you want to return:
Get-MgUser -UserId adelev@lazydev.onmicrosoft.com | Select attrib1,attrib2,attrib3, etc.
Last logon is harder, you have to search a different log for that one.
4 Spice ups
Evan7191
(Evan7191)
June 12, 2024, 8:19pm
3
Blockquote
Last logon is harder, you have to search a different log for that one.
Last logon can be retrieved with the same “User.Read.All” scope. For example:
$User = Get-MgUser -Property "signInActivity" -filter "userprincipalname eq 'username@domain.com' "
$User.signInActivity.LastSignInDateTime
3 Spice ups
Interesting, will have to try. I need to work more on my graph powershell modules, just haven’t had time with everything going on.
cadams
(Corey_A)
June 14, 2024, 1:05pm
5
Manage Engine has a nice module that will give you tons on info (it’s not free) but it may be what you’re looking for. M365 Manager Plus
I don’t current use Admindroid, but I’ll throw a spice up on this. I did at another org, and it was a great product at a good price.
1 Spice up
ManageEngine has great reporting. Under the hood they are a bit of a mess but as far as the reporting and alerting goes, couldn’t ask for much more.
1 Spice up