Hello,
Our team uses a PowerShell script to finalize onboarding of new users. I am trying to modify the script to change it from using basic auth to modern auth. The EXO module was installed by me on the server, and I don't recall seeing an option to install it for the CurrentUser vs the entire computer for all users. When a different admin logs into the server and attempts to run the script, the following line generates an error that the file cannot be found (obviously, since the module was only installed into my profile):
Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"\Apps\2.0\") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "none"}|select -First 1)
The above line came from the following archived thread:
https://social.technet.microsoft.com/Forums/en-US/da419e14-de8d-4b35-99d7-2550eeab5d43/connect-exonline-using-window-powershell-instead-of-using-quotexchange-online-powershell-module?forum=winserverpowershell
We need multiple staff to have the ability to successfully run this script. I'd rather not depend upon a module installed into a specific user profile. How do I modify the environment and script on this server so that the module can be loaded by any profile?
Thanks!