Giter Club home page Giter Club logo

msidentitytools's Introduction

PSGallery Version PSGallery Downloads PSGallery Platform

The Microsoft Identity Tools PowerShell module provides various tools for performing enhanced Identity administration activities. It is intended to address more complex business scenarios that can't be met solely with the use of MS Graph PowerShell SDK module.

What is contained in the MSIdentityTools module?

A collection of cmdlets that use the MS Graph SDK PowerShell module to simplify common tasks for administrators of Azure AD tenants.

How do I install the module?

The module can be found and installed from the PowerShell gallery at PowerShell Gallery: MSIdentity Tools or can be downloaded from the releases page on this repo.

What are the cmdlets in this module?

View the latest list of cmdlets on the cmdlet summary page.

Command Synopsys
Add-MsIdServicePrincipal Create service principal for existing application registration
Confirm-MsIdJwtTokenSignature Validate the digital signature for JSON Web Token.
ConvertFrom-MsIdAadcAadConnectorSpaceDn Convert Azure AD connector space object Distinguished Name (DN) in AAD Connect
ConvertFrom-MsIdAadcSourceAnchor Convert Azure AD Connect metaverse object sourceAnchor or Azure AD ImmutableId to sourceGuid.
ConvertFrom-MsIdJwtToken Convert Msft Identity token structure to PowerShell object.
ConvertFrom-MsIdSamlMessage Convert SAML Message structure to PowerShell object.
ConvertFrom-MsIdUniqueTokenIdentifier Convert Azure AD Unique Token Identifier to Request Id.
Expand-MsIdJwtTokenPayload Extract Json Web Token (JWT) payload from JWS structure to PowerShell object.
Export-MsIdAppConsentGrantReport Lists and categorizes privilege for delegated permissions (OAuth2PermissionGrants) and application permissions (AppRoleAssignments).
Find-MsIdUnprotectedUsersWithAdminRoles Find Users with Admin Roles that are not registered for MFA
Get-MsIdAdfsSamlToken Initiates a SAML logon request to and AD FS server to generate log activity and returns the user token.
Get-MsIdAdfsSampleApp Returns the list of availabe sample AD FS relyng party trust applications available in this module. These applications do NOT use real endpoints and are meant to be used as test applications.
Get-MsIdAdfsWsFedToken Initiates a Ws-Fed logon request to and AD FS server to generate log activity and returns the user token.
Get-MsIdAdfsWsTrustToken Initiates a Ws-Trust logon request to and AD FS server to generate log activity and returns the user token.
Get-MsIdApplicationIdByAppId Lookup Application Registration by AppId
Get-MsIdAuthorityUri Build Microsoft Identity Provider Authority URI
Get-MsIdAzureIpRange Get list of IP ranges for Azure
Get-MsIdCrossTenantAccessActivity Gets cross tenant user sign-in activity
Get-MsIdGroupWithExpiration Return groups with an expiration date via lifecycle policy.
Get-MsIdGroupWritebackConfiguration Gets the group writeback configuration for the group ID
Get-MsIdHasMicrosoftAccount Returns true if the user's mail is a Microsoft Account
Get-MsIdInactiveSignInUser 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.
Get-MsIdMsftIdentityAssociation Parse Microsoft Identity Association Configuration for a Public Domain (such as published apps)
Get-MsIdO365Endpoints Get list of URLs and IP ranges for O365
Get-MsIdOpenIdProviderConfiguration Parse OpenId Provider Configuration and Keys
Get-MsIdProvisioningLogStatistics Get Statistics for Set of Azure AD Provisioning Logs
Get-MsIdSamlFederationMetadata Parse Federation Metadata
Get-MsIdServicePrincipalIdByAppId Lookup Service Principal by AppId
Get-MsIdSigningKeyThumbprint Get signing keys used by Azure AD.
Get-MsIdUnmanagedExternalUser Returns a list of all the external users in the tenant that are unmanaged (viral users).
Get-MsIdUnredeemedInvitedUser Retrieve Users who have not had interactive sign ins since XX days ago
Import-MsIdAdfsSampleApp Imports a list availabe sample AD FS relyng party trust applications available in this module, the list is created by the Get-MsIdAdfsSampleApps cmdlet. These applications do NOT use real endpoints and are meant to be used as test applications.
Import-MsIdAdfsSamplePolicy Imports the 'MsId Block Off Corp and VPN' sample AD FS access control policy. This policy is meant to be used as test policy.
Invoke-MsIdAzureAdSamlRequest Invoke Saml Request on Azure AD.
New-MsIdClientSecret Generate Random Client Secret for application registration or service principal in Azure AD.
New-MsIdSamlRequest Create New Saml Request.
New-MsIdTemporaryUserPassword Generate Random password for user in Azure AD.
New-MsIdWsTrustRequest Create a WS-Trust request.
Reset-MsIdExternalUser Resets the redemption state of an external user.
Resolve-MsIdAzureIpAddress Lookup Azure IP address for Azure Cloud, Region, and Service Tag.
Resolve-MsIdTenant Resolve TenantId or DomainName to an Azure AD Tenant
Revoke-MsIdServicePrincipalConsent Revoke Existing Consent to an Azure AD Service Principal.
Set-MsIdServicePrincipalVisibleInMyApps Toggles whether application service principals are visible when launching myapplications.microsoft.com (MyApps)
Set-MsIdWindowsTlsSettings Set TLS settings on Windows OS to use more secure TLS protocols.
Show-MsIdJwtToken Show Json Web Token (JWT) decoded in Web Browser using diagnostic web app.
Show-MsIdSamlToken Show Saml Security Token decoded in Web Browser using diagnostic web app.
Split-MsIdEntitlementManagementConnectedOrganization Split elements of a connectedOrganization
Test-MsIdAzureAdDeviceRegConnectivity Test connectivity on Windows OS for Azure AD Device Registration
Test-MsIdCBATrustStoreConfiguration Test & report for common mis-configuration issues with the Entra ID Certificate Trust Store
Update-MsIdApplicationSigningKeyThumbprint Update a Service Princpal's preferredTokenSigningKeyThumbprint to the specified certificate thumbprint
Update-MsIdGroupWritebackConfiguration Update an Azure AD cloud group settings to writeback as an AD on-premises group

Support

For issues, questions, and feature requests please review the guidance on the Support page for this project for filing issues.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

msidentitytools's People

Contributors

bohrenan avatar cblomart avatar f4rty avatar jazuntee avatar jeftek avatar keithbrewer-msft avatar marcusca10 avatar markmorow avatar markwahl-msft avatar masontorres avatar matthewjlevy avatar mattimustang avatar merill avatar microsoft-github-operations[bot] avatar microsoftopensource avatar muddermanden avatar ramihaly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msidentitytools's Issues

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

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.

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

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.

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

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

**

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

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-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.

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.

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)

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

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

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.

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.

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

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.