Microsoft Lync Server 2013 Monitoring and Archiving : Archiving Configuration (part 2) - Using Cmdlets for Configuration Tasks
Using Cmdlets for Configuration Tasks
As one might logically expect, the policies and configurations can also be created through cmdlets; for example:
New-CsArchivingConfiguration -Identity "site:Santa Clara" -EnableArchiving ImAndWebConf -EnablePurging:$True -PurgeExportedArchivesOnly:$False -BlockOnArchiveFailure:$False -KeepArchivingDataForDays:120 -ArchiveDuplicateMessages:$False
Notice the last argument set in this command: ArchiveDuplicateMessages. This is a good example of where there are options available through the cmdlets that aren’t exposed to the GUI tools.
The power of using cmdlets to manage an application, such as Lync Server 2013, becomes readily evident when you are dealing with a large implementation. By scripting the configuration of the entire environment, you are able to eliminate the human error introduced by having a distributed group of people perform repetitive tasks. Similarly, the script written to perform the configuration immediately becomes the documentation of the configuration. If later changes need to occur, you can perform queries to find the objects and modify them at the same time. If you plan to manage the environment in this manner, it becomes helpful to put some thought into a logical naming convention for policies and configurations. This enables you to search on some common value in the policies and configurations to select them for modification.
In a similar manner, PowerShell-based cmdlets
make it easy to pull configuration reports from a large implementation.
For example, imagine that your company announced a policy that all IMs
will be retained for at least 30 days. More than likely, someone will
ask you to make sure that all your configurations retain messages for
at least 30 days. Rather than scrolling through the GUI to find
configurations with values under 30, you could simply run a cmdlet like
the following to produce a report of all configurations in which the CachePurgingInterval is less than 30 days:
Get-CsArchivingConfiguration | Where {$_.CachePurgingInterval -lt "30"} | select Identity
However, if you were going to do that, why not fix it all at once?
$Array=Get-CsArchivingConfiguration | Where {$_.CachePurgingInterval -lt "30"}
Foreach ($Name in $Array)
{
$Var = $Name.Identity
Set-CsArchivingConfiguration -Identity $var -CachePurgingInterval:30
}
This report searches all configurations in the topology and sets any that have a CachePurgingInterval of less than 30 to 30 without touching any that were already higher than 30.
Archiving Administration
This section reviews common administration tasks for the Lync Server 2013 Archiving role, including Data Export and Purge Mode.
In general, there isn’t much day-to-day administration of the Lync Server 2013 Archiving Server role. Instead, this section focuses on the management of data stored in the Archiving database.
One of the most common tasks you perform
against the Archiving Server is exporting content from the Archive
database. This is performed through the Lync Server Management Shell
using the Export-CsArchivingData cmdlet as follows:
Export-CsArchivingData -DBInstance SQLSRV -StartDate 05/15/2012 -OutputFolder
"C:\Archiving" -UserUri Alex@Companyabc.com
This command exports all sessions pertaining to the UserURI defined in the cmdlet. The output is a series of .eml files that are created in the OutputFolder path.
Archiving Troubleshooting
The Archiving Server role is fairly straightforward; however, there are a few things that commonly go wrong during deployment. This section covers the common issues and areas to check if you find your Archiving Server deployment not going smoothly.
Because a lot of server-to-server connections are involved in an Archiving Server deployment, the most obvious problem area is in ensuring proper permissions. Also, ensure that usernames and passwords are typed correctly. When in doubt, reenter the usernames and passwords used for database access for the Archiving Server. Also, ensure that the accounts aren’t subject to password expiration in Active Directory.
The Lync Server event log is also a good place to check for errors. From the Start menu, select Administrative Tools, and select Event Viewer. Expand the Applications and Services Logs item and select Lync Server. All events related to Lync Server 2013 functions reside here. Often the error description is enough to identify the problem and determine the resolution.
One common cause for Archiving to fail is that the Front End Server isn’t able to install the Archiving agent properly due to a problem with the Message Queuing Service. You might see event ID 30517 in the Lync Server logs or you might see event ID 30509. Although the FE role requires Message Queuing Service, it doesn’t require Message Queuing Directory Integration. However, the Archiving agent does require this. The fix is to simply install the additional feature on the FE servers that are targets for Archiving.