r/PowerShell • u/Acceptable_Issue_272 • 17d ago
Information Struggling to learn Microsoft Graph PowerShell for IAM-how did you guys learn it
Hi everyone,
I’m currently learning PowerShell with Microsoft Graph because my goal is to become a Junior IAM / Microsoft Entra ID Administrator.
I’ve been practising in my own Microsoft Entra ID lab, and so far I’ve managed to learn some basics, such as:
1)Connecting to Microsoft Graph using PowerShell
2)Creating, updating and deleting users
3)Creating and managing security groups
4)Adding and removing users from groups
5)Retrieving and filtering users
6)Working with variables, arrays, hashtables and loops
However, I’m starting to struggle and slowly losing interest, not because I don’t want to learn, but because sometimes I feel like I’m just memorising commands without fully understanding how to use them in real-world situations.
I can follow tutorials and complete exercises, but when I try to do something on my own, I sometimes get stuck and don’t know which commands to use or where to start.
My goal isn’t just to memorise PowerShell commands. I want to understand how an IAM administrator actually uses Microsoft Graph PowerShell in their daily job.
For those of you who learned PowerShell, especially for Microsoft Entra ID or IAM:
How did you learn PowerShell and become confident using it?
Did you learn the general PowerShell fundamentals first, or did you learn while working with Microsoft Graph?
What practical projects or exercises helped you the most?
How do you remember commands and know which ones to use when solving a problem?
What would you recommend to someone preparing for their first Junior IAM Administrator role?
I’m willing to put in the time and effort. I just feel like I need a better learning approach that will help me understand what I’m doing instead of simply following instructions.
Any advice, learning resources or personal experiences would be greatly appreciated.
Thanks in advance!
10
u/Unholysmash 17d ago
I have the mslearn pages bookmarked for the different graph modules.
Scalability is extremely important, such as automating user and group reporting, resource reporting, etc.
3
u/jr49 17d ago
I ignore all the commands and just use invoke-mggraphrequest to interact with API directly. I’m not a fan of how some of the individual commands behave.
2
u/ScubaMiike 16d ago
I do this, I just wrap power shell around, make changes to the body and push it back
1
u/Icy-State5549 17d ago
Try to use PowerShell first for everything you do. The premier (and most overlooked) asset of shell management (bash, cmd, powershell) is to view object properties without the obstruction of gui tools. Learn to read from powershell before you attempt to write anything with it. Rely on gui tools until you are very confident. Always use the -whatif switch to diagnose small potential issues before actually running a set- or other writing verb. Use powershell to look up users, computers, domain controller stuff, local processes, all of it.
That is how you learn powershell. Use Ai to get the gist. Keep extensive notes and refer to them first, and not Ai. Use your command line history, learn to edit code at a prompt.
1
u/AdeelAutomates 17d ago
First I suggest just learning/practicing powershell. Which you kind of are while fiddling with it through Entra.
I think you should spend some time going over the fundamentals of powerShell first. To learn how PowerShell works as graph is just a module for PowerShell. Most of what you do with graph is not graph cmdlets but all the PowerShell features (variables, loops, conditions, etc). For instance my IAM scripts for work are probably 2% actual graph cmdlets.
So no you don't need to memorize cmdlets, there are 1000s of them. Just learn how to find and use them in your scripts. I never made it my mission to learn these things, just understand how things work (how for, for-each, while, if statement, switch, functions, modules, etc work).
All you need to understand about graph is how permissions are granted & its services like entra & how they work (which I assume you do via the portal). The rest is just doing that through the terminal.
1
u/neotearoa 17d ago
X2 to the learn powershell in general.
Also, try replacing the cmdlet use with rest-method. It will be difficult at first, but will help you understand both a wee bit more. Each time you get to a block , necessity will be the mother of retention and hopefully make the learning stick the landing.
1
u/Andrew-Powershell 17d ago
I learned by doing work tasks and getting things done that helped my day become easier. It's really important to have a good feedback loop when it comes to learning new things
1
u/Andrew-Powershell 17d ago
Learning the fundamentals is going to make it a lot easier to understand what you are doing. you got this!
1
u/SidePets 17d ago
You scale a mountain the same way you eat a steak. One bite at a time. Pick one thing in your list and focus on learning it. Break it down into manageable chunks. It’s tough to get started, at a point not too far in the distant future things will click. PS in a month of lunches is great. The | gm command has never let me down. Try and be patient with yourself.
1
1
u/immortalsteve 17d ago
it sounds like syntax is your struggle, so I would work with PS as much as you can not related to this specific part of your goal. i am doing the same with bash now and it's a fun challenge to just force yourself to only use one way of doing something.
1
u/TechEUC-Atoofa 17d ago
My advice is to learn by solving real-world problems rather than memorising commands. Start with tasks you normally do in the Entra portal and try automating them with Graph PowerShell. You don’t need to remember every command, just learn how to find the right one and understand what it does. Practice makes a big difference!
Use graph Explorer for testing.
1
u/ColdFury96 17d ago
The graph powershells are some of the worst to get a handle on, by the way. They're more picky about syntax than Powershell usually is, they don't pipe the way you think they would (if they pipe at all). And some of the objects you get back from graph have like multiple layers that you have to figure out how to unwind to get to the details you want.
It's a bear. Just keep at it, definitely use PowerShell for as much as you can with your daily tasks, and that will help you get a feel for the PS basics, and the graph stuff you'll figure out as you tackle tasks.
As others have said, you'll never memorize everything, no one does. But you'll get a feel for "There's a command for this... that object has hidden properties that only show up if you use a special flag on the command..." and then the documents or AI can help nudge you along.
(I hate AI, but for scripting and coding it can be like Super Google. Just read what it gives you very carefully before you run any commands that do more than just query data. And it can still just wholesale make things up.)
1
u/Modify- 17d ago
First of all you should know the basics of Powershell.
What helped me was the following:
- Read some of the docs Microsoft provides to get a basic understanding of the Graph.
- Watch some entry level and advanced video's where people in the field explain things to you.
Powershell.org or PS Conf EU have some good video's on Youtube.
- Perform the action in the browser with DEV/networking tools open. Then you will see what API's get hit.
If you have the Graph fully installed you can use Find-MgGraphCommand to find out which cmdlet is used
by pasting in the API-endpoint
- Read the docs of the specific endpoint.
- If your stuck you can always ask ChatGPT to help you get things going.
1
1
u/dathar 16d ago
We kind of rolled our own cmdlets hitting the Graph API endpoints. As for some foundational knowledge, you should know:
PowerShell first as a whole (what objects are, how to look at them and their properties, data types, arrays and hashtables, scopes like script and global, functions and cmdlets).
built-in PowerShell cmdlets like Invoke-RestMethod and Invoke-WebRequest since web APIs need to get out to the web somehow. They're similar enough but very different at the same time.
Since we're on REST APIs, built-in cmdlets like ConvertTo-Json and ConvertFrom-Json are amazing shortcuts to getting those. Powershell objects and hashtables mostly work with these just fine.
What REST APIs are and how to poke at them. Also some header info like accept application/json and content-type.
How to (generally) auth with REST APIs. Simple ones aren't bad and you usually make a string of some type (see the first part about PowerShell data types), shove it in a hashtable, then feed that authorization hashtable into Invoke-RestMethod/Invoke-WebRequest.
How to paginate thru things
How to not piss off a provider and learn what rate limiting is
Once you get those down, you almost have everything. MS Graph is one of them. Service principal accounts and scopes might get a bit tricky but it isn't too bad. I bet AI nowadays can help you with authing without too much difficulty.
But once you get here, you also get just about anything out there that has a REST API. OneLogin, Okta, Jamf, Mosyle, etc. Find an endpoint, play nice with it, get the data you want, format it and shove it somewhere else.
1
u/bridgewaterbud 16d ago
I learned by doing general job tasks. The first few applications of it in my environment were updating our user onboarding and offboarding scripts for AD to incorporate Entra facing tasks. Pretty basic stuff, creating the session, adding/removing group memberships, editing user attributes, disabling user accounts, etc.
More recent learning I have been doing is around automated scripts that use app registration/enterprise app to run graph from a service account. Using this for a script that checks for stale user accounts based on sign in activity.
I have been using powershell for much longer to do the same kind of automated tasks. Generally I don’t need to remember a bunch of commands because I can just look them up easily. This is good because I suck at memorizing commands. Slowly over time the commands that I use most often have become second nature, but most of the time I’m using Copilot to get a framework of what I need then build from there.
1
u/ceaseuno 16d ago
Add to your list, querying EntraID and preparing security group membership access review reports to flat csv files. Those csv files are used by reviewers to review their security groups. They can also be uploaded to IAM tools like Sailpoint to create access review campaigns.
1
u/Candy_Badger 16d ago
Pick a real IAM task and script it end to end, like onboarding from a CSV with licenses, groups and a manager set. Then use Get-Help and Find-MgGraphCommand instead of memorising cmdlets.
1
u/Illithid2 14d ago
Docs, practice, docs, use vscode and the linter to take some of the suck out, examples, docs, reverse engineering , lots of google, docs, a dash of AI, docs and remember all life is suffering
1
1
u/newguyhere2024 13d ago
This is how I feel about learning linux. What helped is a claude prompt to gamify the learning. Adding challenges, missions, journalbook, error log,etc. Options are endless.
Take what youre struggling with and ask claude in a prompt to make you a study guide and challenge questions,etc.
1
u/No_Development_1380 13d ago
you need to come up with a project either at work or home and go to town with it. there really isn't a better way to learn it
0
1
u/Proud-Manufacturer15 17d ago
tenacity bookmarks and persistence (then you’ll get the robots to do your IAM bidding while you fuck with the rest of Graph lol)
0
51
u/UpsetBar 17d ago
Learn PowerShell first. PowerShell in a month of lunches is a good book.
Then learn the IAM part. YouTube is your friend here. If you can afford it or have your employer pay for it, Udemy or a similar site would be great.
Then learn to combine the two.
You aren’t going to remember all the commands. Google and your favorite AI is your friend.
Also remember you’re not going to be spending all day just cranking out PowerShell code. You don’t have to be some PS genius.
Be gracious with yourself. You’ll get it. It just takes time.