$psversiontable
winget install Microsoft.PowerShell
set-executionpolicy -executionpolicy remotesigned -scope currentuser
install-module microsoft.graph -scope currentuser
get-mgprofile
select-mgprofile -name "v1.0"
Connect-MgGraph -Scopes "Directory.Read.All","User.Read.All","Device.Read.All"
get-mggroup
get-mggroup | where-object {$_.DisplayName -like "EUM*"} | Sort-Object -Property DisplayName
Get-MgUser -all -Property “employeeType,DisplayName,UserPrincipalName” | select EmployeeType,DisplayName,UserPrincipalName
Get-MgUser -ExpandProperty Manager | select @{Name = ‘Manager’; Expression = {$_.Manager.AdditionalProperties.displayName}}, UserPrincipalName
Install-Module -Name Microsoft.Graph -RequiredVersion 1.28.0
Install-Module AzureAD
Important: if you want to see all records add -all (e.g.
cls
Find-MgGraphCommand -command Get-MgUser | Select -First 1 -ExpandProperty Permissions
Connect-MgGraph -Scopes "DeviceManagementApps.Read.All","DeviceManagementConfiguration.Read.All","DeviceManagementManagedDevices.Read.All","DeviceManagementServiceConfig.Read.All","Directory.Read.All","User.Read.All","User.ReadBasic.All"
Get-AzureADUser -Filter "UserType eq 'Member' and accountEnabled eq true" -All $true | ?{ $_.CompanyName -eq 'MyCompany____' } | select CompanyName, DisplayName, Surname, GivenName, JobTitle, Department, PhysicalDeliveryOfficeName, MailNickName, TelephoneNumber, Mobile
Directory.Read.All
User.Read.All
Device.Read.All
DeviceManagementApps.Read.All
DeviceManagementConfiguration.Read.All
DeviceManagementManagedDevices.Read.All
DeviceManagementServiceConfig.Read.All
Get-MgUser: Get and Export Azure AD users properties with Graph Modules – Get Practical
Get AzureADUser - How to Find Azure AD Users with PowerShell (lazyadmin.nl)
in ad ...
Get-ADUser "YourUser" -Properties Initials
Get-ADUser -filter * -Properties Initials, Displayname, Company, enabled | select Initials, Displayname, Company, enabled | where-object {$_.Enabled -eq 'True'}| ?{ $_.Company -like 'Eumedica Pharmaceuticals*' }| Sort-Object -Property DisplayName