For local AD you can easily obtain your current group memberships via CLI but for Office 365 \ Azure Active Directory, this seems to require Get-MSOL for pretty much everything.
That requires the MSOnline Azure module to be installed and when the script runs the user will be visually prompted for O365 credentials.
Not sure if there’s any way around this.
Ideally, there would be some sort of credential digest that feeds the currently signed in AAD user credential to MSOL allowing the script to bypass the pop-up.
Hello Evila.
I ran the Set-MsolDomainAuthentication -DomainName < DomainName> -Authentication Managed command but after closing the PS window and performing a Connect-MsolService the credentials popup is shown again.
I guess I didn’t mention that I’m looking for a way to make it persistent. (After a reboot)