-
- Influencer
- Posts: 16
- Liked: 2 times
- Joined: Jun 18, 2019 9:46 am
- Full Name: Thomas Trolle Vrøngmose
- Contact:
How to list Credentials reference to job and VM's
Hi
I am looking a way to list credentials reference to a Job's and VM's. Any ideas how to do this in powershell?
Example :
I have credentials: Admin
like to list all jobs it references to. Backup file 01, Backup 04, and so on.
and also VM's where it is used on: VM SS-DC01, SDE-File012 and so on.
?
I am looking a way to list credentials reference to a Job's and VM's. Any ideas how to do this in powershell?
Example :
I have credentials: Admin
like to list all jobs it references to. Backup file 01, Backup 04, and so on.
and also VM's where it is used on: VM SS-DC01, SDE-File012 and so on.
?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: How to list Credentials reference to job and VM's
What particular credentials you're talking about? Reference to specific view or dialog might help. Thanks!
-
- VP, Product Management
- Posts: 27377
- Liked: 2800 times
- Joined: Mar 30, 2009 9:13 am
- Full Name: Vitaliy Safarov
- Contact:
Re: How to list Credentials reference to job and VM's
Hello Thomas,
If you need to list all credentials used in the jobs and have Veeam ONE, then "Job Configuration Dump" report might help here, as it returns all credentials used in your backup jobs.
Thank you!
If you need to list all credentials used in the jobs and have Veeam ONE, then "Job Configuration Dump" report might help here, as it returns all credentials used in your backup jobs.
Thank you!
-
- Influencer
- Posts: 16
- Liked: 2 times
- Joined: Jun 18, 2019 9:46 am
- Full Name: Thomas Trolle Vrøngmose
- Contact:
Re: How to list Credentials reference to job and VM's
Let me try again.
If i look in my "Manage Credentials" i have an account "\administrator" type "standard". This account is used to do "Guest Processing" on the a lot of backup jobs and in sum pr. VM Objects.
I would like powershell the reference the account "\administrator" has to the backup job in "Guest Processing and pr. VM object aswell.
possible?
If i look in my "Manage Credentials" i have an account "\administrator" type "standard". This account is used to do "Guest Processing" on the a lot of backup jobs and in sum pr. VM Objects.
I would like powershell the reference the account "\administrator" has to the backup job in "Guest Processing and pr. VM object aswell.
possible?
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: How to list Credentials reference to job and VM's
Check these scripts and ask for additional help, if needed. Thanks!
-
- Influencer
- Posts: 16
- Liked: 2 times
- Joined: Jun 18, 2019 9:46 am
- Full Name: Thomas Trolle Vrøngmose
- Contact:
Re: How to list Credentials reference to job and VM's
can't figure out how to use this script.
Code: Select all
Get-VBRCredentials | ?{$_.id -eq $job.VSSoptions.WinCredsId}
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: How to list Credentials reference to job and VM's
Check this sample:
Thanks!
Code: Select all
Asnp VeeamPSSnapin
Foreach ($Job in ((Get-VBRJob) | where {$_.JobType -eq "Backup" -and $_.GetVSSOptions().AreWinCredsSet -eq "True"}))
{
$JobVSSOptions = $Job.GetVssOptions()
$Job | select @{N="Job Name";E={$_.Name}}, @{N="Credentials";E={(Get-VBRCredentials | where {$_.id -eq $JobVSSOptions.WinCredsId}).name}} | Format-Table
}
-
- Influencer
- Posts: 16
- Liked: 2 times
- Joined: Jun 18, 2019 9:46 am
- Full Name: Thomas Trolle Vrøngmose
- Contact:
Re: How to list Credentials reference to job and VM's
Yes her is something i can use.
But i would like it the other way around. Credentials and then list the ref. it has to the job and VM.
Credentials Job Name
-------- -----------
Administrator Backup job 1
Backup job 2
Credentials VM Name
-------- -----------
Administrator VM_DC01
VM_File156
But i would like it the other way around. Credentials and then list the ref. it has to the job and VM.
Credentials Job Name
-------- -----------
Administrator Backup job 1
Backup job 2
Credentials VM Name
-------- -----------
Administrator VM_DC01
VM_File156
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: How to list Credentials reference to job and VM's
This is how you can find credentials that are set for individual VMs:
Then, you will need to save results of first and second scripts to variables and compare variables to where similar credentials are used.
Thanks!
Code: Select all
Asnp VeeamPSSnapin
Foreach ($Job in ((Get-VBRJob) | where {$_.JobType -eq "Backup" -and $_.GetVSSOptions().AreWinCredsSet -eq $True}))
{
Foreach ($Object in (Get-VBRJobObject -Job $Job | where {$_.VssOptions.AreWinCredsSet -eq $True}))
{
$ObjectVSSOptions = $Object.VssOptions
$Object | select @{N="VM Name";E={$_.Name}}, @{N="Credentials";E={(Get-VBRCredentials | where {$_.id -eq $ObjectVSSOptions.WinCredsId}).name}}
}
}
Thanks!
-
- Influencer
- Posts: 16
- Liked: 2 times
- Joined: Jun 18, 2019 9:46 am
- Full Name: Thomas Trolle Vrøngmose
- Contact:
Re: How to list Credentials reference to job and VM's
Hi Vermin
It's nearly there.
I would like to ad the credentials description as well And getting a output file in a CSV file. It was not possible for me to achieve this.
Can you help?
And what about a output where the credentials have references to a backup job?
Sorry for being so demanding.
It's nearly there.
I would like to ad the credentials description as well And getting a output file in a CSV file. It was not possible for me to achieve this.
Can you help?
And what about a output where the credentials have references to a backup job?
Sorry for being so demanding.
-
- Veeam Software
- Posts: 1818
- Liked: 655 times
- Joined: Mar 02, 2012 1:40 pm
- Full Name: Timothy Dewin
- Contact:
Re: How to list Credentials reference to job and VM's
well don't have the code but you could push it in array
in the loop
and then convert it to csv
I don't have a vbr server now at hence but here is an example with processes
Code: Select all
$array = @()
Code: Select all
$array += ($Job | select @{N="Job Name";E={$_.Name}}, @{N="Credentials";E={(Get-VBRCredentials | where {$_.id -eq $JobVSSOptions.WinCredsId}).name}})
Code: Select all
$array | convertto-csv
Code: Select all
$array = @()
$procs = Get-Process
foreach ($proc in $procs) {
$array += ($proc | select id,name)
}
$array | ConvertTo-Csv
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: How to list Credentials reference to job and VM's
And to get credentials' description you need one additional column to the provided scripts:
For example,
Thanks!
Code: Select all
@{N="Description";E={(Get-VBRCredentials | where {$_.id -eq $ObjectVSSOptions.WinCredsId}).Description}}
For example,
Code: Select all
Asnp VeeamPSSnapin
Foreach ($Job in ((Get-VBRJob) | where {$_.JobType -eq "Backup" -and $_.GetVSSOptions().AreWinCredsSet -eq $True}))
{
Foreach ($Object in (Get-VBRJobObject -Job $Job | where {$_.VssOptions.AreWinCredsSet -eq $True}))
{
$ObjectVSSOptions = $Object.VssOptions
$Object | select @{N="VM Name";E={$_.Name}}, @{N="Credentials";E={(Get-VBRCredentials | where {$_.id -eq $ObjectVSSOptions.WinCredsId}).name}}, @{N="Description";E={(Get-VBRCredentials | where {$_.id -eq $ObjectVSSOptions.WinCredsId}).Description}}
}
}
-
- Veteran
- Posts: 942
- Liked: 53 times
- Joined: Nov 05, 2009 12:24 pm
- Location: Sydney, NSW
- Contact:
Re: How to list Credentials reference to job and VM's
Hi @vEremin,
The script no longer works due to the cmdlet being deprecated.
Error:
The script no longer works due to the cmdlet being deprecated.
Error:
Code: Select all
WARNING: This cmdlet is no longer supported for computer backup jobs. Use "Get-VBRComputerBackupJob" instead.
--
/* Veeam software enthusiast user & supporter ! */
/* Veeam software enthusiast user & supporter ! */
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: How to list Credentials reference to job and VM's
Hi,
The cmdlet is not deprecated as a whole. The warning just states that it is no longer supported for computer backup jobs.
It still works for other platforms like VMware or Hyper-V.
Besides, the script runs fine in my lab. Is there something in particular that doesn't work in your case?
Best regards,
Oleg
The cmdlet is not deprecated as a whole. The warning just states that it is no longer supported for computer backup jobs.
It still works for other platforms like VMware or Hyper-V.
Besides, the script runs fine in my lab. Is there something in particular that doesn't work in your case?
Best regards,
Oleg
-
- Veteran
- Posts: 942
- Liked: 53 times
- Joined: Nov 05, 2009 12:24 pm
- Location: Sydney, NSW
- Contact:
Re: How to list Credentials reference to job and VM's
Hi @Oleg,
There is no result in the script posted above, and only the Deprecation warning showing.
What I am after is the name of the backup jobs and their respective Credentials if it is used.
There is no result in the script posted above, and only the Deprecation warning showing.
What I am after is the name of the backup jobs and their respective Credentials if it is used.
--
/* Veeam software enthusiast user & supporter ! */
/* Veeam software enthusiast user & supporter ! */
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: How to list Credentials reference to job and VM's
Do you happen to run it against backup copy jobs, agent backup jobs, nas backup jobs or replica jobs? These jobs have types other than "Backup" and the script above would filter them out. Thanks!
-
- Veteran
- Posts: 942
- Liked: 53 times
- Joined: Nov 05, 2009 12:24 pm
- Location: Sydney, NSW
- Contact:
Re: How to list Credentials reference to job and VM's
Hi @Oleg,
Correct me if I'm wrong, but the Where-Object already filter the Backup job type.
So, I wonder if the code is deprecated or if there is any updated cmdlet that can return more accurate results?
Correct me if I'm wrong, but the Where-Object already filter the Backup job type.
So, I wonder if the code is deprecated or if there is any updated cmdlet that can return more accurate results?
--
/* Veeam software enthusiast user & supporter ! */
/* Veeam software enthusiast user & supporter ! */
-
- Veeam Software
- Posts: 2010
- Liked: 670 times
- Joined: Sep 25, 2019 10:32 am
- Full Name: Oleg Feoktistov
- Contact:
Re: How to list Credentials reference to job and VM's
Hi @albertwt,
Correct. That's why I asked. Because if you run it against agent backup jobs or other types I mentioned, no output will be produced.
Also, there is no way to specify guest credentials on agent jobs level in VBR, you would use credentials you specified in protection groups instead.
If job types you run this script against is of Backup type and it targets VMware or Hyper-V platforms, the code should work.
If it doesn't work, I would advise to check it line by line and see where the variable gets nulled.
Thanks,
Oleg
Correct. That's why I asked. Because if you run it against agent backup jobs or other types I mentioned, no output will be produced.
Also, there is no way to specify guest credentials on agent jobs level in VBR, you would use credentials you specified in protection groups instead.
If job types you run this script against is of Backup type and it targets VMware or Hyper-V platforms, the code should work.
If it doesn't work, I would advise to check it line by line and see where the variable gets nulled.
Thanks,
Oleg
-
- Veteran
- Posts: 942
- Liked: 53 times
- Joined: Nov 05, 2009 12:24 pm
- Location: Sydney, NSW
- Contact:
Re: How to list Credentials reference to job and VM's
Sure thing, thank you @oleg.feoktistov,
Regards,
Regards,
--
/* Veeam software enthusiast user & supporter ! */
/* Veeam software enthusiast user & supporter ! */
Who is online
Users browsing this forum: No registered users and 10 guests