Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > Calling Microsoft Graph with PnP PowerShell
April 15
Calling Microsoft Graph with PnP PowerShell

As an M365 Admin it’s not tough to see that the future is hidden somewhere in the Microsoft Graph. And this particular M365 Admin would like to get there using his favorite tool, PowerShell. Microsoft released the Graph SDK, but it didn’t really scratch the itch for me. I found it confusing and really tough to use. But, as much as I ignored it, the Graph didn’t go away. With increased frequency there would be some little tidbit of information I’d want and the answer would be, “It’s in the Graph.” Grrrrr.

I was poking the M365 PnP Samples and stumbled across this little gem, Authenticate with and call the Microsoft Graph. That looked promising, I can work with that. I fired up PowerShell, loaded the PnP.PowerShell, fired up the Graph Explorer and started working.

It went well enough that I wrote a little wrapper function around it and published it to GitHub. It’s called Get-TKPnPGraphURI and it looks like this:

image

Get-TKPnPGraphURI -uri https://graph.microsoft.com/v1.0/me/

Get-TKPnPGraphURI -uri https://graph.microsoft.com/v1.0/users | select displayName,userPrincipalName,id

It uses PnP.PowerShell, so you’ll need that module installed, and you’ll need to connect with Connect-PnPOnline. From there you can pass it any Graph endpoint, v1.0 or beta. You can find out what the endpoints are at the Graph Explorer.  Right now this only supports Gets. You’ll also have to manually put in any parameters or filters. I’ve added help and examples. I hope to expand them both in the future.

The output is a stand PSCustomObject, so you can send its output down the pipeline however you’d like. Select-Object, Where-Object, Sort-Object, the world is your oyster.

Let me know if this is useful and what you’re doing with it.

tk

ShortURL: https://www.toddklindt.com/PoshMSGraph

Comments

test

เขาอธิบายว่า "ภูมิประเทศแตกต่างกัน" ใน Donbas ดังนั้น "ยุทธวิธีของกองกำลังรัสเซีย (ต่างกัน)" เขาเสริมว่าจำเป็นต้องมีความช่วยเหลือทางการเงินและการฝึกทหารด้วย PGSLOT ด้วยเหตุผลสำคัญที่อยากจะแนะนำสำหรับหน้าใหม่ที่ทุกท่านกำลังสนใจให้การลงทุนกับสล็อตออนไลน์ <a href="https://pgslot.cz" rel="dofollow"> PGSLOT </a>
 on 4/25/2022 11:54 AM

test

องค์การเพื่อความมั่นคงและความร่วมมือในยุโรป (OSCE) กำลังทำงานเพื่อ "อำนวยความสะดวกในการปล่อยตัว" สมาชิกภารกิจเฝ้าติดตามพิเศษ (SMM) หลายคนซึ่งถูก "ลิดรอนเสรีภาพในโดเนตสค์และลูฮันสค์" กล่าวเมื่อวันอาทิตย์ เกมสล็อตออนไลน์ บทความ รูปแบบใหม่ 2021 ต้อนรับผู้เล่น ล่าฝันรุ่นใหม่ https://ambbet.zone
 on 4/25/2022 11:54 AM

test

“OSCE มีความกังวลอย่างยิ่งว่าสมาชิกภารกิจระดับชาติของ SMM จำนวนหนึ่งถูกลิดรอนเสรีภาพในโดเนตสค์และลู่หานสค์” กล่าวในแถลงการณ์ที่โพสต์บน Twitter "OSCE ใช้ช่องทางที่มีอยู่ทั้งหมดเพื่ออำนวยความสะดวกในการปล่อยตัวพนักงาน" มีเกมส์ต่างๆ มากมายเปิดให้ บริการผ่านทางแอพลิเคชัน และบนเว็บ https://slot-pg.com
 on 4/25/2022 11:54 AM

jokwe123

A mobile online slots game provider with a variety of games to choose from. It is a new type of game that allows players to win real money. [url= https://my-joker123.me/%E0%B8%AA%E0%B8%A5%E0%B9%87%E0%B8%AD%E0%B8%95%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%94%E0%B8%B4%E0%B8%95%E0%B8%9F%E0%B8%A3%E0%B8%B5-%E0%B8%A5%E0%B9%88%E0%B8%B2%E0%B8%AA%E0%B8%B8%E0%B8%94/ ]เครดิตฟรี[/url]  easy game play There is a tutorial on how to play online slots games for beginners. Beautiful graphics in every game Make it not boring and exciting with unique in-game effects. Become a new millionaire with the most frequent jackpot online slots game. Even small bets get rewards.
 on 5/9/2022 12:56 AM

Joker123

The camp https://pglucky789.com is popular right now. Because it's easy to play, it's fun to play, adventure, challenge, joker and many games. Easy to apply for membership with us, get free credits, free bonuses anytime, anywhere in top-up. There are promotions for both new and old members.
 on 5/10/2022 11:42 PM

Bangalore Escorts

 on 5/14/2022 12:09 AM

Escorts in Bangalore

 on 5/14/2022 12:10 AM

Escorts Service in Bangalore

 on 5/14/2022 12:10 AM

Independent Escorts in Bangalore

This is particularly overwhelming. I'm totally especially astoundingly in standard talking around fulfilled to the point that you have shared this central electronic diary post. Continue to post


https://www.thebangaloreescorts.in/escorts/gwalior.html
https://www.thebangaloreescorts.in/escorts/coimbatore.html
https://www.thebangaloreescorts.in/escorts/guntur.html
https://www.thebangaloreescorts.in/escorts/howrah.html
https://www.thebangaloreescorts.in/escorts/hubli-dharwad.html
 on 5/14/2022 12:11 AM

Independent Call Girls in Bangalore

Article. I like it. The maker of this post solid region for figures for truly for head for out for good 'old worked solid district for with for ensured for major for never for endingly no plans. I appreciate for posting.

https://www.thebangaloreescorts.in/escorts/jabalpur.html
https://www.thebangaloreescorts.in/escorts/jalandhar.html
https://www.thebangaloreescorts.in/escorts/jalgaon.html
https://www.thebangaloreescorts.in/escorts/kalyan-dombivli.html
https://www.thebangaloreescorts.in/escorts/kota.html
 on 5/14/2022 12:11 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 SysKit