PowerShell script exchange
Post Reply
kortex
Influencer
Posts: 12
Liked: never
Joined: May 16, 2019 12:49 pm
Full Name: Manuel Berfelde
Contact:

Capture result of Restore-VEXItem

Post by kortex »

I am trying to capture the result of Restore-VEXItem to send it by mail.

The cmdlet writes on completion something like the following to host:
Restore summary:
3 items skipped.
Can i store this to a variable?

Code: Select all

$result = Restore-VEXItem -Item $item -RestoreDeletedItem -ToFolder VeeamRestore
does not work; $result is still $null
nielsengelen
Product Manager
Posts: 5796
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: Capture result of Restore-VEXItem

Post by nielsengelen »

There is a cmdlet called Get-VBOExchangeItemRestoreSession which should give the result of this.

Another option is using basic PowerShell redirection options.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
kortex
Influencer
Posts: 12
Liked: never
Joined: May 16, 2019 12:49 pm
Full Name: Manuel Berfelde
Contact:

Re: Capture result of Restore-VEXItem

Post by kortex »

All I can see in Get-VBRExchangeItemRestoreSession (on-prem exchange) is the property "Result" which only returns "success" or "failed" but no details on how many items have been created or skipped.
kortex
Influencer
Posts: 12
Liked: never
Joined: May 16, 2019 12:49 pm
Full Name: Manuel Berfelde
Contact:

Re: Capture result of Restore-VEXItem

Post by kortex »

I guess this is now an feature request :D :

Restore-VEXItem should return information on restored items as objects and not write to host.
kortex
Influencer
Posts: 12
Liked: never
Joined: May 16, 2019 12:49 pm
Full Name: Manuel Berfelde
Contact:

Re: Capture result of Restore-VEXItem

Post by kortex »

nielsengelen wrote: May 16, 2019 1:55 pm Another option is using basic PowerShell redirection options.
I tried redirecting the output from Restore-VEXItem but had no luck either.
Start-Tanscript didnt do the job, neither did Out-File or *>
Any ideas what i am missing?
kortex
Influencer
Posts: 12
Liked: never
Joined: May 16, 2019 12:49 pm
Full Name: Manuel Berfelde
Contact:

Re: Capture result of Restore-VEXItem

Post by kortex »

Looks like the output is not written to any stream?
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests