Does anyone know this about exchange 2007...!
Dear All,when we create an email address on Hotmail/yahoo, we instantly get a welcomeemailfrom the service, I was being asked if this can be done using exchange 2007 !!!Exchange has this ability to send emails when the quota exceeds etc...Like when we create a user's mailbox, exchange sends an email directly in the user's mailbox..intresting one ?Regards,NSMCP,MCTS(Vista),MCSA(Messaging)
July 5th, 2009 11:24am

HI, Per my knowledge Exchange does not have built-in feature with Exchange. You should create script to create new user/Enable mailbox and add welcome message part of that script. You shout aware to write script to send welcome message only mailbox enables users.RegardsChinthaka
Free Windows Admin Tool Kit Click here and download it now
July 5th, 2009 12:42pm

Hi, There is not options to send welcome email. You can write a small script 1. Run the script every one hour 2. Get the list of mailbox created in last one hour from the time of executing the script 3. Send the welcome message to the user if you need assistance in getting the powershell scritp to make this work ? Regards, Krishna|MCTS:M|MCSE:M http://smtpport25.wordpress.com/
July 5th, 2009 9:53pm

Agreed with Chinthaka and Krishna This function may accomplish by using script, please use the Development Forum which would be the most relevant forum for script and programming
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 6:58am

And script could be something like below to send email every 12 hours... Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin $NewUsers = Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).addhours(-12))} foreach ($NewUser in $NewUsers) { $SmtpClient = new-object system.net.mail.smtpClient $MailMessage = New-Object system.net.mail.mailmessage $SmtpClient.Host = "SMTPorHubTransportServer.domain.com" $mailmessage.from = ("Admin@Domain.com") $mailmessage.To.add((Get-Recipient $NewUser).PrimarySMTPAddress) $mailmessage.Subject = Message Subject $mailmessage.Body = Type Body Here... $smtpclient.Send($mailmessage) } You can schedule this by following below article... How To: Schedule PowerShell Script for an Exchange Task http://exchangeshare.wordpress.com/2008/12/08/how-to-schedule-powershell-script-for-an-exchange-task/Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 6th, 2009 7:23am

Thanks everyone for the reply, Amit, I will try to run the script but how will it run after every 12hrs, do we have to schedule it as a task ? Regards, NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 9:46am

Yes, a scheduled task requires to run every 12 hours (or you can change the numger of hours according to your wish in the code) for this script and scirpt will find the users created in last 12 hours and send a mail...Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 6th, 2009 9:49am

Ok sorry i am now visiting the website you reffered to...Regards,NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 9:50am

Dear Amit,The script is giving the following error:[PS] C:\Users\Administrator\Desktop>.\12345.ps1Add-PSSnapin : Cannot add Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.Admin because it is already added. Verify the name of the snap-in and try again.At C:\Users\Administrator\Desktop\12345.ps1:1 char:13+ Add-PSSnapin <<<< Microsoft.Exchange.Management.PowerShell.AdminGet-Recipient : A parameter cannot be found that matches parameter name 'test.local/test/dum dum'.At C:\Users\Administrator\Desktop\12345.ps1:11 char:35+ $mailmessage.To.add((Get-Recipient <<<< $NewUser).PrimarySMTPAddress)Exception calling "Send" with "1" argument(s): "A recipient must be specified."At C:\Users\Administrator\Desktop\12345.ps1:14 char:17+ $smtpclient.Send( <<<< $mailmessage)Any idea...I made a new mailbox on domain test.local of user dumdum@test.localthe name of the hubtransport is isatqo.test.localRegards,NSMCP,MCTS(Vista),MCSA(Messaging)
July 6th, 2009 10:36am

Did you run the script via EMS? EMS has already loaded Microsoft.Exchange.Management.PowerShell.Admin Please use windows powershell if you want to test the script
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 10:40am

