ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    PS: O365 cmdlet issue.

    IT Discussion
    o365 office365 powershell
    4
    11
    1.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • gjacobseG
      gjacobse
      last edited by gjacobse

      Found my old thread on this; but it's not working

      I have a number of password to reset. I have the CSV file, but the cmdlet fails.

      Set-MsolUserPassword : The term 'Set-MsolUserPassword' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,
      verify that the path is correct and try again.
      At line:1 char:37
      + Import-CSV C:\ssi-ps-pswdrst.csv |%{Set-MsolUserPassword -userPrincip ...
      +                                     ~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (Set-MsolUserPassword:String) [], CommandNotFoundException
          + FullyQualifiedErrorId : CommandNotFoundException
      

      The MsoluserPassword cmdlet - nothing on MS support seems to get it to connect...

      1 Reply Last reply Reply Quote 0
      • gjacobseG
        gjacobse
        last edited by gjacobse

        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
        
        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by scottalanmiller

          We needed this, which is literally never mentioned anywhere, ever.

          Install-Module -Name MSOnline
          
          1 Reply Last reply Reply Quote 0
          • dbeatoD
            dbeato
            last edited by

            You need that module for any connection to Office 365...

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • gjacobseG
              gjacobse
              last edited by scottalanmiller

              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...

              dbeatoD JaredBuschJ 2 Replies Last reply Reply Quote 1
              • scottalanmillerS
                scottalanmiller @dbeato
                last edited by

                @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.

                JaredBuschJ 1 Reply Last reply Reply Quote 1
                • dbeatoD
                  dbeato @gjacobse
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 0
                  • JaredBuschJ
                    JaredBusch @gjacobse
                    last edited by

                    @gjacobse said in PS: O365 cmdlet issue.:

                    For my record later:

                    /wtb codeblock around that... ```

                    scottalanmillerS 1 Reply Last reply Reply Quote 1
                    • JaredBuschJ
                      JaredBusch @scottalanmiller
                      last edited by

                      @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.

                      scottalanmillerS 1 Reply Last reply Reply Quote 1
                      • scottalanmillerS
                        scottalanmiller @JaredBusch
                        last edited by

                        @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.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller @JaredBusch
                          last edited by

                          @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.

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post