PowerShell script exchange
Post Reply
jsobell
Novice
Posts: 8
Liked: 1 time
Joined: Nov 07, 2024 2:36 am
Full Name: Jason Sobell
Contact:

Fetching statistics for Entra ID log backups from PowerShell Cmdlet

Post by jsobell »

I can't see a way to retrieve data about the underlying Log backup jobs from PowerShell.
We use PowerShell this to grab other reporting statistics for most other backup types, but how do we retrieve either the log of actions, or the statistics themselves for an Entra ID job?
Neither Get-VBREntraIDLogsBackupJob nor Get-VBREntraIDLogsBackup seem to return anything usefull.
Is there another method of collecting data about these backup sessions?

Image

Thanks,
Jason
david.domask
Veeam Software
Posts: 2838
Liked: 650 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Fetching statistics for Entra ID log backups from PowerShell Cmdlet

Post by david.domask »

Hi jsobell,

There isn't a dedicated *Session cmdlet for EntraID, but we can fetch this with Get-VBRSession and the -Type parameter. Just a side note, Get-VBRSession has become my go-to for session reporting as it's a lot faster than Get-VBRBackupSession typically and you can filter with -Type for type of session or pass a CJob object from Get-VBRJob on -Job parameter.

The downside to Get-VBRSession is they return a "lite" version of the session data (see below example). We can work around this and get a normal CBackupSession object from Get-VBRBackupSession as shown below. One of these two methods ought work for your reporting needs.

Example code:

Code: Select all

$entraSess = Get-VBRSession -Type EntraIdItemBackup
$entraSess[0]


Progress     : 100
RunManually  : False
Log          : {Id: 25394583, Usn: 4096434276, Title: Job started at 17.06.2025 11:00:19, Cookie: , Description: ,
               Time: 17.06.2025 11:00:25, StartTime: 17.06.2025 11:00:25, Status: Succeeded, Id: 25394584, Usn:
               4096434279, Title: The tenant 5w5g0n has been added to processing, Cookie: , Description: , Time:
               17.06.2025 11:00:26, StartTime: 17.06.2025 11:00:26, Status: Succeeded, Id: 25394586, Usn: 4096434588,
               Title: Processing 5w5g0n, Cookie: 9094569c-592c-45df-8584-9d885e23ab2a, Description: , Time: 17.06.2025
               11:02:59, StartTime: 17.06.2025 11:00:27, Status: Succeeded, Id: 25394622, Usn: 4096434596, Title: Job
               finished at 17.06.2025 11:03:00, Cookie: , Description: , Time: 17.06.2025 11:03:00, StartTime:
               17.06.2025 11:03:00, Status: Succeeded}
Name         : EntraID-FK-5w5g0n
CreationTime : 17.06.2025 11:00:19
EndTime      : 17.06.2025 11:03:00
JobId        : cea57d0d-83c4-4c59-a8b8-3853ee781cd5
Result       : Success
State        : Stopped
Id           : 0a8dfce2-d482-48a8-b2cc-93ec595b68b9

$fullEntraSess = Get-VBRBackupSession -Id $entraSess.id #passes Ids from $entraSess here as an array of Ids so we get full sessions for everything
$fullEntraSess[0]

Job Name             State      Start Time             End Time               Result
--------             -----      ----------             --------               ------
EntraID-FK-5w5g0n... Stopped    17.06.2025 11:00:19    17.06.2025 11:03:00    Success
David Domask | Product Management: Principal Analyst
jsobell
Novice
Posts: 8
Liked: 1 time
Joined: Nov 07, 2024 2:36 am
Full Name: Jason Sobell
Contact:

Re: Fetching statistics for Entra ID log backups from PowerShell Cmdlet

Post by jsobell » 1 person likes this post

Awesome, thanks David, I'll give that a try.
jsobell
Novice
Posts: 8
Liked: 1 time
Joined: Nov 07, 2024 2:36 am
Full Name: Jason Sobell
Contact:

Re: Fetching statistics for Entra ID log backups from PowerShell Cmdlet

Post by jsobell »

Hi David,
Thanks, that is a useful way of accessing a summary of the data, but our requirement is for the individual items as shown in the Action log output:
Image

Is there any way to retrieve this log text in the API calls? We're prepared to parse the log results if necessary, but we can't see any way of getting to the log itself.

Regards,
Jason
david.domask
Veeam Software
Posts: 2838
Liked: 650 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Fetching statistics for Entra ID log backups from PowerShell Cmdlet

Post by david.domask »

Hi Jason,

You're very welcome.

Regrettably there is not a supported means at this time of pulling those entries. If you're feeling brave, you can use the unsupported method here. Both Backup and Task sessions (from Get-VBRBackupSessoin and Get-VBRTaskSession respectively) should have the Logger property and you'll need to play a bit to get the info you want, filtering on the Title property.
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest