All Projects → microsoftgraph → Msgraph Sdk Powershell

microsoftgraph / Msgraph Sdk Powershell

Licence: other
Powershell SDK for Microsoft Graph

Programming Languages

powershell
5483 projects

Projects that are alternatives of or similar to Msgraph Sdk Powershell

Python O365
A simple python library to interact with Microsoft Graph and Office 365 API
Stars: ✭ 742 (+210.46%)
Mutual labels:  microsoft, graph
Spectral Trajectory And Behavior Prediction
This is the code base for Trajectory and Driver Behavior Prediction in Autonomous Vehicles using Spectral Graph Theory
Stars: ✭ 236 (-1.26%)
Mutual labels:  graph
Languageserver.jl
An implementation of the Microsoft Language Server Protocol for the julia language.
Stars: ✭ 223 (-6.69%)
Mutual labels:  microsoft
Azure Powershell
Microsoft Azure PowerShell
Stars: ✭ 2,873 (+1102.09%)
Mutual labels:  microsoft
Microsoft Todo Osx
Unofficial Microsoft ToDo app for MacOS
Stars: ✭ 227 (-5.02%)
Mutual labels:  microsoft
Multigraph transformer
transformer, multi-graph transformer, graph, graph classification, sketch recognition, sketch classification, free-hand sketch, official code of the paper "Multi-Graph Transformer for Free-Hand Sketch Recognition"
Stars: ✭ 231 (-3.35%)
Mutual labels:  graph
Userline
Query and report user logons relations from MS Windows Security Events
Stars: ✭ 221 (-7.53%)
Mutual labels:  graph
Azure Event Hubs
☁️ Cloud-scale telemetry ingestion from any stream of data with Azure Event Hubs
Stars: ✭ 233 (-2.51%)
Mutual labels:  microsoft
Git Deps
git commit dependency analysis tool
Stars: ✭ 232 (-2.93%)
Mutual labels:  graph
Unreal Polygonal Map Gen
An Unreal Engine 4 implementation of the Polygonal Map Generator for generating islands found at http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
Stars: ✭ 229 (-4.18%)
Mutual labels:  graph
Vworkflows
Flow Visualization Library for JavaFX and VRL-Studio
Stars: ✭ 226 (-5.44%)
Mutual labels:  graph
Cognitive Face Python
Python SDK for the Microsoft Face API, part of Cognitive Services
Stars: ✭ 226 (-5.44%)
Mutual labels:  microsoft
Api Management Developer Portal
Azure API Management developer portal.
Stars: ✭ 229 (-4.18%)
Mutual labels:  microsoft
Cleanmgrplus
🐾 A Improved Replacement for Microsoft Disk Cleanup
Stars: ✭ 224 (-6.28%)
Mutual labels:  microsoft
Detours
Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form.
Stars: ✭ 3,130 (+1209.62%)
Mutual labels:  microsoft
Ngraph.path
Path finding in a graph
Stars: ✭ 2,545 (+964.85%)
Mutual labels:  graph
Awesome Dotnet Core
🐝 A collection of awesome .NET core libraries, tools, frameworks and software
Stars: ✭ 15,483 (+6378.24%)
Mutual labels:  microsoft
Euler
A distributed graph deep learning framework.
Stars: ✭ 2,701 (+1030.13%)
Mutual labels:  graph
Checkedc
Checked C is an extension to C that lets programmers write C code that is guaranteed by the compiler to be type-safe. The goal is to let people easily make their existing C code type-safe and eliminate entire classes of errors. Checked C does not address use-after-free errors. This repo has a wiki for Checked C, sample code, the specification, a…
Stars: ✭ 2,692 (+1026.36%)
Mutual labels:  microsoft
Graphnn
Training computational graph on top of structured data (string, graph, etc)
Stars: ✭ 235 (-1.67%)
Mutual labels:  graph

Microsoft Graph PowerShell SDK

The Microsoft Graph PowerShell SDK is a collection of PowerShell modules that contain commands for calling Microsoft Graph service.

Modules

The table below contains our Microsoft Graph rollup module. This module installs all the service modules as its dependencies. Description | Module Name | PowerShell Gallery Link ----------------- | ----------------- | ------------------------ Microsoft Graph | Microsoft.Graph | Mg

For a list of modules found in this repository, see the Microsoft Graph PowerShell modules document.

Installation

PowerShell Gallery

All the modules are published on PowerShell Gallery. Installing is as simple as:

Install-Module Microsoft.Graph

If you are upgrading from our preview modules, run Install-Module with AllowClobber and Force parameters to avoid command name conflicts:

 Install-Module Microsoft.Graph -AllowClobber -Force

There is a set of samples in the samples folder to help in getting started with the library. If you have an older version of these modules installed, there are extra uninstall instructions in the InstallModule script.

Usage

  1. Authentication

    The SDK supports two types of authentication: delegated access, and app-only access.

    • Delegated access via Device Code Flow.

      Connect-MgGraph -Scopes "User.Read.All", "Group.ReadWrite.All"
      
    • App-only access via Client Credential with a certificate.

      The certificate will be loaded from Cert:\CurrentUser\My\ store. Ensure the certificate is present in the store before calling Connect-MgGraph.

      You can pass either -CertificateThumbprint or -CertificateName to Connect-MgGraph.

      # Using -CertificateThumbprint
      Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateThumbprint "YOUR_CERT_THUMBPRINT"
      

      or

      # Using -CertificateName
      Connect-MgGraph -ClientId "YOUR_APP_ID" -TenantId "YOUR_TENANT_ID" -CertificateName "YOUR_CERT_SUBJECT"
      
  2. List users in your tenant.

    Get-MgUser -Top 10 -Property Id, DisplayName, BusinessPhones | Format-Table Id, DisplayName, BusinessPhones
    
  3. Filter a user in your tenant.

    $user = Get-MgUser -Filter "displayName eq 'Megan Bowen'"
    
  4. Create a new app registration.

    New-MgApplication -DisplayName "ScriptedGraphPSApp" `
                      -SignInAudience "AzureADMyOrg" `
                      -Web @{ RedirectUris = "https://localhost"}
    
  5. Sign out of the current logged-in context i.e. app only or delegated access.

    Disconnect-MgGraph
    

API Version

By default, the SDK uses the Microsoft Graph REST API v1.0. You can change this by using the Select-MgProfile command. This reloads all modules and only loads commands that call beta endpoint.

Select-MgProfile -Name "beta"

Troubleshooting Permission Related Errors

When working with various operations in the Graph, you may encounter an error such as "Insufficient privileges to complete the operation." For example, this particular error can occur when using the New-MgApplication command if the appropriate permissions are not granted.

If permission related errors occur and the user you authenticated with in the popup has the appropriate permissions to perform the operation try these steps.

  • You can try running Disconnect-MgGraph, then Connect-MgGraph. Then, run the code that encountered the permission issues to see if it works.
  • You can try running Connect-MgGraph -ForceRefresh. This will trigger a refresh of the access token in your cache. MSAL will only refresh the access token in your cache if it has expired (usually an hour), or if you explicitly refresh it via -ForceRefresh. Then, run the code that encountered the permission issues to see if it works.

Known Issues

  • If you attempt to run Connect-Graph from the PowerShell ISE (integrated scripting environment) the command fails with an error "Device code terminal timed-out after {X} seconds". This is a known issue and it is recommended to use a PowerShell host other than the ISE.

Issues

If you find any bugs when using the Microsoft Graph PowerShell modules, please file an issue in our GitHub issues page.

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.

License

Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].