{"id":5293,"date":"2016-06-23T10:59:18","date_gmt":"2016-06-23T08:59:18","guid":{"rendered":"https:\/\/www.derdack.com\/de\/?p=5293"},"modified":"2016-06-23T10:59:18","modified_gmt":"2016-06-23T08:59:18","slug":"automatisch-maintenance-datenbank-log-files-powershell","status":"publish","type":"post","link":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/","title":{"rendered":"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert"},"content":{"rendered":"<p>Enterprise Alert generiert im Laufe der Zeit einige Datenbank-Eintr\u00e4ge und Log-Files. Viele\u00a0davon sind sehr hilfreich f\u00fcr Reporting-Zwecke aber nach einer gewissen Zeit wird immer mehr Speicherplatz verbrauche und das System kann dadurch Performance einb\u00fc\u00dfen.<\/p>\n<p>Es ist daher empfehlenswert historische Datenbank-Eintr\u00e4ge und alte Log-Files von Zeit zu Zeit zu l\u00f6schen. Um dies komfortable zu erm\u00f6glichen, stellt Derdack ein Maintenance Script in PowerShell bereit. Dieses kann manuell oder automatisiert ausgef\u00fchrt werden. Zum Beispiel kann das vom Windows Task Scheduler aus in bestimmten Intervallen (zum Beispiel\u00a0w\u00f6chentlich oder\u00a0monatlich) \u00a0geschehen. Wir empfehlen das Script zu Zeiten mit m\u00f6glichst geringer Last auszuf\u00fchren, da das Script selber die Datenbank zus\u00e4tzlich belastet.<\/p>\n<p>Am Anfang des Scripts findet sich eine Sektion mit der Konfiguration. Diese kann entsprechend dem jeweiligen Szenario angepasst werden.<\/p>\n<p>Das PowerShell Script sieht wie folgt aus:<br \/>\n<em>&lt;#<\/em><br \/>\n<em>This script deletes Log messages from Enterprise Alert<\/em><br \/>\n<em>from Folders and Tables older than configured in $keeplogdays.<\/em><\/p>\n<p><em>To set up this script, please configure settings below in the CONFIGURATION section.<\/em><\/p>\n<p><em>Works with Enterprise Alert 2012, 2015, 2016<\/em><\/p>\n<p><em>\u00a9 2008-2016 Derdack GmbH, www.derdack.com, Enterprise Alert is a registered trademark of Derdack GmbH<\/em><br \/>\n<em>#&gt;<\/em><\/p>\n<p><em># History:<\/em><br \/>\n<em># 22.06.2015 HF &#8211; Delete Version and Logging revised for EA 2015<\/em><br \/>\n<em># 14.04.2015 HF &#8211; Tables added [EmergencyCalloutAlerts], [RemoteActionsHistory], [RemoteJobsHistory]<\/em><br \/>\n<em># 17.04.2014 HF &#8211; Connection String<\/em><br \/>\n<em># 16.04.2014 HF &#8211; add writes Log File<\/em><br \/>\n<em># 07.04.2014 HF &#8211; First Version<\/em><\/p>\n<p><em>#requires -version 3<\/em><br \/>\n<em>#endregion &#8211; Header<\/em><\/p>\n<p><em>#region &#8211; Configuration<\/em><br \/>\n<em>#=============================================================================<\/em><br \/>\n<em>#CONFIGURATION<\/em><br \/>\n<em>#=============================================================================<\/em><\/p>\n<p><em># Database connection String<\/em><br \/>\n<em>$dbConnectionString = &#8222;Server=sqlserver;Trusted_Connection=No;UID=SA;PWD=Derdack!;Database=EnterpriseAlert;&#8220;<\/em><br \/>\n<em># &#8222;Server=localhost\\SQLEXPRESS;Database=MMEA;Trusted_Connection=True;&#8220;<\/em><\/p>\n<p><em>#keep all logs from the last xx days<\/em><br \/>\n<em>$keeplogdays = &#8222;60&#8220;<\/em><\/p>\n<p><em>#Main log Folder<\/em><br \/>\n<em>$logFolders = @(&#8222;C:\\Program Files (x86)\\Enterprise Alert\\Logs&#8220;,&#8220;C:\\Program Files (x86)\\Enterprise Alert\\ScriptingHost\\Logs&#8220;)<\/em><\/p>\n<p><em>#Tables to truncate Log Tables (tablename,columnname of time to compare)<\/em><br \/>\n<em>$DBlogTables = @(@(&#8222;MMEVENTS&#8220;,&#8220;MSGTIMESTAMP&#8220;) ,@(&#8222;EAEvents&#8220;,&#8220;Timestamp&#8220;))<\/em><\/p>\n<p><em>#Tables to truncate Message and Tickt Tables<\/em><br \/>\n<em>$DBMsgTables = @(@(&#8222;MMINBOUND&#8220;,&#8220;MSGTIMESTAMP&#8220;),@(&#8222;MMOUTBOUND&#8220;,&#8220;MSGTIMESTAMP&#8220;),@(&#8222;MMTICKETS&#8220;,&#8220;CREATIONTIME&#8220;),@(&#8222;MMTICKETMESSAGES&#8220;,&#8220;SENDINGTIME&#8220;),@(&#8222;PolicyExecutionJournal&#8220;,&#8220;Timestamp&#8220;), @(&#8222;EmergencyCalloutAlerts&#8220;,&#8220;CreationTime&#8220;),@(&#8222;EmergencyCalloutInstances&#8220;,&#8220;LastTimestamp&#8220;), @(&#8222;RemoteActionsHistory&#8220;,&#8220;Created&#8220;), @(&#8222;RemoteJobsHistory&#8220;,&#8220;CreationTime&#8220;))<\/em><\/p>\n<p><em>#logMessage for E-mail<\/em><br \/>\n<em>$emailMessage = &#8222;Run Log Message&#8220;<\/em><\/p>\n<p><em>#Name of log File for this Script<\/em><br \/>\n<em>$LogfileNameFQDN = $logFolders[0] + &#8222;\\LOG_DELETE\\{0:yyyy-MM-dd}_{1}_{2}.log&#8220; -f (Get-Date),$env:COMPUTERNAME,&#8220;&#8220;<\/em><\/p>\n<p><em>#static variables<\/em><br \/>\n<em>$crlf = &#8222;`r`n&#8220;<\/em><\/p>\n<p><em>#endregion &#8211; Configuration<\/em><\/p>\n<p><em>#region &#8211; Function<\/em><\/p>\n<p><em>#truncates Tables from MMEA Database<\/em><br \/>\n<em>function .runSQL<\/em><br \/>\n<em>{<\/em><br \/>\n<em>param( [String]$dbConnectionString,<\/em><br \/>\n<em>[String]$SQLStatement<\/em><\/p>\n<p><em>)<\/em><br \/>\n<em>try {<\/em><br \/>\n<em>$conn = New-Object System.Data.SqlClient.SqlConnection<\/em><br \/>\n<em>$conn.ConnectionString = $dbConnectionString<\/em><br \/>\n<em>$conn.Open()<\/em><br \/>\n<em>$emailMessage = $emailMessage + $crlf + &#8222;Run SQL &#8220; + $SQLStatement<\/em><br \/>\n<em>$cmd = New-Object System.Data.SqlClient.SqlCommand($SQLStatement,$conn)<\/em><br \/>\n<em>$rdr = $cmd.ExecuteNonQuery()<\/em><br \/>\n<em>$emailMessage = $emailMessage + $crlf + &#8222;Run SQL &#8220; + $rdr<\/em><\/p>\n<p><em>}<\/em><br \/>\n<em>catch{<\/em><br \/>\n<em>return &#8222;Error running: &#8220; + $SQLStatement<\/em><br \/>\n<em>}<\/em><br \/>\n<em>return [string]$rdr<\/em><br \/>\n<em>$conn.close()<\/em><\/p>\n<p><em>}<\/em><\/p>\n<p><em>function .checkTableCount<\/em><br \/>\n<em>{<\/em><br \/>\n<em>param( [String]$dbConnectionString,<\/em><br \/>\n<em>[String]$SQLStatement<\/em><br \/>\n<em>)<\/em><\/p>\n<p><em>#Write-output &#8222;IDcounter is: &#8220; $SQLStatement<\/em><br \/>\n<em>$connectionString = $dbConnectionString<\/em><\/p>\n<p><em>$connection = New-Object System.Data.SqlClient.SqlConnection<\/em><br \/>\n<em>$connection.ConnectionString = $connectionString<\/em><br \/>\n<em>$connection.Open()<\/em><br \/>\n<em>$command = $connection.CreateCommand()<\/em><br \/>\n<em>$command.CommandText = $SQLStatement<\/em><br \/>\n<em>$ID = $command.ExecuteScalar()<\/em><br \/>\n<em>$connection.Close()<\/em><\/p>\n<p><em>return $ID<\/em><br \/>\n<em>}<\/em><\/p>\n<p><em># Thank you goes to: http:\/\/blog.danskingdom.com\/powershell-functions-to-delete-old-files-and-empty-directories\/<\/em><\/p>\n<p><em># Function to remove all empty directories under the given path.<\/em><br \/>\n<em># If -DeletePathIfEmpty is provided the given Path directory will also be deleted if it is empty.<\/em><br \/>\n<em># If -OnlyDeleteDirectoriesCreatedBeforeDate is provided, empty folders will only be deleted if they were created before the given date.<\/em><br \/>\n<em># If -OnlyDeleteDirectoriesNotModifiedAfterDate is provided, empty folders will only be deleted if they have not been written to after the given date.<\/em><br \/>\n<em>function Remove-EmptyDirectories([parameter(Mandatory)][ValidateScript({Test-Path $_})][string] $Path, [switch] $DeletePathIfEmpty, [DateTime] $OnlyDeleteDirectoriesCreatedBeforeDate = [DateTime]::MaxValue, [DateTime] $OnlyDeleteDirectoriesNotModifiedAfterDate = [DateTime]::MaxValue)<\/em><br \/>\n<em>{<\/em><br \/>\n<em>Get-ChildItem -Path $Path -Recurse -Force -Directory | Where-Object { (Get-ChildItem -Path $_.FullName -Recurse -Force -File) -eq $null } |<\/em><br \/>\n<em>Where-Object { $_.CreationTime -lt $OnlyDeleteDirectoriesCreatedBeforeDate -and $_.LastWriteTime -lt $OnlyDeleteDirectoriesNotModifiedAfterDate } |<\/em><br \/>\n<em>Remove-Item -Force -Recurse<\/em><\/p>\n<p><em># If we should delete the given path when it is empty, and it is a directory, and it is empty, and it meets the date requirements, then delete it.<\/em><br \/>\n<em>if ($DeletePathIfEmpty -and (Test-Path -Path $Path -PathType Container) -and (Get-ChildItem -Path $Path -Force) -eq $null -and<\/em><br \/>\n<em>((Get-Item $Path).CreationTime -lt $OnlyDeleteDirectoriesCreatedBeforeDate) -and ((Get-Item $Path).LastWriteTime -lt $OnlyDeleteDirectoriesNotModifiedAfterDate))<\/em><br \/>\n<em>{ Remove-Item -Path $Path -Force }<\/em><br \/>\n<em>}<\/em><\/p>\n<p><em># Thank you goes to: http:\/\/blog.danskingdom.com\/powershell-functions-to-delete-old-files-and-empty-directories\/<\/em><br \/>\n<em># Function to remove all files in the given Path that were created before the given date, as well as any empty directories that may be left behind.<\/em><br \/>\n<em>function Remove-FilesCreatedBeforeDate([parameter(Mandatory)][ValidateScript({Test-Path $_})][string] $Path, [parameter(Mandatory)][DateTime] $DateTime, [switch] $DeletePathIfEmpty)<\/em><br \/>\n<em>{<\/em><br \/>\n<em>Get-ChildItem -Path $Path -Recurse -Force -File | Where-Object { $_.CreationTime -lt $DateTime } | Remove-Item -Force<\/em><br \/>\n<em>Remove-EmptyDirectories -Path $Path -DeletePathIfEmpty:$DeletePathIfEmpty -OnlyDeleteDirectoriesCreatedBeforeDate $DateTime<\/em><br \/>\n<em>}<\/em><\/p>\n<p><em># Funktion send a E-mail to the SMTP Server<\/em><br \/>\n<em>function sendSmtpMail<\/em><br \/>\n<em>{<\/em><br \/>\n<em>param( [String]$Smtpserver,<\/em><br \/>\n<em>[String]$MessageBody<\/em><br \/>\n<em>)<\/em><\/p>\n<p><em>$from = &#8222;mmea-check-{0}@XXX.net&#8220; -f $env:COMPUTERNAME<\/em><br \/>\n<em>$to = &#8222;mmea-smtp-check@XXX.net&#8220;<\/em><br \/>\n<em>$Subject = &#8222;MMEA-SMTPCHECK-{0}&#8220; -f $env:COMPUTERNAME<\/em><br \/>\n<em>$Body = $MessageBody<\/em><br \/>\n<em>Send-MailMessage -From $from -To $to -SmtpServer $Smtpserver -Body $Body -Subject $Subject -ErrorAction SilentlyContinue<\/em><br \/>\n<em>#return $?,$null<\/em><\/p>\n<p><em>}<\/em><\/p>\n<p><em># Function writes a Log File<\/em><br \/>\n<em>function writeLogFile<\/em><br \/>\n<em>{<\/em><br \/>\n<em>param(<\/em><br \/>\n<em>[String]$Message,<\/em><br \/>\n<em>[String]$LogfileName<\/em><br \/>\n<em>)<\/em><\/p>\n<p><em>if ((Test-Path $LogfileName) -eq $false)<\/em><br \/>\n<em>{<\/em><br \/>\n<em>New-Item $LogfileName -ItemType file -Force | Out-Null<\/em><br \/>\n<em>}<\/em><br \/>\n<em>$Message | Out-File $LogfileName -Append<\/em><\/p>\n<p><em>}<\/em><\/p>\n<p><em>function .deleteDBLogEntries{<\/em><br \/>\n<em>param(<\/em><br \/>\n<em>$DBTables<\/em><br \/>\n<em>)<\/em><\/p>\n<p><em># Delete all DB Logs<\/em><br \/>\n<em>foreach ($Tables in $DBTables) {<\/em><\/p>\n<p><em>#getlast ID<\/em><br \/>\n<em>$IDcounter = 100<\/em><br \/>\n<em>$Iterations = 0<\/em><br \/>\n<em>#Write-output &#8222;IDcounter Start is: &#8220; $IDcounter<\/em><br \/>\n<em>while ($IDcounter -ne 0) {<\/em><br \/>\n<em>$sqlstaementCounter = &#8222;Select Top(1000) CAST(id as int) as lastID FROM &#8220; + $Tables[0] +&#8220; WHERE DATEDIFF(dd,&#8220; + $Tables[1] + &#8220; , GETDATE()) &gt;= &#8222;+ $keeplogdays + &#8220; order by ID desc&#8220;<\/em><br \/>\n<em>$LastID = .checkTableCount -dbConnectionString $dbConnectionString -SQLStatement $sqlstaementCounter<\/em><\/p>\n<p><em>if ($LastID -le 0 ){<\/em><br \/>\n<em>$IDcounter = 0<\/em><br \/>\n<em>break<\/em><br \/>\n<em>}<\/em><br \/>\n<em>#now delete first part<\/em><br \/>\n<em>$sqlstaement = &#8222;DELETE top(1000) FROM &#8220; + $Tables[0] + &#8220; WHERE ID &lt; &#8220; + $LastID<\/em><br \/>\n<em>$Iterations = $Iterations + 1<\/em><br \/>\n<em>$Success = (.runSQL -dbConnectionString $dbConnectionString -SQLStatement $sqlstaement)<\/em><\/p>\n<p><em>$RestNumbersStaetment = &#8222;Select CAST(count(id) as int) as Maxnumbers FROM &#8220; + $Tables[0] + &#8220; WHERE ID &lt; &#8220; + $LastID<\/em><br \/>\n<em>$IDcounter = .checkTableCount -dbConnectionString $dbConnectionString -SQLStatement $RestNumbersStaetment<\/em><\/p>\n<p><em>}<\/em><br \/>\n<em>$Message = $Message + $crlf + &#8222;Cleanup for: &#8220; + $Tables[0] + &#8220; Iterations: &#8220; + $Iterations<\/em><br \/>\n<em>}<\/em><br \/>\n<em>return $Message<\/em><br \/>\n<em>}<\/em><\/p>\n<p><em>#endregion &#8211; Function<\/em><\/p>\n<p><em>#region &#8211; Main<\/em><br \/>\n<em>$emailMessage = &#8222;Start &#8220; + (Get-Date)<\/em><br \/>\n<em>$emailMessage = $emailMessage + $crlf + &#8222;Cleanup Days from &#8220; + ((Get-Date).AddDays(-$keeplogdays))<\/em><\/p>\n<p><em># Delete all files<\/em><br \/>\n<em>foreach ($logFolder in $logFolders) {<\/em><br \/>\n<em>$emailMessage = $emailMessage + $crlf + &#8222;Cleanup &#8220; + $logFolder<\/em><br \/>\n<em>Remove-FilesCreatedBeforeDate -Path $logFolder -DateTime ((Get-Date).AddDays(-$keeplogdays)) -DeletePathIfEmpty<\/em><\/p>\n<p><em>}<\/em><\/p>\n<p><em># Delete all DB Logs<\/em><br \/>\n<em>$emailMessage = $emailMessage + $crlf + [string](.deleteDBLogEntries -DBTables $DBlogTables)<\/em><br \/>\n<em>$emailMessage = $emailMessage + $crlf + [string](.deleteDBLogEntries -DBTables $DBMsgTables)<\/em><\/p>\n<p><em>$emailMessage = $emailMessage + $crlf + &#8222;Log End &#8220; + (Get-Date)<\/em><br \/>\n<em>#sendSmtpMail -Smtpserver $env:COMPUTERNAME + -MessageBody $emailMessage<\/em><br \/>\n<em>writeLogFile -Message $emailMessage -LogfileName $LogfileNameFQDN<\/em><\/p>\n<p><em>#endregion &#8211; Main<\/em><\/p>\n<div class=\"clearfix\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Enterprise Alert generiert im Laufe der Zeit einige Datenbank-Eintr\u00e4ge und Log-Files. Viele\u00a0davon sind sehr hilfreich f\u00fcr Reporting-Zwecke aber nach einer gewissen Zeit wird immer mehr Speicherplatz verbrauche und das System kann dadurch Performance einb\u00fc\u00dfen. Es ist daher empfehlenswert historische Datenbank-Eintr\u00e4ge und alte Log-Files von Zeit zu Zeit zu l\u00f6schen. Um dies komfortable zu erm\u00f6glichen, stellt<\/p>\n<p class=\"cv-read-more-button\"><a class=\"cv-button button is-standard color-accent has-icon icon-after\" href=\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/\">Continue Reading<i class=\"button-icon icon-right-open-big\"><\/i><\/a><\/p>\n","protected":false},"author":11,"featured_media":5294,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[478,479,477,274,480],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert<\/title>\n<meta name=\"description\" content=\"Maintenance - Automatischen L\u00f6schen von historischen Datenbank-Eintr\u00e4gen und alten Log-Files in Enterprise Alert mit einem einfachen PowerShell Script.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert\" \/>\n<meta property=\"og:description\" content=\"Maintenance - Automatischen L\u00f6schen von historischen Datenbank-Eintr\u00e4gen und alten Log-Files in Enterprise Alert mit einem einfachen PowerShell Script.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Derdack DE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/derdack?ref=ts\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-23T08:59:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.derdack.com\/de\/wp-content\/uploads\/sites\/5\/2016\/06\/Smiling-man.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"311\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@derdack\" \/>\n<meta name=\"twitter:site\" content=\"@derdack\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"ronald\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.derdack.com\/de\/#website\",\"url\":\"https:\/\/www.derdack.com\/de\/\",\"name\":\"Derdack DE\",\"description\":\"Alarmierung und mobile St\u00f6rfallreaktion f\u00fcr kritische Systeme\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.derdack.com\/de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de-DE\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#primaryimage\",\"url\":\"https:\/\/www.derdack.com\/de\/wp-content\/uploads\/sites\/5\/2016\/06\/Smiling-man.jpg\",\"contentUrl\":\"https:\/\/www.derdack.com\/de\/wp-content\/uploads\/sites\/5\/2016\/06\/Smiling-man.jpg\",\"width\":600,\"height\":311,\"caption\":\"Man in headphones with a laptop\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#webpage\",\"url\":\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/\",\"name\":\"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert\",\"isPartOf\":{\"@id\":\"https:\/\/www.derdack.com\/de\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#primaryimage\"},\"datePublished\":\"2016-06-23T08:59:18+00:00\",\"dateModified\":\"2016-06-23T08:59:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.derdack.com\/de\/#\/schema\/person\/45ea5442287c9b1738f56eb0b7770123\"},\"description\":\"Maintenance - Automatischen L\u00f6schen von historischen Datenbank-Eintr\u00e4gen und alten Log-Files in Enterprise Alert mit einem einfachen PowerShell Script.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.derdack.com\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.derdack.com\/de\/#\/schema\/person\/45ea5442287c9b1738f56eb0b7770123\",\"name\":\"ronald\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/www.derdack.com\/de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0dc470a8dfd7dcdcdc8a1f0e78de308?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0dc470a8dfd7dcdcdc8a1f0e78de308?s=96&d=mm&r=g\",\"caption\":\"ronald\"},\"url\":\"https:\/\/www.derdack.com\/de\/author\/ronald\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert","description":"Maintenance - Automatischen L\u00f6schen von historischen Datenbank-Eintr\u00e4gen und alten Log-Files in Enterprise Alert mit einem einfachen PowerShell Script.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/","og_locale":"de_DE","og_type":"article","og_title":"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert","og_description":"Maintenance - Automatischen L\u00f6schen von historischen Datenbank-Eintr\u00e4gen und alten Log-Files in Enterprise Alert mit einem einfachen PowerShell Script.","og_url":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/","og_site_name":"Derdack DE","article_publisher":"https:\/\/www.facebook.com\/derdack?ref=ts","article_published_time":"2016-06-23T08:59:18+00:00","og_image":[{"width":600,"height":311,"url":"https:\/\/www.derdack.com\/de\/wp-content\/uploads\/sites\/5\/2016\/06\/Smiling-man.jpg","type":"image\/jpeg"}],"twitter_card":"summary","twitter_creator":"@derdack","twitter_site":"@derdack","twitter_misc":{"Verfasst von":"ronald","Gesch\u00e4tzte Lesezeit":"5 Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.derdack.com\/de\/#website","url":"https:\/\/www.derdack.com\/de\/","name":"Derdack DE","description":"Alarmierung und mobile St\u00f6rfallreaktion f\u00fcr kritische Systeme","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.derdack.com\/de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de-DE"},{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#primaryimage","url":"https:\/\/www.derdack.com\/de\/wp-content\/uploads\/sites\/5\/2016\/06\/Smiling-man.jpg","contentUrl":"https:\/\/www.derdack.com\/de\/wp-content\/uploads\/sites\/5\/2016\/06\/Smiling-man.jpg","width":600,"height":311,"caption":"Man in headphones with a laptop"},{"@type":"WebPage","@id":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#webpage","url":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/","name":"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert","isPartOf":{"@id":"https:\/\/www.derdack.com\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#primaryimage"},"datePublished":"2016-06-23T08:59:18+00:00","dateModified":"2016-06-23T08:59:18+00:00","author":{"@id":"https:\/\/www.derdack.com\/de\/#\/schema\/person\/45ea5442287c9b1738f56eb0b7770123"},"description":"Maintenance - Automatischen L\u00f6schen von historischen Datenbank-Eintr\u00e4gen und alten Log-Files in Enterprise Alert mit einem einfachen PowerShell Script.","breadcrumb":{"@id":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.derdack.com\/de\/automatisch-maintenance-datenbank-log-files-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.derdack.com\/de\/"},{"@type":"ListItem","position":2,"name":"Automatische Maintenance f\u00fcr Datenbank und Log-Files von Enterprise Alert"}]},{"@type":"Person","@id":"https:\/\/www.derdack.com\/de\/#\/schema\/person\/45ea5442287c9b1738f56eb0b7770123","name":"ronald","image":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/www.derdack.com\/de\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0dc470a8dfd7dcdcdc8a1f0e78de308?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0dc470a8dfd7dcdcdc8a1f0e78de308?s=96&d=mm&r=g","caption":"ronald"},"url":"https:\/\/www.derdack.com\/de\/author\/ronald\/"}]}},"_links":{"self":[{"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/posts\/5293"}],"collection":[{"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/comments?post=5293"}],"version-history":[{"count":3,"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/posts\/5293\/revisions"}],"predecessor-version":[{"id":5297,"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/posts\/5293\/revisions\/5297"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/media\/5294"}],"wp:attachment":[{"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/media?parent=5293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/categories?post=5293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.derdack.com\/de\/wp-json\/wp\/v2\/tags?post=5293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}