How to know what modules to install and what service to connect to?

ISD Admin 21 Reputation points
2022-07-28T00:47:33.45+00:00

We are managing many users in various MS Office 365 tenant accounts and find PowerShell a VERY useful tool...BUT...it is without a doubt the MOST FRUSTRATING application to use!! There are a hundred (plus?) modules and I never know how to find them. Here's our frustration and where we need assistance.

We need to update the authentication phone method for users on MFA. We found this nice commandlet New-MgUserAuthenticationPhoneMethod . Except the command is not found! We eventually discovered this module Microsoft.Graph.Identity.SignIns -RequiredVersion 1.0.1 and installed it (this is apparently where that command lived) but it's not found when we try to run it. Is there a different CONNECT- command we need to use?

And WHERE is the document that lists all these modules and their dependencies and connections? This is the frustrating part of using PowerShell to manage networks.

ANY help is appreciated!

Exchange | Exchange Server | Management
Microsoft Security | Microsoft Entra | Other
0 comments No comments
{count} votes

Accepted answer
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2022-07-28T03:31:48.823+00:00

    Hello @ISD Admin , we're sorry for the confusion. The Microsoft Graph PowerShell SDK contains 38 sub-modules, this due the number of different resources, workloads and features supported.

    The New-MgUserAuthenticationPhoneMethod command is available but only when targeting the beta endpoint. In order to do that you need to run the following script:

       Select-MgProfile -Name "beta"  
    

    If that does not work install the latest version of the Microsoft Graph PowerShell SDK. It's always a good idea to first uninstall any SDK and re-install it. If any problem arises, and a last resort, you can manually remove them:

       dir "C:\Program Files\WindowsPowerShell\Modules\Microsoft.Graph*"|Remove-Item -Force -Recurse  
    

    You will find documentation for all commands under the Reference menu in the MS Graph PowerShell docs.

    Documentation is getting evolved on a regularly basis. If you need more detail about a command/operation, the resources involved or samples, you can take a look to the Microsoft Graph REST API v1.0 endpoint reference in tandem with Using Find-MgGraphCommand cmdlet and Using Find-MgGraphPermission cmdlet.

    Finally, you can always mention me in any of your MS Graph related questions.

    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.


1 additional answer

Sort by: Most helpful
  1. KyleXu-MSFT 26,396 Reputation points
    2022-07-28T07:35:56.47+00:00

    @ISD Admin

    There doesn't exist an article which list all commands and the module that need to imported.

    Here are suggestion from Exchange side:

    If you want to run a command, you could search it in the Microsoft technical documentation
    225644-1.png

    Then you will could find detailed information for this command, such as which module this command contained in:
    225682-2.png

    You can also find other command which contained in this module.

    If you want to run any command, search in Microsoft technical documentation first, then you will know which module that you need to import.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.