Wednesday, June 4, 2014

Errors when installing kb2936871 "Update Rollup 6 for Exchange Server 2010 Service Pack 3"

     Yesterday installed a new update "Update Rollup 6 for Exchange Server 2010 Service Pack 3" to the mail server. The update is available on the link "http://support.microsoft.com/kb/2936871/en-us". Today I want to warn error encountered during an installation . My DAGFileShareWitnesses placed on one of the CAS servers. CAS servers on NetScaler balanced.
1. When installed on a server with the role mailboxes restart service on CAS servers. And as it was supposed to make everything transparent to the user - the first surprise flurry of calls - "but what about the mail?"
2. Second surprise : when you install on a server with the role of CAS permissions to update DAGFileShareWitnesses were changed because of what the mail databases started driving mailboxes between servers. Then open Event Viewer/System you found errors event id 1564 "File Share Witness (): Failed is offline.". To fix this add the right group Exchange Trusted Subsystem on shared folder in DAGFileShareWitnesses as shown in Figure and Stop/Start Cluster Service in Failover Cluster Manager.

Friday, May 23, 2014

Monitoring Exchange ActiveSync connection for specific users

To prevent a situation where the company managers have problems with reading mail from mobile devices, it is desirable to know about problems in advance. This can be done for example in the following script, which sends e-mail the last known good synchronization and the difference with the current time. If the time difference is greater than 3:00 script highlighted.
In this script, you need to replace the following values
"MyManager", "MyDirector" - Display Name from Active Directory
$msg.From, $msg.To.add, $SMTPServer - Your SMTP parameters

Download monitor_active_sync.ps1

# Load Exchange commands
if (!(Get-Command Get-ExchangeServer -ErrorAction SilentlyContinue))
{
    if (Test-Path "C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1")
    {
        . 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'
        Connect-ExchangeServer -auto
    }
    elseif (Test-Path "C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1")
    {
        Add-PSSnapIn Microsoft.Exchange.Management.PowerShell.Admin
        .'C:\Program Files\Microsoft\Exchange Server\bin\Exchange.ps1'
    }
    else
    {
        throw "Exchange Management Shell cannot be loaded"
    }
}

$DeltaTime = $DateNow = $MobileDevices = @()

$DateNow = Get-date
$MobileDevices = Get-ActiveSyncDevice | where { $_.identity -match "MyManager" -or $_.identity -match "MyDirector" } | Sort-Object identity | Get-ActiveSyncDeviceStatistics

$msg = new-object Net.Mail.MailMessage
$msg.Body = "<html> 
<body> 
<font size=""1"" face=""Arial,sans-serif""> 
<h3 align=""center"">Notice about ActiveSync</h3> 
</font><table border=""0"" cellpadding=""3"" style=""font-size:8pt;font-family:Arial,sans-serif""> 
<tr bgcolor=""#009900""> 
<th><font color=""#ffffff"">Identity:</font></th> 
<th><font color=""#ffffff"">DeviceUserAgent:</font></th> 
<th><font color=""#ffffff"">LastSuccessSync GMT:</font></th> 
<th><font color=""#ffffff"">DeltaTime:</font></th> 
</tr>"

Foreach ($MobileDevice in $MobileDevices)
{
    write-host $MobileDevice.Identity "User Agent: " $MobileDevice.DeviceUserAgent "Success Sync GMT: "  $MobileDevice.LastSuccessSync
    if ($MobileDevice.LastSuccessSync)
    {
        $DeltaTime = new-timespan -start ($DateNow.ToUniversalTime()) -end ($MobileDevice.LastSuccessSync)
        write-host "Last sync delta time" $DeltaTime
    }
    else { write-host "No sync" }
    if ($DeltaTime -le '-3:00:00.0000000') { write-host "DeltaTime great 3 hour" }
    $msg.Body += "<tr bgcolor=""#dddddd""><th>$($MobileDevice.Identity)</th>
<th>$($MobileDevice.DeviceUserAgent)</th>
<th>$($MobileDevice.LastSuccessSync)</th>"
    if ($DeltaTime -le '-3:00:00.0000000') { $msg.Body += "<th><b><span style=""color: red;"">$($DeltaTime)</span></b></th>
</tr>"
    }
    else { $msg.Body += "<th>$($DeltaTime)</th>
</tr>"
    }
}

$msg.Body += "</table>
</body></html>"

$msg.Body | Out-File .\report.html
$msg.IsBodyHTML = $true
$msg.From = "FromEmail@YourDomain"
$msg.To.add("YourEmail@YourDomain")
$msg.Subject = "Notice about ActiveSync"
$SMTPServer = "YourEmailServer"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.Send($Msg)

How quickly free up disk space with transaction logs Exchange

