Giter Club home page Giter Club logo

msidentitytools's Issues

bug with scope filter of mggraph?

Describe the bug

cmdlet or module not seeing the scopes when connect to mg graph

PSVersion 5.1.14393.2189
module versions tested : 2.0.16 2.0.45

Code and Error.

Connect-MgGraph -Scopes "Directory.ReadWrite.All, Group.ReadWrite.All"

Get-mggroup -filter "groupTypes/any(c:c eq 'Unified')" | Get-MsIdGroupWritebackConfiguration

Get-MsIdGroupWritebackConfiguration : Additional scope needed, call Connect-MgGraph with one of the following scope
Directory.Read.All, Directory.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, GroupMember.Read.All
At line:1 char:58

  • ... oupTypes/any(c:c eq 'Unified')" | Get-MsIdGroupWritebackConfiguration
  •                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-MsIdGroupWritebackConfiguration

Error after running Export-MsIdAppConsentGrantReport

I've been following the steps from the youtube video:

https://www.youtube.com/watch?v=vO0m5yE3dZA

At the step running Export-MsIdAppConsentGrantReport I see a slew of the following error message:

PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists.

My powershell details are:

PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Looking at the generated xlsx I can see what appears to be all of the details I'd expect, but I wouldn't know what the above error message has prevented from appearing in the report.

Get-MsIdUnmanagedExternalUsers not handling missing property

Describe the bug
Get-MsIdUnmanagedExternalUsers does not handle the IsViral property being missing. The $userRealmResponse variable needs to be checked to ensure it has an object.

To Reproduce
Execute Get-MsIdUnmanagedExternalUsers

Expected behavior
Just show viral users found and handle empty object / missing property

Screenshots
image

Environment (please complete the following information):

  • OS: Windowd
  • PowerShell Version - 7.2
  • MS Graph SDK PowerShell Module Version 1.9.2

Additional context
Add any other context about the problem here.

Export-MsIdAppConsentGrantReport PropertyNotFoundException

Building upon Issue #46 , I have updated both the MSIdentityTools module and the Microsoft.Graph module to the latest versions. I continue to get this error on a very large EntraID tenant.

To give you an idea the error is occurring during "Processing delegate permissions" 35824 out of 43464. At this point I don't know if this is a transient error, bad data in the EntraID, my PIMable global reader running out or something else.

enhancement: Expiring secrets and certs

Id like to suggest some additional cmdlets that list/export the expiring secrets and certificates for a Tenant.

Similar to the expiring examples on https://learn.microsoft.com/en-au/entra/identity/enterprise-apps/app-management-powershell-samples but perhaps a little simpler.

One cmdlet that exports both certs and secrets for both app registrations and enterprise apps. Perhaps even the one that exports beyond the required date. The cmdlet would allow filtering and a date range. Something that is easy to schedule as well.

Get-MsIdCrossTenantAccessActivity returns invalid filter clause

Connect-MgGraph -Scopes AuditLog.Read.All
Get-MsIdCrossTenantAccessActivity -AccessDirection Inbound

