I have two cmdlets that I would like to run in a script that I can run instead of running each comdlet by itself. What I would like the script to do is to run the first cmdlet and after it is done, print a success message and then run the other cmdlet. I would also like to have it create a logfile of the time it started, actions it took and time ended. Can anyone help me with this?
The cmdlets are :
get-mailbox –server mail | Export-Mailbox –SubjectKeywords "Discovery Keywords" –TargetMailbox Administrator –TargetFolder 'MyData'
get-mailbox –server mail | Export-Mailbox –ContentKeywords "Discovery Keywords" –TargetMailbox Administrator –TargetFolder 'MyData
Also does anyone know if the cmdlets will search all the information stores on Exchange?