none
PowerShell Notification Script for Login Servers... RRS feed

  • Question

    • Dears,

    I'm looking for PowerShell script when any users login to the windows server 2012 to send me notification email, I wants to use task schedule for that, my point is we have many servers, and I need message come to my email when any users login to the servers should notify me with the user name and IP address for his computer, in windows servers 2012 in task schedule there is no email sending active, so I wants to use PowerShell script instead of that, appreciate your support.

    Thanks.

    Tuesday, July 1, 2014 10:47 AM

All replies

  • Hi,

    try to grab the Event Log like described here

    http://social.technet.microsoft.com/Forums/en-US/afa6bf30-d9dc-4fed-8d68-2235f5f20d80/powershell-geteventlog-to-export-logs-based-on-target-machine?forum=dpmpowershell


    Seidl Michael | http://www.techguy.at | twitter.com/techguyat | facebook.com/techguyat

    Tuesday, July 1, 2014 5:47 PM
  • Dear thanks, but I need to use task schedule to send email notification about who logged to server with mention his IP address...
    Wednesday, July 2, 2014 10:28 AM
  • Yes.

    use the Script to get the Event Logs which log the Loggin of Users.

    Grab Informations out of the Log an send it via Mail.

    Put all of this in PoweShell and plan it with Task Sheduler


    Seidl Michael | http://www.techguy.at | twitter.com/techguyat | facebook.com/techguyat

    Wednesday, July 2, 2014 10:34 AM
  • There are two PowerShell scripts in the artical see below

    Get-EventLog-ComputerNameseimi-nb-LogName'Windows PowerShell'|Export-Csvc:\EvetLog.csv 

    and

    get-eventlog -LogName "Operations Manager" | where {$_.Message -match "SCMCRD"}

     which one should I use and put in task seclude, can you give correct PowerShell script and write down here, I need user name and IP address appears in my email notification. Thanks

    Thursday, July 3, 2014 7:09 AM
  • I have written

     get-eventlog -ComputerName -LogName 'Windows PowerShell'|Export-Csvc:\EvetLog.csv but it is not working, the error said missing an argument for parameter computername specify a parameter of type 'System.string[], can you give me exact PowerShell code ?explain to me error type?

    • Edited by Dana.Kadi Monday, July 7, 2014 9:36 AM more info
    Monday, July 7, 2014 9:30 AM