PowerShell script exchange
-
tdewin
- Veeam Software
- Posts: 1818
- Liked: 655 times
- Joined: Mar 02, 2012 1:40 pm
- Full Name: Timothy Dewin
-
Contact:
Post
by tdewin »
this post
Hi,
It seems that sync-vbrrepository is an async call. Anyway to wait for it? I tried
Code: Select all
PS V:\scripts> $operation = Get-VBRBackupRepository -Name "Backup Repository 8" | Sync-VBRBackupRepository;while ($operation.isWorking) { write-host "..."}
I don't know how I can update $operation to reflect changes. With backup jobs there is get-vbrtasksession but it doesn't work with this one
-
veremin
- Product Manager
- Posts: 20406
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
-
Contact:
Post
by veremin »
this post
What about using the following example?
Code: Select all
Get-VBRBackupRepository -Name "Name of repository" | Rescan-VBREntity -Wait
Thanks.
-
tdewin
- Veeam Software
- Posts: 1818
- Liked: 655 times
- Joined: Mar 02, 2012 1:40 pm
- Full Name: Timothy Dewin
-
Contact:
Post
by tdewin »
this post
Thanks Vova, that seems exactly what I need
-
veremin
- Product Manager
- Posts: 20406
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
-
Contact:
Post
by veremin »
this post
You're welcome. -Wait switch is designed specifically for the described use case, so, feel free to leverage it.
-
scavern
- Novice
- Posts: 7
- Liked: never
- Joined: May 04, 2015 11:00 am
-
Contact:
Post
by scavern »
this post
Just tagging onto this... is it possible to retrieve the date/time that the repository was last synced?
-
veremin
- Product Manager
- Posts: 20406
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
-
Contact:
Post
by veremin »
this post
As far as I'm concerned, it's not possible to get this information via PS. Thanks.
-
scavern
- Novice
- Posts: 7
- Liked: never
- Joined: May 04, 2015 11:00 am
-
Contact:
Post
by scavern »
this post
Is this information stored somewhere ? Log or database perhaps?
-
veremin
- Product Manager
- Posts: 20406
- Liked: 2298 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
-
Contact:
Post
by veremin »
this post
Most likely, this information is present inside the product database. Thanks.
Users browsing this forum: No registered users and 9 guests