Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Get-RubrikEvent to accept -ObjectId or -ObjectLocation #696

Closed
JanosPesti opened this issue Sep 30, 2020 · 1 comment · Fixed by #714
Closed

Rewrite Get-RubrikEvent to accept -ObjectId or -ObjectLocation #696

JanosPesti opened this issue Sep 30, 2020 · 1 comment · Fixed by #714

Comments

@JanosPesti
Copy link

I was trying to get the events for some SQL DB backups, I had a list of DBs from Get-RubrikDatabase but when I wrote

foreach ($sqldb in $sqldbs) {
get-rubrikevent -EventType Backup -AfterDate (get-date).AddHours(-2) -ObjectType Mssql -ObjectName $sqldb.name
}
as we have many DBs with same name on different servers, I did not only get back the DBs I wanted but some event for objects with same name too.

So we would either need a -ObjectLocation or -ObjectId to really uniquely be able to identify an object.

@jaapbrasser
Copy link
Contributor

Hello Janos,

I have updated the documentation with the following example:

    .EXAMPLE
    Get-RubrikDatabase | ForEach-Object {Get-RubrikEvent -Limit 1 -Verbose -id $_.ID}

    This will retrieve the last event for each of the SQL databases protected by Rubrik identifying the database by its object_id while displaying Verbose information

So you could use that sample to get the result you're after. Let me know if this helps you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants