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

    Insert "Y" After each line in Powershell

    Scheduled Pinned Locked Moved IT Discussion
    12 Posts 5 Posters 1.3k Views
    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.
    • coliverC
      coliver
      last edited by

      Can you use the -force switch?

      1 Reply Last reply Reply Quote 0
      • dafyreD
        dafyre @Texkonc
        last edited by

        @texkonc said in Insert "Y" After each line in Powershell:

        I have a script of over 60 mailboxes to export from Exchange 2007, pressing Y after each one is becoming a royal pain in the ass.
        I have tried putting a Y after a few lines and it didn't help. My Google foo might be weak, but any advise?

        What is the command that's causing it to stop?

        scottalanmillerS 1 Reply Last reply Reply Quote 3
        • EddieJenningsE
          EddieJennings
          last edited by

          Knowing the command will help us find you the right parameter.

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

            @dafyre said in Insert "Y" After each line in Powershell:

            @texkonc said in Insert "Y" After each line in Powershell:

            I have a script of over 60 mailboxes to export from Exchange 2007, pressing Y after each one is becoming a royal pain in the ass.
            I have tried putting a Y after a few lines and it didn't help. My Google foo might be weak, but any advise?

            What is the command that's causing it to stop?

            This, it's probably a command option that needs to be tracked down.

            1 Reply Last reply Reply Quote 1
            • T
              Texkonc
              last edited by

              Export-Mailbox -Identity user -PSTFolderPath \server\exports\user.pst
              60 lines of these.

              coliverC EddieJenningsE 2 Replies Last reply Reply Quote 0
              • coliverC
                coliver @Texkonc
                last edited by

                @texkonc said in Insert "Y" After each line in Powershell:

                Export-Mailbox

                I don't see -force as a switch for that command. Generally it works for commands that require user input.

                1 Reply Last reply Reply Quote 0
                • EddieJenningsE
                  EddieJennings @Texkonc
                  last edited by

                  @texkonc said in Insert "Y" After each line in Powershell:

                  Export-Mailbox -Identity user -PSTFolderPath \server\exports\user.pst
                  60 lines of these.

                  For my own curiosity, what version of Exchange are you running or are you doing this with Exchange Online?

                  T 1 Reply Last reply Reply Quote 0
                  • T
                    Texkonc @EddieJennings
                    last edited by

                    @eddiejennings said in Insert "Y" After each line in Powershell:

                    @texkonc said in Insert "Y" After each line in Powershell:

                    Export-Mailbox -Identity user -PSTFolderPath \server\exports\user.pst
                    60 lines of these.

                    For my own curiosity, what version of Exchange are you running or are you doing this with Exchange Online?

                    Exchange 2007
                    I had to build a 32bit vm with Outlook to even get it to work. You cant run it from the server.

                    1 Reply Last reply Reply Quote 0
                    • dafyreD
                      dafyre
                      last edited by

                      if -force doesn't work, you could also try...

                      -confirm:$false

                      1 Reply Last reply Reply Quote 3
                      • EddieJenningsE
                        EddieJennings
                        last edited by EddieJennings

                        dafyre's on the right track.
                        https://technet.microsoft.com/en-us/library/aa998579(v=exchg.80).aspx I'm not sure what the exact syntax is for -confirm but that rings a bell.

                        1 Reply Last reply Reply Quote 2
                        • T
                          Texkonc
                          last edited by

                          -confirm:$false did the trick. Adding to each line, thanks!

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