What do they mean?

Marin Marinov 161 Reputation points
2023-12-22T16:56:56.3066667+00:00

Hi everyone,

After reading "Microsoft Graph PowerShell overview" I got very confused. After asking Google for clarification I got even more confused. I hope you can help me understand better a few things.

What is an API?

What is a Rest API?

What is Microsoft Graph PowerShell SDK?

What PowerShell module should I use for creating Microsoft 365 group?

Thank you in advance!

Marin

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. Azar 31,600 Reputation points MVP Volunteer Moderator
    2023-12-23T17:39:16.8966667+00:00

    Hi

    Sure let me break it up to you one by one

    API- , yes I wont explain the abbreviation, as that's no big deal.

    API is a set of rules and tools that allows one software application to interact with another. APIs define how different software components should interact meaning how they communicate.

    Example: Think of a restaurant as a system. The menu is like an API - it defines what dishes you can order and what information (ingredients, price) you'll get in return. its gets the info

    REST API?

    It is an architectural style for designing networked applications. RESTful APIs use standard HTTP methods (GET, POST, PUT, DELETE) to perform actions on resources.

    Example: Imagine a library system where you can GET a list of books, POST a new book, PUT to update a book, or DELETE to remove a book. Each book is a resource identified by a unique URL, like you own the library you can do these things like put meaning creating update meaning changing something there delete meaning deleting the book from the library.

    Microsoft Graph PowerShell SDK?

    The Microsoft Graph PowerShell SDK is a set of PowerShell cmdlets that simplify interactions with Microsoft Graph APIs. Microsoft Graph is the API endpoint that allows you to access data and functionality across Microsoft 365 services.

    Example: Let's say you want to retrieve a list of your Microsoft 365 users. Instead of crafting HTTP requests, you can use the Microsoft Graph PowerShell SDK. In PowerShell: just drop a few commands to get the list

    # Install the module (if not already installed)
    Install-Module -Name Microsoft.Graph
    
    # Connect to Microsoft Graph
    Connect-MgGraph -Scopes "User.Read"
    
    # Get a list of users
    Get-MgUser
    
    
    

    What PowerShell module should I use for creating a Microsoft 365 group?

    For creating Microsoft 365 groups, you can use the AzureAD module or the MSOnline module. These modules provide cmdlets for managing Azure Active Directory resources.

    AD below

    # Install the module (if not already installed)
    Install-Module -Name Az
    
    # Connect to Azure AD
    Connect-AzAccount
    
    # Create a new Microsoft 365 group
    New-AzADGroup -DisplayName "MyGroup" -MailNickname "MyGroup" -Description "My Group Description" -SecurityEnabled $true -MailEnabled $true
    
    

    MSonline below

    # Install the module (if not already installed)
    Install-Module -Name MSOnline
    
    # Connect to Azure AD
    Connect-MsolService
    
    # Create a new Microsoft 365 group
    New-MsolGroup -DisplayName "MyGroup" -Description "My Group Description" -GroupType "Unified"
    
    
    

    Hope this helps you, kindly accept the answer if this helps.


1 additional answer

Sort by: Most helpful
  1. Marin Marinov 161 Reputation points
    2023-12-26T14:38:33.4833333+00:00

    Hello Azar, according to my research "MSOnline" and "Az" are retired and we should use "Microsoft.Graph" for Microsoft 365 administration. Unfortunately, Microsoft did not take proper care of the documentation and it`s very easy to get confused like I was. After an additional research, I found this article. Which explains what I was looking for plus the current limitations of "Microsoft.Graph".

    Do you know what is the deference between the old modules and Microsoft.Graph?

    By the way, your explanation of the REST API is the best one I read so far.


Your answer

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