2

I installed the SharePoint Online Management Shell on two different Windows 10 machines. One worked fine, the other does not have any commands available. If I run get-module, it lists the Microsoft.Online.SharePoint.Powershell module, but the ExportedCommands field is blank. The version number displays the same version as the machine where this works. Apparently, there's some sort of conflict with another module I have installed?

The impact of this is that no commands function, including Connect-SPOService, which returns "the term 'connect-sposervice' is not recognized as the name of a cmdlet..."

Any suggestions? I have already re-installed and rebooted. And yes, I'm running it as admin.

  • There would be a SharePoint online management shell in the start menu, search for it. You will find it there and then open it and run your commands inside it – Gautam Sheth Jul 5 '18 at 14:05
  • That's what I did. Again, I did the exact same process on different machines. It works on one, not the other. – Mike2500 Jul 5 '18 at 14:06
  • not 100% sure, but do you have admin rights on the machine ? It probably wont throw an error if you dont have admin rights. Can you install by right clicking and opening with Admin creds ? – Gautam Sheth Jul 5 '18 at 14:08
  • Yes, I have admin rights. run as admin isn't an option when installing, but windows prompts for permissions – Mike2500 Jul 5 '18 at 20:26
  • can you download CSOM SPO SDK and install it and then reinstall the SPO PowerShell and check ? – Gautam Sheth Jul 9 '18 at 13:36
1

It is the SP powershell loading issue. I had the similar issue earlier and resolved it by setting the execution policy for power-shell for my fresh windows machine.

try this set-executionpolicy -executionpolicy unrestricted Or set-executionpolicy -executionpolicy remotelsigned

then repoen the powershell and try the command Connect-SPOService etc.. It will work.

Refer My Question

Edit1: Try importing the module again from the .psd1 file for SPO management shell as

Import-Module 'C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.P
owerShell' -verbose

and then check get-module. Refer my screen: enter image description here

Edit2: If nothing works, sadly :( you may need to reinstall the windows

  • When I start of the SP online shell, no errors are displayed, so I don't think it's the same issue. Regardless, I changed the execution policy from remotesigned to unrestricted, with the same result. Cmdlets don't exist, and get-module shows the module with an empty value for exportedcommands. – Mike2500 Jul 9 '18 at 13:14
  • If the Edit1 doesn,t work, then you may need to reinstall the windows as commented in this thread stackoverflow.com/questions/33082339/… – DvG Jul 9 '18 at 13:33
  • running the import-module command with verbose shows "loading module from path", but never displays anything about importing cmdlets. There are no error messages. – Mike2500 Jul 9 '18 at 13:37
  • Did you tried locating your .psd1 file in "C:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell"? verify its content. Also, try copying and replacing the DLLs and .psd1 from working windows machine to this new Machine. Then try Import command.. – DvG Jul 9 '18 at 13:41
  • the psd1 file is there, and the contents are the same as on the working machine. – Mike2500 Jul 9 '18 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.