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? -
Can you use the -force switch?
-
@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?
-
Knowing the command will help us find you the right parameter.
-
@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.
-
Export-Mailbox -Identity user -PSTFolderPath \server\exports\user.pst
60 lines of these. -
@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.
-
@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?
-
@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. -
if -force doesn't work, you could also try...
-confirm:$false
-
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. -
-confirm:$false did the trick. Adding to each line, thanks!