Exchange Exchange
A community dedicated to Exchange and related technology.

auto answer yes to all or yes in scripts

This post has 4 Replies | 2 Followers

Top 10 Contributor
Points 125
Zxarr Posted: 07-27-2007 1:15 PM

Greetings,

 

I am in the middle of moving databases and log files to larger drives.  I know the command to use and it works quite well, but is there a way, in a ps1 script of always answering yes to the confirmation questions?

 

I'd like to let this script run overnight.

 

 

Thanks. 

  • | Post Points: 20
Top 10 Contributor
Points 3,290

You can use the -force switch in the move-databasepath and move-storagegrouppath cmdlets which should suppress prompts.

- Joel

  • | Post Points: 20
Top 10 Contributor
Points 125

Odd, that seems like it should work.  It didn't.  Here is the command I am using: 

 

 Move-DatabasePath -Identity nb-ws-sv-0015\b -EdbFilePath N:\DB\b\b.edb -Force

 

I have tried moving the -Force switch around in the line, to no avail.

 

Any other ideas out there? 

  • | Post Points: 20

In addition to using "the force", also use -Confirm:$false.  This will perform the task without prompting you.

  • | Post Points: 20
Top 10 Contributor
Points 125

Thanks,

 

I'll try that as soon as this database is finished migrating...  I thought $false may come into play somewhere, but it didn't like it after -Force...

 

:) 

  • | Post Points: 5
Page 1 of 1 (5 items) | RSS
© 2003-2008 NamedPipes Consulting. All other company and product names are property of their owners.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems