by skufel | Oct 1, 2016 | Automation, Infrastructure, SysAdmin, Windows
Tomasz Jagiello strikes back as guest writer 🙂 This time on Windows Event Collector configuration for DNS Event Log forwarding. Very good how-to with detailed configuration. Design where via Group Policy a Domain Controller group will be configured to forward DNS...
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 | 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 | 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 22, 2015 | Automation, Databases, Scripting, Windows
Recently I went through requirement of running SQL scripts on multiple databases on different servers. As the list of databases was different from script to script I decided to create universal solution, which will allow to easily prepare for deployment and can be...
by skufel | May 11, 2015 | Automation, Scripting, SysAdmin, Windows
If you want to send email from PowerShell script via Google Mail: $SMTPServer = "smtp.gmail.com" $SMTPPort = "587" $SMTPUsername = "sender@gmail.com" $SMTPPassword = "password" $EmailSenderAddress = New-Object...