切换到宽版
  • 13697阅读
  • 4回复

[求助]exchange2003给新员工发入职欢迎邮件 [复制链接]

上一主题 下一主题
 
只看楼主 倒序阅读 0楼  发表于: 2011-06-13
请问哪位大侠会啊!!!!!
急需谢谢!!!!!
用脚也可以啊!谁会啊!!谢谢!!!!
请高人帮忙谢谢!!!!!?????????????????
分享到

只看该作者 1楼  发表于: 2011-06-13
回 楼主(wangli) 的帖子
这个Exchange自带是没有这个功能的,你需要自己写脚本或者找找看有没有什么第三方的软件可以实现
只看该作者 2楼  发表于: 2011-06-14
你会写吗???
有例子吗

只看该作者 3楼  发表于: 2011-06-14
C#脚本如下:

if (-not((Get-PSSnapin) -match "Microsoft.Exchange.Management.PowerShell.E2010")){ Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 }

$strScriptName = $MyInvocation.MyCommand.Name

# 以下定义一些变量以方便测试

$strMsgFrom = "<test@abc.com>"

$strMsgTitle = "Welcome to Edudcational Alliance Messaging System"

$strMsgTitle2="Second Email"

# 以上字段定义了发件人以及标题,接下来我们为发SMTP邮件建立一个新的对象

$SMTPClient = New-Object Net.Mail.SmtpClient("10.110.0.86")

# 括号内的是集线器传输服务器的IP地址

# 接下来我们截取需要接受这些邮件的邮箱地址列表

$MBXArray = @(get-user –organizationalUnit KU-Test | where-object {$_.RecipientType –eq “User” } | Enable-Mailbox –Database KU-Test |Get-Mailbox) #-Database KU-Test -ResultSize Unlimited)

Start-Sleep -Second 10

# 收件人从$MBXArray中获取

ForEach ($mailbox in $MBXArray ) {

$strMsgTo = $mailbox.PrimarySMTPAddress.tostring()

$strMsgBody = "Hello, "+$mailbox.DisplayName+", and welcome to the Educational Alliance Messaging System! Please keep this email for future use. It contains vital information.


--------------------------------------

Username and password

--------------------------------------

Your network username is '"+$mailbox.SamAccountName+"'. Use your username and password to login to the network. Your password should NEVER be shared with anyone except the I.T. department, and only then when requested. Please do not write it down on anything that can be seen by your coworkers. You will be prompted to change it regularly.

--------------------------------------

Email

--------------------------------------

Your email address is '"+$mailbox.PrimarySMTPAddress+"'.



To access your email, calendar, contacts, and tasks from outside of the building, such as from home, you can do so from any Internet connected computer. Simply open Internet Explorer and go to the Outlook Web Access (OWA) page a





Thank you, and, again, welcome to HEC Education Alliance Messaging System!

The Information Technology Department"

##### 上面是第一封邮件的正文,下面写第二封

$strMsgBody2 = "Hello, "+$mailbox.DisplayName+", and welcome to the Educational Alliance Messaging System! Please keep this email for future use. It contains vital information.



This is Second Email



Thank you, and, again, welcome to HEC Education Alliance Messaging System!

The Information Technology Department"


# 下面是发送邮件的代码

$SMTPClient.Send($strMsgFrom,$strMsgTo,$strMsgTitle,$strMsgBody)

$SMTPClient.Send($strMsgFrom,$strMsgTo,$strMsgTitle2,$strMsgBody2)


}

Exchange中文站10周年献礼。Exchange2016中文视频教程热销中:edu.exchangecn.com/course/12
只看该作者 4楼  发表于: 2011-06-16
楼上的太给力了
快速回复
限60 字节
 
上一个 下一个