Hi,
I'm planning to create a ps script which connects to the MSOLService and then grab(Get user related information from MSOnline based on the parameters i set in the script. Executing the scripts would launch the authentication module and upon successful authentication would return the results.
Sample execution
./userinfo.ps1 <user>
Sample script
Connect-MsolService
$user = $args[0]
Get-MsolUser -Identity <$user> -Properties *
However, since the Connect-MsolService is defined in the script, i would need to authenticate each time i tried to search for user information . Is there a way that i would need to just authenticate once and skip authentication the next time i search for another user?