Here it is.
Code:
Break ON
$=SetOption("Explicit","ON")
$=SetOption("WrapAtEOL","ON")

; Initialise local variables {{{
Dim $oFarm,$oServer,$oApplication
Dim $sIni,$sBackupINI,$sApplication,$sApplicationDN,$sBackup
DIM $METAFRAMEWINAPPOBJECT

$sIni=".\PublishedApps.ini"
$sBackupIni=".\PublishedAppsHistory.ini"
$METAFRAMEWINAPPOBJECT=3
;}}}
Color w+/r+ "WARNING" Color w/n " This script will remove all published apps from this server"+@CRLF
" Enter 'Y' to continue, or any other key to exit: " Get $
If $<>"Y" Exit 0 EndIf
@CRLF

; Initialise FARM object {{{
$oFarm=CreateObject("MetaframeCOM.MetaframeFarm")
If @ERROR Or VarType($oFarm)<>9 Abort("Cannot create FARM object",@ERROR,@SERROR) EndIf
$oFarm.Initialize(1)
If @ERROR Abort("Cannot create FARM object",@ERROR,@SERROR) EndIf
; }}}

; Backup all entries for this server to the config file. {{{
$sBackup=@WKSTA+" "+@DATE+" "+@TIME
For Each $sApplication In Split(ReadProfileString($sIni,@WKSTA,""),Chr(10))
If $sApplication
$sApplicationDN=ReadProfileString($sIni,@WKSTA,$sApplication)
$=WriteProfileString($sBackupIni,$sBackup,$sApplication,$sApplicationDN)
$=WriteProfileString($sIni,@WKSTA,$sApplication,"")
EndIf
Next ;}}}

; Remove applications {{{
For Each $oServer in $oFarm.servers
If $oServer.serverName=@WKSTA
Log("Match: "+$oServer.serverName)
For Each $oApplication in $oServer.applications
Log("App: "+$oApplication.appName+" ("+$oApplication.distinguishedName+")")
$=WriteProfileString($sIni,@WKSTA,$oApplication.appName,$oApplication.distinguishedName)
If @ERROR Abort("Cannot add application to backup file",@ERROR,@SERROR) EndIf
$oApplication.LoadData(1)
If @ERROR Abort("Cannot add load application state",@ERROR,@SERROR) EndIf
$oApplication.RemoveServer(@WKSTA)
If @ERROR Abort("Cannot add remove application from server",@ERROR,@SERROR) EndIf
$oApplication.SaveData()
If @ERROR Abort("Cannot save load application state",@ERROR,@SERROR) EndIf
Next
EndIf
Next
; }}}
Exit 0

Function Log($s) ; {{{
@DATE+" "+@TIME+" "+$s+@CRLF
EndFunction ; }}}

Function Abort($s,$iError,$sError) ; {{{
Log($s+IIF($iError="",""," ["+$iError+"]")+IIF($iError="",""," "+$sError))
Exit CInt($iError)
EndFunction ; }}}
; vim600:ts=4 sw=4 ai fdc=4 fdm=marker