Once upon a time, in a ConfigMgr environment far, far away. There was a variable named SMSDP… 🙂
There are times when its useful to figure out what DP you are currently using, and back in ConfigMgr 2007, when integrated with MDT, there was a variable for that: The SMSDP variable .
Here is a script for ConfigMgr Current Branch that sets that variable:
# Script for setting the SMSDP variable in ConfigMgr Current Branch
#
# Credits to Phil Schwan (@philschwan) for early VBScript version (2013)
#
# Author: Johan Arwidmark (@jarwidmark)
#
# Create TS environment object
$TSEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment
# Get the boot image package ID
$BootImagePackageID = $TSEnv.Value("_SMSTSBootMediaPackageID")
# Get DP from _SMSTSHTTP variable for boot image package
$SMSDPUri = [System.Uri]"$($TSEnv.Value("_SMSTSHTTP$BootImagePackageID"))"
$SMSDP = $SMSDPUri.Host
# Set SMSDP Variable
$TSEnv.Value("SMSDP") = $SMSDP
Just paste the above script in a Run PowerShell Script action in the task sequence, and you're all set.

To verify the variable in WinPE, start PowerShell, and type in the following:
$TSEnv = New-Object -ComObject Microsoft.SMS.TSEnvironment
$TSEnv.Value("SMSDP")

If I have a Status Message Query for a deployment, do I see that info?
Not unless you send the info up as a status message. You can use the free StatGen tool from 2Pint Software to do that: https://2pintsoftware.com/products/free-tool-status-generator-statgen/
/ Johan