Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a free or open source way to send emails to new employees when there account is created. I'm ok if its a powershell script, or something else which runs once per day. I'd like to be able to give is a couple of email files exported from outlook as there's a couple of emails I need all the new employees to get.

share|improve this question
Because our AD accounts are integrated with some in-house software we have we used to send an email from the software once the accounts were associated, but it would be nice to do it from the AD itself – Mark Henderson Sep 2 '09 at 1:23
up vote 2 down vote accepted

Since the user is new and wouldn't even know their username yet, I'm not sure the following would help with alerting a new user their account has been created. However, you could schedule the following script to send emails to users. Would the script also need to determine who was recently setup or would you give it a list of usernames to send to? The following script assumes you've saved an array of user email addresses in $userlist.

foreach($user in $userlist) {
   $exportedmessage = "message.eml"    
   $smtpServer = “localhost”
   $msg = new-object Net.Mail.MailMessage
   $att = new-object Net.Mail.Attachment($exportedmessage)
   $smtp = new-object Net.Mail.SmtpClient($smtpServer)
   $msg.From = “”
   $msg.Subject = “Welcome to the Company”
   $msg.Body = “Here is some important information you should keep handdy.”

Save this code as welcome-newuser.ps1. To schedule this task, follow the directions outlined here:

If you use the free Active Directory cmdlets from Quest ( you can use the following PowerShell code to find users created 24 hours prior to "now".

$then = (get-date).AddDays(-1)
get-qaduser | where { $_.creationdate -gt $then } | select email
share|improve this answer
A lot of our users aren't on the domain, so he give them Webmail information. These emails are for things like how to change your password via OWA, how to setup Outlook to hit OWA, etc. Any idea how to get a list of users from AD that were created yesterday? – mrdenny Sep 2 '09 at 6:59
I updated my answer to include code for retrieving the list of users created yesterday. – Marcus Sep 2 '09 at 20:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.