Notification when someone login locally or remotely to the server


We have windows server 2008R2. Is there any way that the server sends an email with login details (IP address, location,...etc) when someone login locally or remotely to the server? Or is there any application can do that if this is not doable in server features?

Math TecAsked:
Who is Participating?
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.

Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
It's a way with a script something like this

Here's something similar...
And not, is not doable using server features

And it should be configured on the Active Directory GPO object in the Login/Login scripts feature


$IP =(Test-Connection -ComputerName $computer -Count 1  | Select -ExpandProperty IPV4Address | select -ExpandProperty IPAddressToString)

if ($userName -eq $null) { 
#Function to query the remote computer 
Function queryComputer($computer) { 
    $restartReg = $false 
    ping -n 1 $computer | out-null 
    if ($? -eq $false) { 
        echo "Computer not online. Quitting" 

Open in new window


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
CodeTwo SoftwareSoftware DeveloperCommented:
Sending an email whenever someone logs in will require some heave scripting. You can; however, use the Get-EventLog cmdlet to return  all login and logoff events for the server. Here is a guide on how to do this:
How to check event logs with PowerShell
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
Email Servers

From novice to tech pro — start learning today.