Returns:
Line |
271 | … $SignIns = Get-MgAuditLogSignIn -Filter ("HomeTenantId ne …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Invalid filter clause

WARNING: 18:51:31 - No sign-ins matching the selected criteria found.

  • OS: WIN10
  • PowerShell Version: PowerShell 7.2
  • MS Graph SDK PowerShell Module Version: 1.9.3

image
image

Error thrown when executing Export-MsIdAppConsentGrantReport after the module update.

Hi @merill ,

When I execute the below command after updating the module, I get this error:

PS C:\WINDOWS\system32> Update-Module -Name MSIdentityTools -Force

PS C:\WINDOWS\system32> Import-Module MSIdentityTools -Force
WARNING: It is recommended to use this module with the latest version of PowerShell which can be downloaded here: https://aka.ms/install-powershell

PS C:\WINDOWS\system32> Export-MsIdAppConsentGrantReport -ReportOutputType ExcelWorkbook -ExcelWorkbookPath 'C:\TEMP\report.xlsx'
ForEach-Object : Parameter set cannot be resolved using the specified named parameters.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:3021 char:44
+ ... rincipals | ForEach-Object -AsJob -ThrottleLimit $ThrottleLimit -Para ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [ForEach-Object], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.ForEachObjectCommand
 
The property 'State' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:3042 char:16
+         while ($job.State -eq 'Running') {
+                ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict

Is this intentional or something that can be fixed?

image

Thank you.

Get-MsIdInactiveSignInUser fails to "Find-MgGraphCommand: 'Get-MgUser'"

Describe the bug

When Running the command "Get-MsIdInactiveSignInUser -LastSignInBeforeDaysAgo 60 -UserType Guest the function can't find the Get-MgUser command.

To Reproduce

I have installed the latest version (2.0.52) of MsIdentityTools and Microsoft.Graph.Users version 2.12.0
get-command get-MgUser

CommandType Name Version Source


Function Get-MgUser 2.12.0 Microsoft.Graph.Users

Steps to reproduce:
Run connect-MgGraph -Scopes "Application.Read.all","Directory.Read.All","User.Read.All"copes.
Run Get-MsIdInactiveSignInUser -LastSignInBeforeDaysAgo 60 -UserType Guest

Expected behavior

Output of Inactive Guest Users

Screenshots

image

Environment (please complete the following information)

  • Operating System: Windows 11
  • PowerShell Version: PowerShell 7.3.11 ]
  • MS Graph PowerShell SDK Module Version: 2.12.0

Change cmdlet name - Get-MsIdUnmanagedExternalUsers

Describe the bug
Get-MsIdUnmanagedExternalUsers needs to be changed to Get-MsIdUnmanagedExternalUser to adhere with nest practice

To Reproduce
N/A

Expected behavior
Cmdlet noun should not be plural

Screenshots
N/A

Environment (please complete the following information):
ALL

Additional context
Add any other context about the problem here.

Update wiki (deprication, addition)

MSIdentityTools.wiki\Cmdlets.md
| Get-MsIdInactiveSignInUser | (Deprecated) Retrieve Users who have not had interactive sign ins since XX days ago |
| Get-MsIdIsViralUser | Returns true if the user's mail domain is a viral (unmanaged) Azure AD tenant. To learn more about viral tenants see Take over an unmanaged directory as administrator in Azure Active Directory](https://docs.microsoft.com/azure/active-directory/enterprise-users/domains-admin-takeover) |

| Get-MsIdUnredeemedInvitedUser | Retrieve Users who have not had interactive sign ins since XX days ago |

| ConvertFrom-MsIdAzureAdImmutableId | (New) |
| ConvertFrom-MsIdSamlRequest | (New) |
| ConvertFrom-MsIdSamlResponse |(New) |
| Get-MsIdWsFedFederationMetadata | (New) |

MSIdentityTools.wiki\Get-MsIdInactiveSignInUser.md

Get-MsIdInactiveSignInUser (Deprecated)

MSIdentityTools.wiki\Get-MsIdUnmanagedExternalUsers.md

Get-MsIdUnmanagedExternalUsers (Deprecated)

MSIdentityTools.wiki\Get-MsIdUnredeemedInvitedUser.md

Get-MsIdUnredeemedInvitedUser (Deprecated)

MSIdentityTools.wiki\ConvertFrom-MsIdAzureAdImmutableId.md

ConvertFrom-MsIdAzureAdImmutableId (New)

MSIdentityTools.wiki\ConvertFrom-MsIdSamlRequest.md

ConvertFrom-MsIdSamlRequest (New)

MSIdentityTools.wiki\ConvertFrom-MsIdSamlResponse.md

ConvertFrom-MsIdSamlResponse (New)

MSIdentityTools.wiki\Get-MsIdWsFedFederationMetadata.md

Get-MsIdWsFedFederationMetadata (New)

The property 'State' cannot be found on this object. Verify that the property exists.

I receive the following when running the script. The script then stops running. It produces part of the Excel sheet only.

Please advise if there is something I need to do at my end to resolve this.

**

ForEach-Object : Parameter set cannot be resolved using the specified named parameters.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:3021 char:44

  • ... rincipals | ForEach-Object -AsJob -ThrottleLimit $ThrottleLimit -Para ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : MetadataError: (:) [ForEach-Object], ParameterBindingException
    • FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.ForEachObjectCommand

The property 'State' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:3042 char:16

  •     while ($job.State -eq 'Running') {
    
  •            ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict

**

Syntax error: character '%' is not valid at position 172

Describe the bug

When I run "Export-MsIdAzureMfaReport .\report.xlsx" I get following error:

Write-Error: Invalid filter clause: Syntax error: character '%' is not valid at position 172 in '(appid eq
'c44b4083-3bb0-49c1-b47d-974e53cbdf3c' or appid eq '04b07795-8ddb-461a-bbee-02f9e1bf7b46' or appid eq
'1950a258-227b-4e31-a9cf-717495945fc2') and status/errorcode%20eq%200%20&$top=1&$orderby=createdDateTime%20asc'.

To Reproduce

run "Export-MsIdAzureMfaReport .\report.xlsx"

Expected behavior

A report should be generated

Screenshots

If applicable, add screenshots to help explain your problem.

Environment (please complete the following information)

Windows 11
PS Version:
Major Minor Patch PreReleaseLabel BuildLabel


7 4 3

Check for dependencies and import required modules if not already present

Describe the bug
This module depends on some sub-modules of microsoft.graph, but does not seem to check whether those modules are present before using them.

To Reproduce
Steps to reproduce an example issue caused by not checking dependencies

  1. Launch Powershell 7
  2. Import-module Microsoft.Graph.Authentication
  3. connect-mggraph -scope user.readwrite.all
  4. get-unmanagedexternaluser
  5. Command returns error below due to a dependency on 'microsoft.graph.users'
    Unable to find type [Microsoft.Graph.PowerShell.Models.MicrosoftGraphUser1]

Expected behavior
The MSIdentityTools module should check for modules that it depends upon and import those modules if they aren't already. Ideally, this would check for and import only the specific modules or sub-modules required, and not mass import dozens of unnecessary modules by importing the parent microsoft.graph module.
Note that the documentation for the Microsoft.Graph module explicitly recommends against installing the entire microsoft.graph module, and to instead install only the specific sub-modules needed. This would also apply to which modules should be imported.

Consider adding a Requires statement listing the specific modules required. Alternatively, each function could include check for the modules it depends on within the function if the overall MSIdentityTools module would require many modules that most of the functions wouldn't need.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows
  • PowerShell 7.2.6
  • MS Graph SDK PowerShell Module Version 2.0.17

Get-MsIdGroupWritebackConfiguration : Additional scope needed

Getting the following error, even when running Connect-MgGraph with the permissions requested:

Get-MsIdGroupWritebackConfiguration : Additional scope needed, call Connect-MgGraph with one of the following scopes: Directory.Read.All, Directory.ReadWrite.All, Group.Read.All, Group.ReadWrite.All, GroupMember.Read.All

I tried connecting with all the scopes listed and just Group.ReadWrite.All and no matter what I would get that error.

Looking at the code for the cmdlet, lines 66-68 read:

if (!(Compare-Object $MgPermissions.Name -DifferenceObject $MgContext.Scopes -ExcludeDifferent)) {
    Write-Error "Additional scope needed, call Connect-MgGraph with one of the following scopes: $($MgPermissions.Name -join ', ')" -ErrorAction Stop
}

I would expect that if -ExcludeDifferent is used, then so should -IncludeEqual. I made that change locally and it is working.

Get-MsIdUnmanagedExternalUser, Does not check of Permission

Describe the bug
For the Command "Get-MsIdUnmanagedExternalUser" i get the following Error "403 Forbidden - Insufficient privileges to complete the operation".

To Reproduce
Steps to reproduce the behavior:

  1. Command 'Connect-MgGraph' (without any Permission, not sure waht is needed from wiki)
  2. Command 'Get-MsIdUnmanagedExternalUser'
  3. See error

Expected behavior
I would expect an error like in "Get-MsIdApplicationIdByAppId":
Test-MgCommand : Additional scope needed for command 'X', call Connect-MgGraph with one of the following scopes: Application.Read.All,
Application.ReadWrite.All, Directory.Read.All

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows
  • PowerShell Version: 5.1.22000.832
  • MS Graph SDK PowerShell Module Version: 1.7.0

Additional context
https://github.com/AzureAD/MSIdentityTools/wiki/Cmdlets --> Table is not shown fully

Missing information in results from Resolve-MsIdTenant using WPS 5.x

When running Resolve-MsIdTenant in Windows PowerShell 5.x, not all tenant details are returned and appears as null values.

It is recommended to use at least PowerShell 7.2 for running cmdlets in the MSIdentityTools module as there is limited support for testing in WPS 5.1 and will be best effort for supporting the earlier WPS versions.

get-msidunmanagedExternaluser Unable to find type [Microsoft.Graph.PowerShell.Models.MicrosoftGraphUser1]

In PS7 I got the following errors when running Get-MsIdUnmanagedExternalUser:

InvalidOperation: C:\Users****\PowerShell\Modules\MSIdentityTools\2.0.17\Get-MsIdUnmanagedExternalUser.ps1:64
Line |
64 | … [Microsoft.Graph.PowerShell.Models.MicrosoftGraphUser1]$u …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to find type [Microsoft.Graph.PowerShell.Models.MicrosoftGraphUser1].

InvalidOperation: C:\Users****\PowerShell\Modules\MSIdentityTools\2.0.17\Get-MsIdUnmanagedExternalUser.ps1:71
Line |
71 | $mail = Get-ObjectPropertyValue $user 'mail'
| ~~~~~
| The variable '$user' cannot be retrieved because it has not been set.

After explicitly importing the Users graph module, the type was recognized:

import-Module Microsoft.Graph.Users

Export-MsIdAppConsentGrantReport

Describe the bug

When running Export-MsIdAppConsentGrantReport there is the following error returned: PropertyNotFoundException: The property 'AdditionalProperties' cannot be found on this object. Verify that the property exists.

To Reproduce

Just ran the command.

Expected behavior

No errors.

Screenshots

image

Environment (please complete the following information)

  • Operating System: Windows 11
  • PowerShell Version: PowerShell 7.2

Additional context

NA

Unable to execute Find-MsIdUnprotectedUsersWithAdminRoles

Hi Microsoft Identity Team,

The Find-MsIdUnprotectedUsersWithAdminRoles cmdlet is not working, even after connecting to the MgGraph successfully:

PS C:\WINDOWS\system32> Connect-MgGraph
Welcome to Microsoft Graph!

Connected via delegated access using 14d82eec-204b-4c2f-b7e8-296a70dab67e
Readme: https://aka.ms/graph/sdk/powershell
SDK Docs: https://aka.ms/graph/sdk/powershell/docs
API Docs: https://aka.ms/graph/docs

NOTE: You can use the -NoWelcome parameter to suppress this message.


PS C:\WINDOWS\system32> Find-MsIdUnprotectedUsersWithAdminRoles -IncludeSignIns -Verbose #| Export-Csv -Path C:\Insecure.csv -NoTypeInformation
Find-MgGraphCommand : 'Get-MgUser' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2165 char:35
+ ... gCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $Ap ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand
 
Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2167 char:13
+             $MgCommand = $MgCommands[0]
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
 
The property 'Count' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2168 char:17
+             if ($MgCommands.Count -gt 1) {
+                 ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
The property 'Command' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2184 char:13
+             $MgCommandLookup[$MgCommand.Command] = $MgCommand
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
Find-MgGraphCommand : 'Get-MgUserAuthenticationMethod' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2165 char:35
+ ... gCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $Ap ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand
 
Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2167 char:13
+             $MgCommand = $MgCommands[0]
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
 
The property 'Count' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2168 char:17
+             if ($MgCommands.Count -gt 1) {
+                 ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
The property 'Command' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2184 char:13
+             $MgCommandLookup[$MgCommand.Command] = $MgCommand
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
Find-MgGraphCommand : 'Get-MgGroupMember' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2165 char:35
+ ... gCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $Ap ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand
 
Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2167 char:13
+             $MgCommand = $MgCommands[0]
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
 
The property 'Count' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2168 char:17
+             if ($MgCommands.Count -gt 1) {
+                 ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
The property 'Command' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2184 char:13
+             $MgCommandLookup[$MgCommand.Command] = $MgCommand
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
Find-MgGraphCommand : 'Get-MgRoleManagementDirectoryRoleDefinition' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2165 char:35
+ ... gCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $Ap ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand
 
Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2167 char:13
+             $MgCommand = $MgCommands[0]
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
 
The property 'Count' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2168 char:17
+             if ($MgCommands.Count -gt 1) {
+                 ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
The property 'Command' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2184 char:13
+             $MgCommandLookup[$MgCommand.Command] = $MgCommand
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
Find-MgGraphCommand : 'Get-MgRoleManagementDirectoryRoleAssignmentSchedule' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2165 char:35
+ ... gCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $Ap ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand
 
Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2167 char:13
+             $MgCommand = $MgCommands[0]
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
 
The property 'Count' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2168 char:17
+             if ($MgCommands.Count -gt 1) {
+                 ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
The property 'Command' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2184 char:13
+             $MgCommandLookup[$MgCommand.Command] = $MgCommand
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
Find-MgGraphCommand : 'Get-MgRoleManagementDirectoryRoleEligibilitySchedule' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2165 char:35
+ ... gCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $Ap ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand
 
Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2167 char:13
+             $MgCommand = $MgCommands[0]
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
 
The property 'Count' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2168 char:17
+             if ($MgCommands.Count -gt 1) {
+                 ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
The property 'Command' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2184 char:13
+             $MgCommandLookup[$MgCommand.Command] = $MgCommand
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
Find-MgGraphCommand : 'Get-MgAuditLogSignIn' is not a valid Microsoft Graph PowerShell command. Please check the name and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2165 char:35
+ ... gCommands = Find-MgGraphCommand -Command $CommandName -ApiVersion $Ap ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Find-MgGraphCommand
 
Cannot index into a null array.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2167 char:13
+             $MgCommand = $MgCommands[0]
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
 
The property 'Count' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2168 char:17
+             if ($MgCommands.Count -gt 1) {
+                 ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
The property 'Command' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2184 char:13
+             $MgCommandLookup[$MgCommand.Command] = $MgCommand
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
    + FullyQualifiedErrorId : PropertyNotFoundStrict
 
VERBOSE: Required Microsoft Graph Modules: 

Thank you in advance.

The term 'Get-MgServicePrincipalCount' is not recognized as the name of a cmdlet,"

Describe the bug

Hi,

I just ran this for the first time, running the latest version of MSIdentityTools.

Am I missing a dependency?

Running on Windows 10 with PS version 5.1

PS C:\temp> Install-Module -Name MSIdentityTools PS C:\temp> Install-Module -Name ImportExcel PS C:\temp> Connect-MgGraph -Scopes Application.Read.All Welcome to Microsoft Graph!

....

PS C:\temp> Export-MsIdAppConsentGrantReport -ReportOutputType ExcelWorkbook -ExcelWorkbookPath .\appaccess.xlsx

Get-MgServicePrincipalCount : The term 'Get-MgServicePrincipalCount' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2900 char:18

  •     $count = Get-MgServicePrincipalCount -ConsistencyLevel eventu ...
    
  •              ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Get-MgServicePrincipalCount:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

Get-MgServicePrincipal : The term 'Get-MgServicePrincipal' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2904 char:37

  •     $script:ServicePrincipals = Get-MgServicePrincipal -ExpandPro ...
    
  •                                 ~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Get-MgServicePrincipal:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

The variable '$script:ServicePrincipals' cannot be retrieved because it has not been set.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2971 char:29

  •     foreach ($client in $script:ServicePrincipals) {
    
  •                         ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (script:ServicePrincipals:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

The variable '$script:servicePrincipals' cannot be retrieved because it has not been set.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:3013 char:30

  •     $servicePrincipals = $script:servicePrincipals
    
  •                          ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (script:servicePrincipals:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

The variable '$script:servicePrincipals' cannot be retrieved because it has not been set.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:3021 char:16

  •     $job = $script:servicePrincipals | ForEach-Object -AsJob -Thr ...
    
  •            ~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (script:servicePrincipals:String) [], RuntimeException
    • FullyQualifiedErrorId : VariableIsUndefined

The property 'State' cannot be found on this object. Verify that the property exists.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:3042 char:16

  •     while ($job.State -eq 'Running') {
    
  •            ~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
    • FullyQualifiedErrorId : PropertyNotFoundStrict

An error occurred while retrieving app consent grants. Please try again.
At C:\Program Files\WindowsPowerShell\Modules\MSIdentityTools\2.0.52\MSIdentityTools.psm1:2891 char:13

  •         throw "An error occurred while retrieving app consent gra ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (An error occurr...ease try again.:String) [], RuntimeException
    • FullyQualifiedErrorId : An error occurred while retrieving app consent grants. Please try again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.