You create a AM Agent script job.
This is a sample script:
DIM sDummy, sSiteName AS String
DIM hKey, iDummy, RC as Integer
IF Instr(OSSTRING, "Window") then
sSiteName = "Not Defined"
hKey = RegOpenKey(HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\services\Netlogon\Parameters")
RC = RegQueryVariable(hKey,"DynamicSiteName",sSiteName,iDummy)
If RC = 0 THEN sSiteName = "Not Defined"
CreateMIFFile(localpath+"Customer_Specific.mif","Customer Specific Data","","")
CreateMIFGroup(localpath+"Customer_Specific.mif","Registry Data","","7")
CreateMIFString(localpath+"Customer_Specific.mif","Registry Data","Site Name",sSiteName,"")
End If