-
- Enthusiast
- Posts: 43
- Liked: 6 times
- Joined: Oct 21, 2014 7:56 am
- Contact:
Query Source VM for FileCopy
I'm working on a script to query all BackupSessions of the last 24 hours. The result is written to XML.
I get the SourcePath and TargetPath of a FileCopy without any Problems, but i need the Source VM too.
Does anyone know where i can get this information?
I took a look at the Job-Object already, but i couldn't find anything.
I get the SourcePath and TargetPath of a FileCopy without any Problems, but i need the Source VM too.
Does anyone know where i can get this information?
I took a look at the Job-Object already, but i couldn't find anything.
BACKUP EAGLE® Developer
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Query Source VM for FileCopy
Can you elaborate on the selected portion? Are you talking here about file copy job and "source" server the corresponding files are copied from? Thanks.Talom wrote:I get the SourcePath and TargetPath of a FileCopy without any Problems, but i need the Source VM too.
-
- Enthusiast
- Posts: 43
- Liked: 6 times
- Joined: Oct 21, 2014 7:56 am
- Contact:
Re: Query Source VM for FileCopy
I call
For every session i get the TaskSessions and there i can get the ObjectName for every TaskSession. But where can i find the Source Hostname where the files are copied from?
The Target Host would be nice to have, too, but is not necessary.
Code: Select all
Get-VBRBackupSession | Where-Object { $_.EndTime -ge $date}
The Target Host would be nice to have, too, but is not necessary.
BACKUP EAGLE® Developer
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Query Source VM for FileCopy
Let me rephrase my question - what is the type of the job? File copy one? And you want to get information about its source and target, right? Thanks.
-
- Enthusiast
- Posts: 43
- Liked: 6 times
- Joined: Oct 21, 2014 7:56 am
- Contact:
Re: Query Source VM for FileCopy
Thats exactly what i want.
It is a File Copy
Sorry for misunderstanding
It is a File Copy
Sorry for misunderstanding
BACKUP EAGLE® Developer
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Query Source VM for FileCopy
Can you try the following example and see whether it meets your expectations?
Thanks.
Code: Select all
$FileCopyJob = Get-VBRJob -name "Name of your File Copy Job"
$FileCopyJob.GetObjectsInJob().object.name
-
- Enthusiast
- Posts: 43
- Liked: 6 times
- Joined: Oct 21, 2014 7:56 am
- Contact:
Re: Query Source VM for FileCopy
Thanks for this, but its not really what i wanted.
Output:
The first object is a local FileCopy, now i got the Source Path. I already have this info. What i expect is: "This Server" or "Name of the VeeamServer"
The second one is a log-File from my ESX Host. I expected the name of the ESX host "rzc-dt-esx"
I guess it can be in the VBRTaskSession Object. But IntelliSense is buggy so i don't get a list of members
Code: Select all
$FileCopyJob = Get-VBRJob -name "File Copy Job 1"
$jobObjects = $FileCopyJob.GetObjectsInJob()
foreach($obj in $jobObjects)
{
write-host "OBJECT: " $obj.Name
}
Code: Select all
OBJECT: C:\Users\Administrator\job-definitions.xml
OBJECT: <datacenterRef>datacenter-21</datacenterRef><datacenterName>srzc-test</datacenterName><datacenterPath>srzc-test</datacenterPath><hostRef>host-83</hostRef><datastoreRef>datastore-84</datastor
eRef><datastoreGuid>52de3a7e-49e03574-dce2-6805ca1f766d</datastoreGuid><FullName>[datastore-vm8-1] rzc-dt-w8k-ts90/vmware.log</FullName>
The second one is a log-File from my ESX Host. I expected the name of the ESX host "rzc-dt-esx"
I guess it can be in the VBRTaskSession Object. But IntelliSense is buggy so i don't get a list of members
BACKUP EAGLE® Developer
-
- Veeam Software
- Posts: 649
- Liked: 170 times
- Joined: Dec 10, 2012 8:44 am
- Full Name: Nikita Efes
- Contact:
Re: Query Source VM for FileCopy
In that case you can use
In general, it is always useful to use Get-Member command to find available methods and properties.
For example in your case it will be
Code: Select all
$FileCopyJob.GetObjectsInJob().object.GetHost().Name
For example in your case it will be
Code: Select all
$FileCopyJob.GetObjectsInJob().object | gm
-
- Enthusiast
- Posts: 43
- Liked: 6 times
- Joined: Oct 21, 2014 7:56 am
- Contact:
Re: Query Source VM for FileCopy
Thanks for the help.
Thats what i looked for.
Thats what i looked for.
BACKUP EAGLE® Developer
Who is online
Users browsing this forum: No registered users and 8 guests