by skufel | Mar 14, 2016 | Automation, Databases, Infrastructure, Scripting, SysAdmin, Windows
Code snippet from old archives. It shows how to import Windows event log entries to database. Important is to setup database and table accordingly, so it contains apropriate columns. Set objConn = CreateObject("ADODB.Connection") Set...
by skufel | Sep 11, 2015 | Infrastructure, Scripting, SysAdmin, Windows
To remove Event Log Source use this: Remove-EventLog -Source "Desktop Window Manager" Replace Desktop Window Manager with Event Log Source you want to...
by skufel | Sep 11, 2015 | Automation, Infrastructure, Scripting, SysAdmin, Windows
To list all Event Logs and sources associated with them use: Get-EventLog -LogName * |ForEach-Object {$LogName = $_.Log;Get-EventLog -LogName $LogName -ErrorAction SilentlyContinue |Select-Object @{Name= "Log Name";Expression = {$LogName}}, Source...
by skufel | Sep 7, 2015 | HA/DR, Infrastructure, Linux, Network, SysAdmin, Web Servers
Many times there is a need to publish multiple websites from internal network, but there is only one public IP address available. How this can be done easy way? HAProxy can help us with it. In example configuration I have 2 URLs registered to same public IP address:...
by skufel | Aug 4, 2015 | Automation, Infrastructure, Network, Scripting, SysAdmin, Web Servers
If you need to watch IIS application pool and start it once goes down and want to use PowerShell for that here is simple script for that. Script includes also logging all restarts in log file which is created in same folder as script. # AppPool to monitor $AppPoolName...
by skufel | Jul 27, 2015 | Databases, HA/DR, Infrastructure
SQL Server 2012 has very nice HADR technology built-in, AlwaysOn Availability Groups. It allows to have multiple replicas of selected databases across multiple servers, which can be even located across multiple sites. AlwaysOn itself provides mechanism to keep all...