Install-Module -Name GraphEssentials -AllowClobber -ForceForce and AllowClobber aren't necessary, but they do skip errors in case some appear.
GraphEssentials requires Microsoft Graph SDK 2.40.0 or later. Keep the required Graph SDK modules on the same version, including Microsoft.Graph.Authentication, and start a new PowerShell session after updating them.
PowerShell 7 is recommended. In Windows PowerShell 5.1, increase the session's function limit before importing GraphEssentials so the required Graph SDK commands can load:
$MaximumFunctionCount = 32768
Import-Module GraphEssentialsThe default Windows PowerShell limit is 4,096 functions; the Graph SDK can exceed it. See Microsoft's guidance on this limit.
Update-Module -Name GraphEssentialsThat's it. Whenever there's a new version, you run the command, and you can enjoy it. Remember that you may need to close, reopen PowerShell session if you have already used module before updating it.
The essential thing is if something works for you on production, keep using it till you test the new version on a test computer. I do changes that may not be big, but big enough that auto-update may break your code. For example, small rename to a parameter and your code stops working! Be responsible!
# Client secret Encrypted can be saved to file and then loaded from file
$ClientSecretEncrypted = 'ClientSecretToEncrypt' | ConvertTo-SecureString -AsPlainText | ConvertFrom-SecureString
$AccessToken = Get-MgToken -Domain 'evotec.pl' -ClientID 'ClientID' -ClientSecretEncrypted $ClientSecretEncrypted
Connect-MgGraph -AccessToken $AccessTokenConnect-MgGraph -Scopes Application.ReadWrite.All, AccessReview.Read.All, AdministrativeUnit.Read.All, 'User.Read.All', RoleManagement.Read.Directory, Directory.Read.All, EntitlementManagement.Read.AllComplete list of commands available in GraphEssentials module.
| CommandType | Name |
|---|---|
| Function | Get-MgToken |
| Function | Get-MyApp |
| Function | Get-MyAppCredentials |
| Function | Get-MyConditionalAccess |
| Function | Get-MyDefenderDeploymentKey |
| Function | Get-MyDefenderHealthIssues |
| Function | Get-MyDefenderSecureScore |
| Function | Get-MyDefenderSecureScoreProfile |
| Function | Get-MyDefenderSensor |
| Function | Get-MyDefenderSummary |
| Function | Get-MyDevice |
| Function | Get-MyDeviceIntune |
| Function | Get-MyGuest |
| Function | Get-MyLicense |
| Function | Get-MyRole |
| Function | Get-MyRoleHistory |
| Function | Get-MyRoleUsers |
| Function | Get-MyTeam |
| Function | Get-MyTenantName |
| Function | Get-MyUsageReports |
| Function | Get-MyUser |
| Function | Get-MyUserAuthentication |
| Function | Disable-MyDevice |
| Function | Invoke-MyDeviceRetire |
| Function | Invoke-MyGraphEssentials |
| Function | Invoke-MyGraphUsageReports |
| Function | New-MyApp |
| Function | New-MyAppCredentials |
| Function | Register-FIDO2Key |
| Function | Remove-MyAppCredentials |
| Function | Remove-MyAutopilotDevice |
| Function | Remove-MyDevice |
| Function | Remove-MyDeviceIntuneRecord |
| Function | Send-MyApp |
| Function | Show-MyApp |
| Function | Show-MyConditionalAccess |
| Function | Show-MyDefender |
| Function | Show-MyRole |
| Function | Show-MyUserAuthentication |