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 | Mar 14, 2016 | Scripting, Windows
Quick side note, not to forget for future. Rename computer Netdom renamecomputer %computername% /newname:Test-Server Join computer to domain Netdom join %computername% /domain:domain.com /UserD:Administrator...
by skufel | Mar 14, 2016 | Network, Scripting, Windows
When you need to use your computer as wireless hotspot, you can easily enable that functionality with PowerShell: Windows PowerShell Copyright (C) 2013 Microsoft Corporation. All rights reserved. PS C:\windows\system32> netsh wlan set hostednetwork...
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 | 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...