I have an Exchange Server 2010 Enterprise Edition on Windows server 2008 R2 Enterprise Edition x64.My question;
I'm trying to do settings on http://www.ucblogs.net/blogs/exchange/archive/2010/03/23/Automatically-sending-a-_2700_Welcome_2700_-email-to-all-new-user-accounts.aspx
it doesn't working.additionally , it gives me the following result when working powershell script
(New-ReceiveConnector -Name "Internal Relay" -Bindings 0.0.0.0:25 -RemoteIPRanges 127.0.0.1 -AuthMechanism None -Enabled $true -Fqdn "myserver.mydomain.com" -PermissionGroups AnonymousUsers -Server mysever | Add-ADPermission -User "NT AUTHORITY\ANONYMOUS LOGON" -ExtendedRights "ms-Exch-SMTP-Accept-Any-Recipient")
Identity User Deny Inherited
AAAa\bbb NT AUTHORITY\ANON... False False
In the above command, "Extended Rights" no information.
Any Suggestions?
$strScriptName = $MyInvocation.MyCommand.Name
if (!(Get-ItemProperty HKLM:\Software\Innervation\$strScriptName -Name LastRun -EA SilentlyContinue)){
# this is the first time the script has run - let's create the registry key and value for future runs
New-Item -path HKLM:\Software\Innervation -EA SilentlyContinue | Out-Null
New-Item -path HKLM:\Software\Innervation\$strScriptName | Out-Null
New-ItemProperty -path HKLM:\Software\Innervation\$strScriptName -Name "LastRun" -Value (Get-Date) -propertyType String | Out-Null
write-host "Initial configuration completed." -ForegroundColor green
}
# get time stamp from registry so we know when it last ran
$LastRun = Get-Date ((Get-ItemProperty -path HKLM:\Software\Innervation\$strScriptName -Name LastRun).LastRun)
$ElapsedTime = ((Get-Date) - $lastrun).TotalSeconds
$MBXArray = @(Get-Mailbox -ResultSize Unlimited | ? {($_.WhenCreated -gt (Get-Date).AddSeconds(-$ElapsedTime)) -and ($_.ExchangeUserAccountControl -ne "AccountDisabled")})
ForEach ($mailbox in $MBXArray ) {
$strMsgTo = $mailbox.PrimarySMTPAddress
$strMsgBody = "Hello, "+$mailbox.DisplayName+", and welcome to the Contoso family! Please keep this email for future use. It contains vital information.
$SMTPClient.Send($strMsgFrom,$strMsgTo,$strMsgTitle,$strMsgBody)
}
# update registry here with a fresh time stamp
Set-ItemProperty HKLM:\Software\Innervation\$strScriptName -Name "LastRun" -Value (Get-Date) | Out-Null
Above powershell command doesn't working on system which installed Exchange Server 2010 Enterprise Edition.
After it working , it gives me the following error.
HKLM:\Software\Innervation registry key not valid.
How do I make the compatible with Exchange Server 2010 this PowerShell Command ?
Cheers,
Hope to see your expert advise soon. Thanks in advance.
Cheers.
Best Answer
I’m utilizing this script with Exchange 2010 but I had to make a few small tweeks. Also be sure your running this from one of the cass servers First off change the PSSnapin to load the Exchange 2010 module.
After you have the script customized run this section of the command to create a reg key.
Then comment out the last line for testing purposes.
Create a new user account and test your script till your happy. After it works as intended remove the comment.
@Toshana