Yes, as James told you need to use this in PowerShell (instead of EMS) or remove first line of Add-PSSSnapin in from the script temporary... Also use below script since looks like previous code is creating a problem while setting a recipient in To filed [sorry currently I don't have test environment to try this... :( ] Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin $NewUsers = Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).addhours(-12))} foreach ($NewUser in $NewUsers) { $SmtpClient = new-object system.net.mail.smtpClient $MailMessage = New-Object system.net.mail.mailmessage $SmtpClient.Host = "SMTPorHubTransportServer.domain.com" $mailmessage.from = ("Admin@Domain.com") $Recipient = (Get-Recipient $NewUser).PrimarySMTPAddress $mailmessage.To.add($Recipient) $mailmessage.Subject = Message Subject $mailmessage.Body = Type Body Here... $smtpclient.Send($mailmessage) } Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 6th, 2009 10:46am

Amit, its throwing exceptions, I am not good at scripting otherwise I would have removed the errors. :(I have removed the PSsnapin command because i dont have windows power shell, i am running it on EMS..[PS] C:\Users\Administrator\Desktop>.\12345.ps1The term 'Get-Recipient$' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again.At C:\Users\Administrator\Desktop\12345.ps1:11 char:29+ $Recipient = (Get-Recipient$ <<<< NewUser).PrimarySMTPAddressException calling "Add" with "1" argument(s): "The parameter 'addresses' cannotbe an empty string.Parameter name: addresses"At C:\Users\Administrator\Desktop\12345.ps1:12 char:20+ $mailmessage.To.add( <<<< $Recipient)Exception calling "Send" with "1" argument(s): "A recipient must be specified."At C:\Users\Administrator\Desktop\12345.ps1:15 char:17+ $smtpclient.Send( <<<< $mailmessage)Regards,NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 10:54am

Opps, a space problem. Corrected in the same script, copy and paste again...Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 6th, 2009 10:56am

No luck !!Get-Recipient : A parameter cannot be found that matches parameter name 'test.local/test/dum dum'.At C:\Users\Administrator\Desktop\12345.ps1:11 char:35+ $mailmessage.To.add((Get-Recipient <<<< $NewUser).PrimarySMTPAddress)Exception calling "Send" with "1" argument(s): "A recipient must be specified."At C:\Users\Administrator\Desktop\12345.ps1:14 char:17+ $smtpclient.Send( <<<< $mailmessage)Regards,NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 11:14am

I think you are still using first script...Ok, let's remove confusion. Use this script... -==-==-==-==-==-==-==-==-==-==-==-==-==-==- Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin $NewUsers = Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).addhours(-12))} foreach ($NewUser in $NewUsers) { $SmtpClient = new-object system.net.mail.smtpClient $MailMessage = New-Object system.net.mail.mailmessage $SmtpClient.Host = "SMTPorHubTransportServer.domain.com" $mailmessage.from = ("Admin@Domain.com") $Recipient = (Get-Recipient $NewUser).PrimarySMTPAddress $mailmessage.To.add($Recipient) $mailmessage.Subject = Message Subject $mailmessage.Body = Type Body Here... $smtpclient.Send($mailmessage) } -==-==-==-==-==-==-==-==-==-==-==-==-==-==- Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 6th, 2009 11:18am

Dear Amit,Can you please run and testit on your virtual machine (if you make one)because its not working here, it is unable to get the $newuser object which apparently is also a recipient...Exception calling "Add" with "1" argument(s): "The parameter 'addresses' cannotbe an empty string.Parameter name: addresses"+ $mailmessage.To.add( <<<< $Recipient)Exception calling "Send" with "1" argument(s): "A recipient must be specified."At C:\Users\Administrator\Desktop\12345.ps1:13 char:17+ $smtpclient.Send( <<<< $mailmessage)Regards,NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 11:38am

Sure, I can give a try only after 4-5 hours from now once I reach to home... :) I will give you the correct code after that...Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 6th, 2009 11:42am

Thanks, I shall be waiting...!Regards,NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 6th, 2009 12:14pm

Ok, I just corrected a problem and tested in my lab. This should work... Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin $NewUsers = Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).addhours(-12))} foreach ($NewUser in $NewUsers) { $SmtpClient = new-object system.net.mail.smtpClient $MailMessage = New-Object system.net.mail.mailmessage $SmtpClient.Host = "HubTRole.domain.com" $mailmessage.from = ("Admin@domain.com") $Recipient = (Get-Recipient $NewUser.identity).PrimarySMTPAddress $mailmessage.To.add($Recipient) $mailmessage.Subject = Message Subject $mailmessage.Body = Type Body Here... $smtpclient.Send($mailmessage) } Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 6th, 2009 4:51pm

Dear Amit,Thanks for the script, its working now but something intresting is happening...1) I made a user User1 at 8:45 2) I run the script at 9:00 (I recieved the welcome message) 3) I again make another user User2 at 9:15 4) I run the script at 10:00 (I received the message on both User1 and User2 only User2 should recieve it) it kept sending the message to the new users I am making, logically it should not send the message to the same user it has already sent..i hope you got my point. Regards, NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2009 9:30am

Yes, you need to sync the frequency of script you scheduling and the number of hours in below line.$NewUsers = Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).addhours(-12))}So if you are keeping shceduled task to run every hour, change the "addhours(-XX)" to 1, like below...$NewUsers = Get-User -ResultSize Unlimited | Where {($_.WhenCreated -gt (get-date).addhours(-1))}Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 7th, 2009 9:33am

Dear Amit,The script is working absolutely fine in the virtual although when i used it in the production I am getting some problems, We have over 45,000 users out of which 40,000 are using email from Hotmail Live and the names are in Arabic language..so when i run the script i get countless warning message from all the 40,000 users.. WARNING: Object ABB.LOCAL/KSA/Student/User/s4283 has been corrupted andit is in an inconsistent state. The following validation errors have occurred:WARNING: The DisplayName property contains leading or trailing whitespace,which must be removed.Is there a way we can exclude this warning and run the script..Regards,NSMCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2009 2:28pm

Yes, of course... :) Just add below line into the script at the top, which shouldn't display any warning and silently continue to next user. $ErrorActionPreference = "SilentlyContinue"Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
July 8th, 2009 7:12pm

Dear Amit,I pasted it on the top of my script, but I am still getting the warning..its something related to "trailing whitespaces" !Please help..Regards,MCP,MCTS(Vista),MCSA(Messaging)
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2009 11:56am

Hi everyone: I hope all of you could help me please, What is the syntax if i want to add an image as part of the body message...
June 2nd, 2010 12:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics