E=mc2
asked on
Powershell script that sends an email upon login with the username
There is a need for a Powershell script which will trigger on login, which will send the name of the username which just logged in, to a specified email address.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It will automatically retrieve the username and computername of the user that just logged in, and send the email.
ASKER
Thank you, I will try it and report back.
ASKER
This does not seem to work. Which variables do I input?
I wonder if you might have anti-virus software that is blocking the email from sending?
We use McAfee anti-virus, and need to enable the "mass mail" rule to allow a machine to send emails through the SMTP server.
The variables you need to change are these three:
$strSMTPServer = "yourmailserver"
$strFrom = "logins@domain.com"
$strTo = "admin@domain.com"
where the $strSMTPServer is the name of your SMTP server (that may need to allow relay from your machines sending email), and the other two are your "from" and "to" addresses.
Rob.
We use McAfee anti-virus, and need to enable the "mass mail" rule to allow a machine to send emails through the SMTP server.
The variables you need to change are these three:
$strSMTPServer = "yourmailserver"
$strFrom = "logins@domain.com"
$strTo = "admin@domain.com"
where the $strSMTPServer is the name of your SMTP server (that may need to allow relay from your machines sending email), and the other two are your "from" and "to" addresses.
Rob.
ASKER
I will try again.. and report back.
ASKER