I'm a beginner trying to understand how to perform a bulk upload to a 365 group using Powershell. I come across commands like Connect-AzureAD, Connect-ExchangeOnline, and Connect-MgGraph, but I'm unsure which service I should connect to for this task. If my question seems too basic, I apologize!
3 Answers
First off, a 365 group is essentially a collection of users in Microsoft Entra, and a bulk upload usually means adding multiple users to that group at once. Just so you know, Connect-AzureAD is outdated now, so definitely use Connect-MgGraph instead. This is your go-to for most tasks including user management. ExchangeOnline is more about mailboxes, so unless you're dealing with email-specific tasks, you won't need that.
When deciding which modules to use, start with Microsoft Graph for about 80% of your scripting needs because it handles user accounts and group management quite well. For specific tasks, like managing Teams or SharePoint, use the appropriate modules. If you really need to switch to ExchangeOnline, check if your script relies on features that Graph can't currently support.
For assistance with specific cmdlets, try running `Get-Help -Detailed`. It's a great way to learn about what each cmdlet can do. Also, remember that if a cmdlet doesn't have 'Mg' in its name, such as 'Get-MgUser', then it's not from Microsoft Graph and might not be your best bet for newer services. Stick to Microsoft Graph for most things unless you find it's not meeting your needs.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically