@echo off REM This sample program is provided AS IS and may be used, executed, copied and modified without royalty REM payment by customer (a) for its own instruction and study, (b) in order to develop applications REM designed to run with an IBM WebSphere product, either for customer's own internal use or for REM redistribution by customer, as part of such an application, in customer's own products. REM REM Product 5655-FLW, (C) COPYRIGHT International Business Machines Corp., 2006, 2009 REM All Rights Reserved * Licensed Materials - Property of IBM REM Make all env var settings temporary setlocal REM Customizable settings that reflect your installation REM * * * * * * * * * * * * * * * * * REM Adjust the following line to reflect WID installation directory (no quotes around the directory needed) set WID_INSTALL=C:\Program Files\IBM\WID62 REM If you do not use the integrated test environment, set the %PROFILE_HOME% directory directly here: set PROFILE_HOME=%WID_INSTALL%\pf\wps REM Adjust the following line to reflect the SOAP port (default is 8880, but may be 8881, 8882, ...) set SOAP_PORT=8880 REM Adjust the following line to reflect your admin userid, default is admin set ADMIN_UID=admin REM Adjust the following line to reflect your admin password, default is admin (hopefully changed) set ADMIN_PWD=admin REM * * * * * * * * * * * * * * * * * REM End of customizable settings REM set shortcut for the wsadmin command set wsacmd="%PROFILE_HOME%\bin\wsadmin" -conntype SOAP -port %SOAP_PORT% -user %ADMIN_UID% -password %ADMIN_PWD% REM Do some plausibility checks before continuing if NOT exist "%PROFILE_HOME%\bin\launchClient.bat" goto PROFILE_HOME_ERROR REM Make sure local version of this variable is not set set ans= echo Deleting the following users: echo sellerA echo sellerB echo approverA echo approverB echo approverC echo supervisorA echo supervisorB echo ... and deleting the following groups: echo sellers echo approvers echo supervisors set /P ans="... do you want to continue? (Y/N) " if /I "%ans%" EQU "y" goto YES if /I "%ans%" EQU "yes" goto YES goto NO :YES echo Yes - trying to delete 7 users and 3 groups... set cmdu1="$AdminTask deleteUser {-uniqueName uid=sellerA,o=defaultWIMFileBasedRealm}" set cmdu2="$AdminTask deleteUser {-uniqueName uid=sellerB,o=defaultWIMFileBasedRealm}" set cmdu3="$AdminTask deleteUser {-uniqueName uid=approverA,o=defaultWIMFileBasedRealm}" set cmdu4="$AdminTask deleteUser {-uniqueName uid=approverB,o=defaultWIMFileBasedRealm}" set cmdu5="$AdminTask deleteUser {-uniqueName uid=approverC,o=defaultWIMFileBasedRealm}" set cmdu6="$AdminTask deleteUser {-uniqueName uid=supervisorA,o=defaultWIMFileBasedRealm}" set cmdu7="$AdminTask deleteUser {-uniqueName uid=supervisorB,o=defaultWIMFileBasedRealm}" set cmdg1="$AdminTask deleteGroup {-uniqueName cn=sellers,o=defaultWIMFileBasedRealm}" set cmdg2="$AdminTask deleteGroup {-uniqueName cn=approvers,o=defaultWIMFileBasedRealm}" set cmdg3="$AdminTask deleteGroup {-uniqueName cn=supervisors,o=defaultWIMFileBasedRealm}" call %wsacmd% -c %cmdu1% -c %cmdu2% -c %cmdu3% -c %cmdu4% -c %cmdu5% -c %cmdu6% -c %cmdu7% -c %cmdg1% -c %cmdg2% -c %cmdg3% || goto WSADMIN_ERROR1 REM The deleted users and groups will still be in cache up to the next run of the refreshStaffQuery daemon. REM For removing the users and groups from cache immediately, we call this operation explicitly. REM The WAS_HOME directory is needed now; user can set it, otherwise we try to infer it. if NOT "%WAS_HOME%" == "" goto WAS_HOME_IS_SET REM Env var WAS_HOME not set explicitly. Try to infer from PROFILE_HOME setting: set WAS_HOME=%PROFILE_HOME%\..\..\runtimes\bi_v62 REM Now test whether this assumption is true if NOT exist "%WAS_HOME%\ProcessChoreographer\admin\refreshStaffQuery.py" goto WAS_HOME_NOT_SET :WAS_HOME_IS_SET echo "Attempting to refresh People Queries ..." call %wsacmd% -lang jython -f "%WAS_HOME%\ProcessChoreographer\admin\refreshStaffQuery.py" -server server1 goto END :PROFILE_HOME_ERROR echo %~nx0: PROFILE_HOME is set to "%PROFILE_HOME%" echo which seems not to be valid for your machine. echo Please edit the file %~dpnx0 and adjust echo either the WID_INSTALL setting or the PROFILE_HOME setting. echo (returned with no effect). goto END :WSADMIN_ERROR1 echo %~nx0: Error while adding user - abended. goto END :WAS_HOME_NOT_SET echo %~nx0: could not refresh the cache for users and groups. echo Please go to the administrative console, navigate to echo Application servers - server1 - Business Process Choreographer - Human Task Manager - Runtime Configuration echo and click "Refresh People Queries" goto END :NO echo No - returned with no effect. :END PAUSE endlocal