Auditing Logins on a 2012 Server

Here is the question from my customer:

Is there any way of finding out when (day & time) someone signs onto the system and signs out whether they are in the office or log in remotely?  If so, is that something  you can run and send to me?

They are on a Server 2012 Essentials Server. Either Windows 7 or Windows 10 Professional workstations
LVL 15
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

timgreen7077Exchange EngineerCommented:
You can use the Security Event logs on the server to see who and when someone logged into the server. See below for assistance with this:
LockDown32OwnerAuthor Commented:
Thanks Tim. This is going to be something that it looks like this user is going to want to do on a ongoing basis and she isn't that computer savvy. Is there a third party package that might make it easier for her?
timgreen7077Exchange EngineerCommented:
Yes there is 3rd software you can purchase for this also. the below link is just 1 of 100s of 3rd party apps

If you go to google and just type "windows server auditing software" it will give you a ton of options for using 3rd party software for this.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DonNetwork AdministratorCommented:
I keep it simple by me and use login/logoff scripts. The logon creates 2 files. one that continuously updates and the other that gets deleted daily. The logoff script compresses the file so that they turn blue and I can readily see whether they are logged in or not.
@echo off
compact /u \\server1\logs$\%username%.txt
echo %computername%    %Time:~0,5%>>\\server1\logs$\%username%.txt
set loc=
set GW=
:netstat -an |find "3389" |find /I "established" >C:\Result1.txt
:For /F "tokens=3 delims= " %%A IN (C:\Result1.txt) DO SET loc=%%A
:if (%loc%)==() set loc=console

REM you could use this next routine to determine the subnet by grabbing the default gateway

for /f "tokens=2 delims=:" %%a in ('ipconfig ^| find "Gateway"') DO SET GW=%%a
if %GW%== set GW=Brazil    
if %GW%== set GW=London
if %GW%== set GW=China
if %GW%== set GW=Somalia
if %GW%== set GW=Hongkong
if %GW%== set GW=Argentina  
if %GW%== set GW=Biloxi
if %GW%== set GW=Oklahoma
if %GW%== set GW=Scandinavia
if %GW%== set GW=Wyoming
if %GW%== set GW=Montana

REM this grabs the computer ip address

for /f "Tokens=2 Delims=[]" %%i in ('ping -n 1 "%computername%"') do set IP=%%i

echo %username%,,%computername%,,%IP%,,%GW%,,%sessionname%,,%Date:~0,16%,,%Time:~0,5%,,"logged on",,%logonserver% >>\\server1\logs$\logins.csv 

Open in new window

@echo off
compact /c \\server1\logs$\%username%.txt
echo %username%,,%computername%,,%date%,, %time%,,logged off>>\\server1\logs$\logoffs.csv
echo %computername%    %Time:~0,5%,,logged off>>\\server1\logs$\%username%.txt


Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.