Hey there! Lots of these floating around but finally took a crack at improving the one I’ve been using for a while and felt it’s worth sharing.

I know there are lots of other options but I’ve tried them and always end up coming back to a (comparatively) simple batch script for my trusty R720XD.

I’m using the IPMI Tool packaged with [Dell’s BMC Utility] (https://www.dell.com/support/home/en-us/drivers/driversdetails?driverid=96ph4) but you can easily set a custom path with the IPMITool variable.

Any other relevant details will be prompted for when running the script and can be updated within while it runs.

@echo off
setlocal EnableDelayedExpansion
title Dell Server Fan Control
set IPMITool=C:\"Program Files (x86)"\Dell\SysMgt\bmc\ipmitool
cls

:UpdateServerDetails
echo Enter Server IP or Hostname
echo ===========================
set /p Server=IP or Hostname: 
echo --------------------------
echo - Server Details Updated -
echo --------------------------
pause
cls
goto UpdateCredentials

:UpdateCredentials
echo Enter iDRAC Credentials
echo =======================
set /p UserName=Username: 
set /p Password=Password: 
echo -----------------------
echo - Credentials Updated -
echo -----------------------
pause
cls
goto MainMenu

:MainMenu
echo Select an Option:
echo =====================================
echo     1) Fan Speed - Automatic
echo     2) Fan Speed - Manual
echo     3) Update Credentials
echo     4) Update Server IP/Hostname
echo     5) Exit
echo =====================================

choice /c 12345 /n /m "Enter Mode: "
set "Option=%errorlevel%"

if "%Option%"=="1" goto AutomaticFanSpeed
if "%Option%"=="2" goto ManualFanSpeed
if "%Option%"=="3" goto UpdateCredentials
if "%Option%"=="4" goto UpdateServerDetails
if "%Option%"=="5" goto Exit
echo Please pick an option.
goto MainMenu


:AutomaticFanSpeed
    cls
    !IPMITool! -I lanplus -H !Server! -U !UserName! -P !Password! raw 0x30 0x30 0x01 0x01
    cls
    echo -------------------------------------
    echo - Fan Speed is Currently: Automatic -
    echo -------------------------------------
    goto MainMenu

:ManualFanSpeed
    cls
    echo Setting Fan Speed to Manual
    !IPMITool! -I lanplus -H !Server! -U !UserName! -P !Password! raw 0x30 0x30 0x01 0x00
    set /p FanPercentage=Enter fan speed percentage (0-100): 
    set /a DecValue=%FanPercentage%
    call :ConvertDecToHex %DecValue% HexValue
    !IPMITool! -I lanplus -H !Server! -U !UserName! -P !Password! raw 0x30 0x30 0x02 0xff 0x%HexValue%
    cls
    echo ----------------------------------------
    echo - Fan Speed is Currently: Manual - %FanPercentage%%% -
    echo ----------------------------------------
    goto MainMenu

:Exit
    exit

:ConvertDecToHex
set LOOKUP=0123456789abcdef
set HEXSTR=
set PREFIX=

if "%1" EQU "" (
set "%2=0"
Goto:eof
)
set /a A=%1 || exit /b 1
if !A! LSS 0 set /a A=0xfffffff + !A! + 1 & set PREFIX=f
:loop
set /a B=!A! %% 16 & set /a A=!A! / 16
set HEXSTR=!LOOKUP:~%B%,1!%HEXSTR%
if %A% GTR 0 Goto :loop
set "%2=%PREFIX%%HEXSTR%"
Goto:eof