How throw out the controller users at night without reboot server?

Product:
Cognos Controller 10.4.2
Cognos Analytics 11.1.7
Microsoft Windows 2019 Server

Issue:
To run a optimization the users need to be out of Cognos Controller – how can i force users off Cognos controller at night?

Suggested Solution:
The Cognos controller code that handles users are inside the IIS application pool, so a restart of the IIS server will force all Cognos controller users out.

Suggestion is to also restart your Cognos Analytics service at the same time. This simple batch script can do it for you, if you run it from a scheduler with desktop access.

REM restart of IIS and then Cognos
REM https://ss64.com/nt/
echo ——– >> d:\temp\restartlog.txt
echo %date% %time% >> d:\temp\restartlog.txt
net stop W3SVC
net start W3SVC

echo Cognos Analytics Restart Begins….. >> d:\temp\restartlog.txt
CALL “d:\Program Files\ibm\cognos\analytics\bin64\cogconfig.bat” -stop
echo Services Stopped >> d:\temp\restartlog.txt
REM rename the cognos server log file for later inspection
rename “d:\Program Files\ibm\cognos\analytics\logs\cognosserver.log” “* %Date:/= % %Time::=.%.txt”

REM wait before start
PING -n 31 127.0.0.1 > nul

CALL “d:\Program Files\ibm\cognos\analytics\bin64\cogconfig.bat” -s

echo %date% %time% >> d:\temp\restartlog.txt
echo Services Started successfully >> d:\temp\restartlog.txt

 

If you have more than one Cognos server, you need to restart the CA11 Content Manager first, then the rest.  Leave at least 15 minutes between the servers restarts.

If users are logged into Cognos Controller Client during restart, they will see this message when they try to do something inside Cognos Controller Client after a restart.
They need to exit there client.

Note: If Cognos Configuration is left open on the Windows server, then this script will not work and Cognos will not start. It is important that you close Cognos Configuration before you exit a Remote Desktop session with the server.

The drawback is that windows event log will have entry like this:

Faulting application name: cogbootstrapservice.exe, version: 11.1.5.2, time stamp: 0x5daf2515
Faulting module name: ntdll.dll, version: 10.0.17763.1728, time stamp: 0x6e7b7e33
Exception code: 0xc0000374
Fault offset: 0x00000000000fa689
Faulting process id: 0x128c

More Information:
https://www.ibm.com/support/pages/how-properly-restart-cognos-analytics-services-windows-scheduler 

https://gist.github.com/gazzdev/6c38f067a62cf04a3c72

https://serverfault.com/questions/355207/what-does-iisreset-do-in-addition-to-recycling-all-application-pools

https://ss64.com/nt/syntax-stampme.html