Single sign-on Microsoft 365 tenant using powershell

Copper Contributor

Since I am using powershell to get things easily done at the Microsoft tenant I get frustrated using each time a different connect to get access to the specific commandlets.

Why is it not possible only to connect for instance to AzureAD and run all commands from there.

For instance you create an account with a specific role it is not possible (as far as I am aware) to directly put this account in a security group as member or owner.

How easy should that be?

 

Or is there a workaround I do not know about -;)

3 Replies
Each workload has its own endpoints, thus different access tokens are needed. You can of course get tokens en masse for all services, as part of "connection" script, or cache them for future access - there are sample scripts available online for such approach. Another possibility, at least for some modules, is to use the PRT, but that only works on Azure AD joined devices.
Hi Vasil,

please share me these sample scripts - connect en masse to minimal exchange, msonline and azuread

kind regards,
Jan