PS SQLSERVER:\> Get-DbaDbBackupHistory -SqlInstance 'DBC-025\DBC025' -Database 'iverdba' -LastFull -IncludeCopyOnly -debug DEBUG: 21948 | [13.27.19][Get-DbaDbBackupHistory] Active Parameter set: Default. DEBUG: 21949 | [13.27.19][Get-DbaDbBackupHistory] Bound parameters: SqlInstance, Database, LastFull, IncludeCopyOnly, Debug DEBUG: 2252 | [13.27.19][Connect-DbaInstance] Starting process block DEBUG: 2254 | [13.27.19][Connect-DbaInstance] Starting loop for 'DBC-025\DBC025': ComputerName = 'DBC-025', InstanceName = 'DBC025', IsLocalHost = 'False', Typ e = 'Default' DEBUG: 2403 | [13.27.19][Connect-DbaInstance] Input Object was anything else, so not full smo and we have to go on and build one DEBUG: 2472 | [13.27.19][Connect-DbaInstance] isConnectionString is false DEBUG: 2473 | [13.27.19][Connect-DbaInstance] will build server with instance.FullSmoName = 'DBC-025\DBC025' DEBUG: 2475 | [13.27.19][Connect-DbaInstance] server was build with server.Name = 'DBC-025\DBC025' DEBUG: 2484 | [13.27.19][Connect-DbaInstance] AppendConnectionString was not set DEBUG: 2552 | [13.27.19][Connect-DbaInstance] We try to connect DEBUG: 2606 | [13.27.19][Connect-DbaInstance] We try connection with server.ConnectionContext.SqlConnectionObject.Open() DEBUG: 2610 | [13.27.19][Connect-DbaInstance] Connect was successful DEBUG: 2682 | [13.27.19][Connect-DbaInstance] no SqlConnectionOnly, so we go on DEBUG: 2684 | [13.27.19][Connect-DbaInstance] we don't have server.ComputerName DEBUG: 2685 | [13.27.19][Connect-DbaInstance] but we would have instance.ComputerName = 'DBC-025' DEBUG: 2689 | [13.27.19][Connect-DbaInstance] we try to use server.NetName for computername DEBUG: 2695 | [13.27.19][Connect-DbaInstance] Ok, computername = server.NetName = 'DBC-025' DEBUG: 2703 | [13.27.19][Connect-DbaInstance] We add IsAzure = 'False', ComputerName = computername = 'DBC-025', DbaInstanceName = instance.InstanceName = 'DBC025' , NetPort = instance.Port = '0', ConnectedAs = server.ConnectionContext.TrueLogin = 'INT-xxx\iverkeka' DEBUG: 2722 | [13.27.19][Connect-DbaInstance] We return server with server.Name = 'DBC-025\DBC025' DEBUG: 22126 | [13.27.19][Get-DbaDbBackupHistory] Processing iverdba Exception calling "ExecuteWithResults" with "1" argument(s): "An exception occurred while executing a Transact-SQL statement or batch." At C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.121\allcommands.ps1:22150 char:25 + ... $results = $server.ConnectionContext.ExecuteWithResults($ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ExecutionFailureException DEBUG: 22384 | [13.27.19][Get-DbaDbBackupHistory] SQL Statement: SELECT a.BackupSetRank, a.Server, '' as AvailabilityGroupName, a.[Database], a.Username, a.Start, a.[End], a.Duration, a.[Path], a.Type, a.TotalSize, a.CompressedBackupSize, a.MediaSetId, a.BackupSetID, a.Software, a.position, a.first_lsn, a.database_backup_lsn, a.checkpoint_lsn, a.last_lsn, a.first_lsn as 'FirstLSN', a.database_backup_lsn as 'DatabaseBackupLsn', a.checkpoint_lsn as 'CheckpointLsn', a.last_lsn as 'LastLsn', a.software_major_version, a.DeviceType, a.is_copy_only, a.last_recovery_fork_guid, a.recovery_model, a.EncryptorThumbprint, a.EncryptorType, a.KeyAlgorithm FROM ( SELECT RANK() OVER (ORDER BY backupset.last_lsn desc, backupset.backup_finish_date DESC) AS 'BackupSetRank', backupset.database_name AS [Database], backupset.user_name AS Username, backupset.backup_start_date AS Start, backupset.server_name as [Server], backupset.backup_finish_date AS [End], DATEDIFF(SECOND, backupset.backup_start_date, backupset.backup_finish_date) AS Duration, mediafamily.physical_device_name AS Path, backupset.backup_size AS TotalSize, backupset.compressed_backup_size as CompressedBackupSize, NULL as EncryptorThumbprint, NULL as EncryptorType, NULL AS KeyAlgorithm, CASE backupset.type WHEN 'L' THEN 'Log' WHEN 'D' THEN 'Full' WHEN 'F' THEN 'File' WHEN 'I' THEN 'Differential' WHEN 'G' THEN 'Differential File' WHEN 'P' THEN 'Partial Full' WHEN 'Q' THEN 'Partial Differential' ELSE NULL END AS Type, backupset.media_set_id AS MediaSetId, mediafamily.media_family_id as mediafamilyid, backupset.backup_set_id as BackupSetID, CASE mediafamily.device_type WHEN 2 THEN 'Disk' WHEN 102 THEN 'Permanent Disk Device' WHEN 5 THEN 'Tape' WHEN 105 THEN 'Permanent Tape Device' WHEN 6 THEN 'Pipe' WHEN 106 THEN 'Permanent Pipe Device' WHEN 7 THEN 'Virtual Device' WHEN 9 THEN 'URL' ELSE 'Unknown' END AS DeviceType, backupset.position, backupset.first_lsn, backupset.database_backup_lsn, backupset.checkpoint_lsn, backupset.last_lsn, backupset.software_major_version, mediaset.software_name AS Software, backupset.is_copy_only, backupset.last_recovery_fork_guid, backupset.recovery_model FROM msdb..backupmediafamily AS mediafamily JOIN msdb..backupmediaset AS mediaset ON mediafamily.media_set_id = mediaset.media_set_id JOIN msdb..backupset AS backupset ON backupset.media_set_id = mediaset.media_set_id JOIN ( SELECT TOP 1 database_guid, last_recovery_fork_guid FROM msdb..backupset WHERE database_name = 'iverdba' ORDER BY backup_finish_date DESC ) AS last_guids ON last_guids.database_guid = backupset.database_guid AND last_guids.last_recovery_fork_guid = backupset.last_recovery_fork _guid WHERE (type = 'D' OR type = 'P') AND backupset.backup_finish_date >= CONVERT(datetime,'1970-01-01T00.00.00',126) AND mediafamily.mirror='0' ) AS a WHERE a.BackupSetRank = 1 ORDER BY a.Type; DEBUG: 22385 | [13.27.19][Get-DbaDbBackupHistory] Executing sql query on [DBC-025\DBC025]. Exception calling "ExecuteWithResults" with "1" argument(s): "An exception occurred while executing a Transact-SQL statement or batch." At C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.121\allcommands.ps1:22386 char:13 + $results = $server.ConnectionContext.ExecuteWithResults($ ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ExecutionFailureException DEBUG: 22393 | [13.27.19][Get-DbaDbBackupHistory] Processing as grouped output. DEBUG: 22395 | [13.27.19][Get-DbaDbBackupHistory] 0 result-groups found. PS SQLSERVER:\>