If you want to prevent users are login using their credentials in more than one system in your network, we can apply this below scripts VIA GPO to avoid the concurrent login sessions.
Ex
If User A is logged in SYSTEM1, he won’t be able to login another system at the same time, if he wish to login one more, then he should logoff his existing session.
GPO SettingsLogon Script
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Listing 1: Login.bat
:: BEGIN CALLOUT A
If Exist \\rafetpc\logons\%username%.txt Goto notlogon
Echo %username% logged in from %computername% > \\rafetpc\logons\%username%.txt
Echo %username% logged in from %computername% > \\rafetpc\logons\%computername%.txt
:: END CALLOUT A
Goto end
:notlogon
Logoff
:end
If Exist \\rafetpc\logons\%username%.txt Goto notlogon
Echo %username% logged in from %computername% > \\rafetpc\logons\%username%.txt
Echo %username% logged in from %computername% > \\rafetpc\logons\%computername%.txt
:: END CALLOUT A
Goto end
:notlogon
Logoff
:end
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Logoff Script
Logoff Script
Listing 2: Logout.bat
:: BEGIN CALLOUT A
If Not Exist \\rafetpc\logons\%computername%.txt goto notlogon
Del \\rafetpc\logons\%username%.txt
Del \\rafetpc\logons\%computername%.txt
:: END CALLOUT A
Goto end
:notlogon
Logoff
:end
If Not Exist \\rafetpc\logons\%computername%.txt goto notlogon
Del \\rafetpc\logons\%username%.txt
Del \\rafetpc\logons\%computername%.txt
:: END CALLOUT A
Goto end
:notlogon
Logoff
:end
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
No comments:
Post a Comment