Category: PowerShell/Scripting
-
PowerShell Script – Set-PowerCfg
Set-PowerCfg is a simple script that can be used to easily set or check the current power scheme being applied on a Windows host, these are the same settings found in Control Panel > Power Options. This is particularly useful on laptops where CPU throttling may be an issue and you need to easily switch…
Written by
-
Powershell scripts fail when deployed via Group Policy as Startup scripts with Event ID 1055 and 1130
I recently went to deploy a new Powershell based Startup script in my test environment, and while the majority of my Windows machines happily complied, 2 of my test servers that were running Remote Desktop Services did not like the new Startup policy. The script itself was pretty straight forward – it pulled some files…
Written by
-
ELK 5 on Ubuntu: Pt. 3 – Installing and Configuring Beats Agents on Windows Clients
In the previous two posts I went over everything from installing Ubuntu to getting the ELK stack setup and ingesting logs from itself. Now in this final post in the series I am going to cover collecting Windows Event and IIS logs from remote Windows clients. Here is the quick run down of exactly what…
Written by
-
Stopping Bots and Website Scrapers from scanning your sites on IIS with URL Rewriteโฆ
Bots and Website Scrapers can be a serious annoyance to anyone who is responsible for administering a website and the more sites and servers you are responsible the more of a problem it can become. Every request a bot or scraper makes requires some amount of resources on the web server hosting the site, the…
Written by
-
ELK Stack Pt. 2: Collecting logs from remote servers via Beats
In one of my recent posts, Installing Elasticsearch, Logstash and Kibana (ELK) on Windows Server 2012 R2, I explained how to setup and install an ELK server but it was only collecting logs from itself. That in itself isn’t very useful as the real value is when you begin collecting and indexing all of the…
Written by
-
Testing SMTP with Telnet and PowerShell (Cheat Sheet)
This is my cheat sheet for sending E-Mail through a SMTP Server. This is particularly useful when configuring and testing a new SMTP server. PowerShell: Send-MailMessage -SMTPServer hostname -To youremail@domain.com -From none@none.com -Subject “This is a test email” -Body “This is the body of the test email sent via PS.” Telnet: C:\>telnet hostname 25 220…
Written by
-
PowerShell Script: Find the largest files and folders for any drive
Update – 04.06.2021 – I have an updated version of this script that is a little more flexible and has better output, you can find the new script here: /2021/04/powershell-script-quickly-find-the-largest-files/ This is a super easy to use and flexible PowerShell script to find out what the largest files and folders are on a single drive.…
Written by
-
Simple BGInfo AD logon script
This is my simple logon script for the popular BGInfo utility that uses a few batch scripts along with Group Policy to run at each user login. What this script does: Checks to see if bginfo.exe exist on the local machine, if not copy it from the network share to c:\bginfo\ Copy bg.jpg and default.bgi…
Written by
-
Using PowerShell to filter and sort IIS Binding info…
In this post I want to talk about a few PowerShell commands for grabbing info about IIS bindings that utilize the Webadministration Module. When a server is running a lot of sites, sorting through the bindings can be a daunting task especially if you are looking for specific information like say what IP’s are bound…
Written by
-
IIS 7/7.5 – Configuring PHP via FastCGI on Windows Server 2008 R2
PHP is a fantastic dynamic programing language which runs great on IIS, but can be a bit slow at times. Traditionally PHP runs on IIS either as an ISAPI extension or as a Common Gateway Interface (CGI) program, running PHP via FastCGI can be a great way to improve performance depending on your application. In…
Written by