Get Email Alerts for DHCP Scope Full Warnings in Windows Server 2012/2016

Windows DHCP servers used to have email alert functionality built-into the task creation process when events are triggered. Here are steps to use a PowerShell script to replace this functionality and how to customize it. This was split on several different posts, so consolidating it here.

1. PowerShell script – From Cazi Brasga

#DHCP Percent of Addresses Remaining Threshold
$DHCPLowPercentThreshold = 10
#From Email Address
$FromAddress = "dhcpalert@domain.com"
#To Email Address
$ToAddress = "user@domain.com"
#SMTP Server Address
$SmtpServerAddress = "mail.domain.com"

$5MinutesAgo = [DateTime]::Now.AddMinutes(-5)
$DHCPLowEvent = @(Get-EventLog -LogName "System" -After $5MinutesAgo -InstanceID 1020)[0]
$DHCPLowEventMessage = $DHCPLowEvent.Message
$DHCPLowPercent = 100 - $DHCPLowEvent.ReplacementStrings[1]
If ($DHCPLowPercent -le $DHCPLowPercentThreshold){
$messageParameters = @{ 
Subject = "Warning: DHCP Addresses Low" 
Body = "$DHCPLowEventMessage"
From = $FromAddress
To = $ToAddress
SmtpServer = $SmtpServerAddress
} 
Send-MailMessage @messageParameters
}

2. Run your task from “System” user account, so that you do not have to be logged on with your account to run the task.

3. Finally, adjust the threshold of alerting you want.

Open Regedit.exe
Navigate to this path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dhcpserver\Parameters\
Create a REG_DWORD (32 bit) value named DhcpAlertPercentage under Parameters
set it to 85 or 90 (decimal)
Lastly, restart the DHCP service for the change to become active.

FIX – Setting up LDAP Server/Client on Synology NAS for SMB

If you’ve been trying to setup two Synology NAS devices one being a LDAP Server and another the LDAP Client and you cannot connect with your LDAP account to network shares via SMB, here is your fix.

ON SYNOLOGY LDAP SERVER – Control Panel -> File Services -> Windows File Service/SMB -> Disable “Enable SMB2 and Large MTU”

ON SYNOLOGY LDAP CLIENT – Control Panel -> Directory Service > Enable Windows CIFS support

The only way I could get LDAP between two Synology NAS’s to work with SMB was making sure BOTH of the above are set, not just one or the other.

How to Fix Windows 7/8 “Play To” feature when it stops working.

“Play To” is a feature of Windows 7 and 8 that will push content from a local computer to a compatible rendering device. In my case, I push video files from my local computer to my Xbox 360 in just a few clicks. It works great… when it’s working.

Thankfully when the “Play To” fails to open the application on the computer to push to a device, there’s an easy fix.
Simply open Task Manager and look for “Windows Digital Media Controller Application” in processes and kill it.

Then go back to the “Play To” menu and try again and it will work.