Full Cleanup of Old Sites on BES Relay
2 Votes |
Description
This task will rename the GatherState.xml and bfemapfile.xml files on the relay and delete the bfsites folder, then restart the BES Relay service to cleanup old sites and reinitialize the gather process.
When attempting to use this task on all relays, run it first on the bottom tier of relays and work up to the server one tier at a time.
NOTE: This task should be deployed only at the direction of BigFix support.
Property Details
6256 | |
QA - Ready for Production Level Testing | |
Full Cleanup of Old Sites on BES Relay | |
Troubleshooting | |
BigFix | |
5/6/2009 12:00:00 AM | |
Relay gather clean reset | |
SteveHull on 10/20/2015 9:54:24 PM | |
SteveHull on 10/20/2015 9:58:16 PM | |
13986 Views / 214 Downloads | |
* Average over 0 ratings. ** Log In or Register to add your rating. |
Relevance
Actions
Action 1 (default)
Action Link Click
here to deploy this action.
Script Type
BigFix Action Script
// restart the BES Relay first
waithidden cmd.exe /C net stop besrelay
// set starting time
setting "_BESClient_PauseWhile"="{now as string}" on "{parameter "action issue date" of action}" for client
// PAUSE until the relay service stops or 3 minutes has passed.
pause while {(exists running application whose (name of it as lowercase = "besrelay.exe") OR exists running service whose (service name of it as lowercase = "besrelay")) AND (now - (value of setting "_BESClient_PauseWhile" of client as string as time)) < 3*minute}
delete "{value "InboxLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry}\GatherState.xml.bak"
move "{value "InboxLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry}\GatherState.xml" "{value "InboxLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry}\GatherState.xml.bak"
delete "{value "InboxLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry}\bfemapfile.xml.bak"
move "{value "InboxLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry}\bfemapfile.xml" "{value "InboxLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry}\bfemapfile.xml.bak"
waithidden cmd.exe /C rmdir "{value "ContentLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry}" /S /Q
// set starting time
setting "_BESClient_PauseWhile"="{now as string}" on "{parameter "action issue date" of action}" for client
// PAUSE until the bfsites directory is gone or 5 minutes has passed.
pause while {(exists folder (value "ContentLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry as string)) AND (now - (value of setting "_BESClient_PauseWhile" of client as string as time)) < 5*minute}
waithidden cmd.exe /C mkdir "{value "ContentLocation" of key "HKLM\SOFTWARE\BigFix\Enterprise Server\GatherService" of registry as string}"
waithidden cmd.exe /C net start besrelay
// if for some reason the BES Relay hasn't started yet, fail here
continue if{exists running service "BESRelay"}
// then restart the BES Client
delete __appendfile
appendfile @echo off
appendfile echo Your administrator is restarting the BES Client... Please Wait...
appendfile net stop BESClient
appendfile net start BESClient
delete clientRestart.bat
copy __appendfile clientRestart.bat
runhidden cmd.exe /C clientRestart.bat
Success Criteria
This action will be considered successful when the applicability relevance evaluates to false.
Sharing
Social Media: |
Comments
|
|
isn't the success criteria wrong? the applicability is "is the machine a relay", and the success criteria considers successful when the applicability is false, but the task does not remove the relay, hence it will always fail... IMHO, it should be "all lines completed successfully" |