PS: O365 cmdlet issue.
-
Import failed:
>$ Import-Module MSOnline Import-Module : The specified module 'MSOnline' was not loaded because no valid module file was found in any module directory. At line:1 char:1 + Import-Module MSOnline + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (MSOnline:String) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
-
We needed this, which is literally never mentioned anywhere, ever.
Install-Module -Name MSOnline
-
You need that module for any connection to Office 365...
-
For my record later:
Install-Module -Name MSOnline <added>
Set-ExecutionPolicy RemoteSigned $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session Connect-MsolService -Credential $credential
Now,.. did I get them in the right order...
-
@dbeato said in PS: O365 cmdlet issue.:
You need that module for any connection to Office 365...
Yes, but no documents anywhere mention installing it with that command. Never. The closest that we could fine was a document telling us to get AzureAD instead, which turns out to not work here.
-
@gjacobse said in PS: O365 cmdlet issue.:
For my record later:
Set-ExecutionPolicy RemoteSigned
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Connect-MsolService -Credential $credential
Now,.. did I get them in the right order...
No, the session after connect and then Import.
-
-
@scottalanmiller said in PS: O365 cmdlet issue.:
@dbeato said in PS: O365 cmdlet issue.:
You need that module for any connection to Office 365...
Yes, but no documents anywhere mention installing it with that command. Never. The closest that we could fine was a document telling us to get AzureAD instead, which turns out to not work here.
The only time I used powershell to modify O365 was to shutdown Clutter. Those instructions had that, as it worked. Never looked for any other things though. so no idea.
-
@jaredbusch said in PS: O365 cmdlet issue.:
@scottalanmiller said in PS: O365 cmdlet issue.:
@dbeato said in PS: O365 cmdlet issue.:
You need that module for any connection to Office 365...
Yes, but no documents anywhere mention installing it with that command. Never. The closest that we could fine was a document telling us to get AzureAD instead, which turns out to not work here.
The only time I used powershell to modify O365 was to shutdown Clutter. Those instructions had that, as it worked. Never looked for any other things though. so no idea.
Used to work for us, too. But something has changed, from what we can tell. Our own notes and links we used to use aren't the same any more.
-
@jaredbusch said in PS: O365 cmdlet issue.:
@gjacobse said in PS: O365 cmdlet issue.:
For my record later:
/wtb codeblock around that... ```
I fixed it.