PowerShell script exchange
ben10
Lurker
Posts: 1 Liked: never
Joined: Jun 19, 2019 7:49 am
Post
by ben10 » Jun 19, 2019 8:24 am
this post
Hi,
I was looking for a way to export a list of servers within a job to a csv file but exclude the disabled jobs. I have only got the code to get the list of jobs so any help would be appreciated
Code: Select all
foreach ($job in Get-VBRJob) {Write-Host " Job:", $job.name; $job.GetObjectsInJob() | foreach { $_.Location }}
veremin
Product Manager
Posts: 20415 Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Jun 19, 2019 2:58 pm
this post
Check this example:
Code: Select all
foreach ($job in (Get-VBRJob | where {$_.info.IsScheduleEnabled -eq $True})) {Write-Host " Job:", $job.name; $job.GetObjectsInJob() | foreach { $_.Location }}
Thanks!
mrholm
Expert
Posts: 170 Liked: 15 times
Joined: Apr 20, 2018 8:12 am
Full Name: Mats Holm
Contact:
Post
by mrholm » Jan 20, 2020 12:32 pm
this post
Hi
I was looking for the same thing and this script seems promising but we are always using Tags to set Virtual Servers in our jobs is it possible to have Veeam to read what VM's would be chosen by the tag?
jhoughes
Veeam Vanguard
Posts: 282 Liked: 113 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:
Post
by jhoughes » Jan 20, 2020 1:05 pm
this post
No, we cannot determine the VMs contained within the vSphere tag via the Veeam PowerShell cmdlets.
You'd have to leverage PowerCLI for that.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
veremin
Product Manager
Posts: 20415 Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:
Post
by veremin » Jan 20, 2020 2:12 pm
this post
Check
this thread for more information regarding PowerCLI approach. Thanks!
Users browsing this forum: No registered users and 9 guests