If you have a critical situation occurred and an urgent need to release the disc with transaction logs, you can cheat Exchange server as if you made ​​a backup. To do this, follow these steps:

1. Example: Create a folder on drive "C:\Scripts"
2. "C:\Scripts" folder create a file "VSSClean.txt" with content (letters of your disks should be corrected):
# DiskShadow Script File to Fix VSS Writers (PLEASE Do NOT REMOVE)

begin backup
add volume D:
add volume E:
create
end backup
list shadows all
delete shadows all
# End of script

3. "C:\Scripts" folder create a file "VSSClean.cmd" with content:
diskshadow -s C:\Scripts\VSSClean.txt

4. Finally execute the file VSSClean.cmd

A good practice is to create a task on schedule to check the disk is full with logs. For example, the script below checks powershell disc name (in my case it "TLOGS") and if the space is less than 50 gigabytes script is run to remove the logs.

$disks = Get-WmiObject win32_logicaldisk | Where-Object { $_.drivetype -eq 3 }
foreach ($disk in $disks)
{
    $a1 = [math]::Round(($disk.FreeSpace/1073741824), 0)
    if ($disk.VolumeName -match "TLOGS" -and $a1 -le 50)
    {
        start-process C:\Scripts\VSSClean.cmd
    }
}

Download monitor_tlogs.ps1
Download VSSClean.cmd
Download VSSClean.txt

Friday, May 9, 2014

Error "The type initializer for 'Microsoft.Exchange.Diagnostics.ExTraceConfiguration' threw an exception."

After installing KB2506143 "Windows Management Framework 3.0" having problems using Powershell scripts for Microsoft Exchange 2010 with the following error "The type initializer for 'Microsoft.Exchange.Diagnostics.ExTraceConfiguration' threw an exception.". Windows offers a search solution on the Internet, but found nothing. Therefore, we must do the following:
1. Reinstall Exchange Manage Tools
2. In batch scripts to add the parameter "%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -version 2.0"
3. Rename or delete folders in profile "%userprofile%\AppData\Roaming\Microsoft\Exchange\RemotePowerShell"

Wednesday, April 9, 2014

Exchange 2003 Messages with unreachable destination, event id 4003, 984



Faced today with an unusual problem on the server Exchange 2003. Messages to one of the domains are stuck in the queue: "Messages with unreachable destination". Despite all attempts to restart the services and server messages do not go, but using telnet message domain go successfully. To understand the reason I enable the Diagnostic Logging in properties on Exchange server:



and found an interesting event id 4003 and 984 in the Application log: “The domain 'contoso.com' is currently unreachable.”, “NextHopType=CURRENTLY_UNREACHABLE” 


The decision was simple: I created a special connector for this domain and messages go.








Friday, February 21, 2014

iPhone redownload mail from Exchange

IPhone strange behavior found today. When you synchronize mail Exchange 2003 activesync iPhone at certain moments starts to download the mail again. Once out of ideas, I tried to capture traffic using Wireshark and found that iPhone redownload mail when it receives a proposal to change the password to the user. That is, users and iPhone Exchange 2003 should change the password for two weeks before password expiration to avoid constant rebooting mail.
The article http://support.microsoft.com/kb/292589 says that the proposal to cancel the password change notification can not be canceled.

iPhone sends a synchronization request mail
Exchange 2003 server offers change password
and further there is a full load mail.

Thursday, February 20, 2014

Reinstall Web Components on Lync 2013

Sometimes IIS server Lync behaves predictably (For example module OCSAuthModule error on login to the mobile client) :) and the question arises as to reinstall little effort. Below are the steps to reinstall:
1. Uninstall Web Components Server
2. Uninstall Web Conferencing Server, click Yes for deactivate
3. Reboot Server
4. Uninstall IIS URL Rewrite Module 2
5. Click Remove Server Roles, unmark Web Server (IIS) and next  - remove
6. Reboot Server
7. Check and remove .NET Framework 3.5.1 Features
8. Check and remove Windows process Activation Services. Reboot server.
9. Add  role Web Server (IIS)
10. Add Role Services, after install reboot
Static Content
Default Document
HTTP Errors
ASP.NET
.NET Extensibility
Internet Server API (ISAPI) Extensions
ISAPI Filters
HTTP Logging
Logging Tools
Tracing
Windows Authentication
Request Filtering
Static Content Compression
Dynamic Content Compression
IIS Management Console
IIS Management Scripts and Tools
Anonymous Authentication (installed by default when IIS is installed)
Client Certificate Mapping Authentication







11. Run Start - Lync Server Deployment Wizard
12. Install or Update Lync Server System - Setup or Remove Lync Server Components - Run
13. Install latest update for Lync Server. If Kerberos authenticate enable run command: Set-CsKerberosAccountPassword -UserAccount "contoso\KerbAuth"