Tag Archives: log

Veeam backup and Replication – Failed to call RPC function ‘Vss.TruncateSqlLogs’

Today i have this warning in my Veeam Backup and Replication backup job log, for an SQL server:
Failed to finalize guest processing. Details: Failed to call RPC function ‘Vss.TruncateSqlLogs’: Error code: 0x80004005. Failed to invoke func [TruncateSqlLogs]: Unspecified error. Failed to process ‘TruncateSQLLog’ command. Failed to truncate SQL server transaction logs for instances: . See guest helper log.

I found this in the event viewer on the SQL server:
BACKUP failed to complete the command BACKUP LOG [databasename]. Check the backup application log for detailed messages.

So i check the veeam backup log file on the SQL server:
C:\ProgramData\Veeam\Backup
File VeeamGuestHelper_Lastdatefile.log

Where i see this:

19-12-2022 02:08:56 5080 Database found: [databasename]. Recovery model: 1. Is readonly: false. State: 0.
19-12-2022 02:13:56 5080 WARN Cannot truncate SQL logs for database: [databasename]. Code = 0x80040e31
19-12-2022 02:13:56 5080 WARN Code meaning = IDispatch error #3121
19-12-2022 02:13:56 5080 WARN Source = Microsoft OLE DB Driver for SQL Server
19-12-2022 02:13:56 5080 WARN Description = Query timeout expired
19-12-2022 02:13:56 5080 WARN No OLE DB Error Information found: hr = 0x80004005

What i did to fix this error is that i give the user: NT AUTHORITY\SYSTEM the rights db_backupoperator rights to the specific database, that fault.

And also change this timeout value in regedit:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Veeam\Veeam Backup and Replication]
"SqlExecTimeout"=dword:00000600
"SqlLogBackupTimeout"=dword:00003600
"SqlConnectionTimeout"=dword:00000300

And also under WOW6432Node

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\VeeaM\Veeam Backup and Replication]
"SqlLogBackupTimeout"=dword:00003600
"SqlExecTimeout"=dword:00000600
"SqlConnectionTimeout"=dword:00000300

Then try to running the job again.

Powershell: Copy IIS from a time range to a specific folder

I need to search for entry in logfiles between 3/8-2017 and 6/8-2017. So i make this powershell script to prevent search all IIS logfiles.

This script will copy all log files from the orginal IIS log path to a temp log directory, including the parent folder.

	$destination = "c:\temp\log\"
	$files = get-childitem "C:\inetpub\logs\LogFiles\" -Recurse | ? {$_.LastWriteTime -ge "08/02/2017" -and $_.LastWriteTime -le "08/06/2017"}
	Foreach($file in $files) {
		#Test to see if the file already exists in the destination. If not => Move/Copy/Action you want :D
		$directory = Split-Path (Split-Path $file.fullname -Parent) -Leaf
		new-item $destination"\"$directory -type directory
		Copy-Item -Path $file.fullname -Destination $destination"\"$directory

	}

Shring SQL log file

USE [TestDb]
GO
ALTER DATABASE [TestDb] SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE([TestDb_Log], 1)
ALTER DATABASE [TestDb] SET RECOVERY FULL WITH NO_WAIT
GO

 

Where TestDB, is the database name, and TestDB_Log is the SQL Log file name.

Search exchange message tracking log for a particular subject

If you want to search Exchange log for a particular subject, or just a bite of it, you can search witch this commands.

This will also export it to a nice CSV files.

Get-MessageTrackingLog -resultsize unlimited | Where-object {$_.MessageSubject -like "*Kenneth Dalbjerg"} | select-object timestamp,Sender,@{l="Recipients";e={$_.Recipients -join " "}},messageSubject | export-csv c:\KennethDalbjerg.csv

Citrix Xendesktop enable logging on VDI machines

1.     Create a new directory called e:\vdilogging\.
The Network and Local service accounts need to have write access to this folder. If you using vdisk in standard mode, remember to save it on locally harddrive.

2.     Go to c:\Program Files\Citrix\Virtual Desktop Agent\

3.     Open WorkstationAgent.exe.config with notepad

4.     Goto <appSettings>.

5.     Within the <appSettings> tag, insert the following lines:

<add key="LogToCDF" value ="1"/>
<add key="LogFileName" value ="C:\ctxlogging\vda.log"/>

6.     Then you need to restart you desktop machine