Share via


AADConnect error: The management agent "xxx.com" failed on run profile "Delta Import" because the database or database log file is full.

On the AADConnect server's Windows event log, if you get an error similar to "The management agent xxx.com failed on run profile Delta Import because the database or database log file is full", probably you need to cleanup AADConnect run profiles history and take backup of SQL Express database.

First of all, please verify that you are running the latest version of AADConnect. In one of my previous blogs, I had posted how to keep AADConnect alway up to date.

1) Clear Run Profiles History.

a) Clear Runs from the GUI manually. In the GUI, while viewing the run history on the Operations Tab, you can select from the Actions menu, “Clear Runs... ”.

b) Run the following PowerShell script to set the purge interval to Daily on the local AADConnect server.

 # Clear Runs interval set to 1 day. Default value is 7 days.
# ----------------------------------------------------------
$DayDiff = New-Object System.TimeSpan 1, 0, 0, 0, 0
Set-ADSyncScheduler -PurgeRunHistoryInterval $DayDiff 
Get-ADSyncScheduler

 

2) Take Full Backup of AADConnect SQL database.

a) Take backup of AADConnect database using your favourite backup software.
b) Take backup of AADConnect database using SSMS manually.

c) Schedule the following TSQL script which takes backup of the database to run Daily on the local AADConnect server.

Edit the script file to reflect the following; change server path and change the AADConnect Database name.

 DECLARE @MyFileName varchar(1000)

SELECT @MyFileName='\\ServerToSave\Path\MyDB_' + REPLACE(convert(nvarchar(20),GetDate(),120),':','-') + '.bak'

BACKUP DATABASE [AADConnectDatabaseXYZ] TO DISK = @MyFileName WITH NOFORMAT, NOINIT, NAME = N'Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

GO

Test this script. Schedule this script on the local AADConnect server using SQLCMD.EXE tool which can be found within SQL server binaries.