Lync Server 2013 持久聊天资源工具包工具Lync Server 2013 Persistent Chat Resource Kit Tools

 

上次修改的主题: 2013-02-24Topic Last Modified: 2013-02-24

Lync Server 2013 持久聊天资源工具包工具有助于为部署和管理 Lync Server 2013 持久聊天服务器的 IT 管理员更轻松地执行日常任务。The Lync Server 2013 Persistent Chat Resource Kit tools help to make routine tasks easier for IT administrators who deploy and manage Lync Server 2013 Persistent Chat Server. 除了安装说明之外,本主题还介绍了每个工具的用途及其用法示例。In addition to installation instructions, this topic describes the purpose of each tool, and examples of its use.

资源工具包工具的安装Installation of the Resource Kit Tools

若要安装 Lync Server 2013、资源工具包工具,请下载 PersistentChatReskit.msiTo install the Lync Server 2013, Resource Kit Tools, download PersistentChatReskit.msi. 运行 PersistentChatReskit.msi 以执行简单安装。Run PersistentChatReskit.msi to do a simple installation. .Msi 在以下路径中安装所有工具: \ Program Files \ Microsoft Lync Server 2013 \ Persistent Chat server 资源工具包The .msi installs all the tools in the following path: \Program Files\ Microsoft Lync Server 2013\Persistent Chat Server Resource Kit. 包含自包含可执行文件的工具位于此文件夹中。Tools that are self-contained executables are in this folder. 还包含文件的工具位于自己的子文件夹中。Tools that also have files are in their own subfolders.

重要

安装 Lync Server 2013 (资源工具包工具)后,必须安装PsExec.exe并将PsExec.exe复制到以下路径: \ Program Files \ Microsoft Lync Server 2013 \ Persistent Chat server Resource Kit\ChatStressToolAfter installing the Lync Server 2013, Resource Kit Tools, you must install PsExec.exe and copy PsExec.exe to the following path: \Program Files\ Microsoft Lync Server 2013\Persistent Chat Server Resource Kit\ChatStressTool. 如果不复制 PsExec.exe,持久聊天工具将引发错误异常,且不能正常运行。If you do not copy PsExec.exe, the Persistent Chat Stress Tool will throw an error exception, and not perform correctly. 在运行该工具之前,请确保满足此先决条件要求。Make sure that you meet this prerequisite requirement prior to running the tool. 有关安装 PsExec.exe的详细信息,请参阅 https://go.microsoft.com/fwlink/p/?LinkId=282246For details about installing PsExec.exe, see https://go.microsoft.com/fwlink/p/?LinkId=282246.

支持的环境Supported Environments

为了获得最佳性能,Lync Server 2013,资源工具包工具应安装在相同的环境中,并且具有与 Lync Server 2013 所需的相同规范。For optimal performance, the Lync Server 2013, Resource Kit Tools should be installed in the same environment and with the same specifications that are required for Lync Server 2013.

资源工具包工具概述Resource Kit Tools Overview

以下是 Lync Server 2013 持久聊天资源工具包中提供的工具。Here are the tools that are provided in the Lync Server 2013 Persistent Chat Resource Kit. 下一节提供了每个工具的说明,包括要求和示例用法。The following section provides a description of each tool, including requirements and example usage.

  • AffCheckAffCheck

  • ChatMonitoringSummaryChatMonitoringSummary

  • ChatStress 工具ChatStress Tool

  • ChatUpgradeVerifierChatUpgradeVerifier

  • ChatUsageReportChatUsageReport

  • ScheduleADSyncforPrincipalScheduleADSyncforPrincipal

AffCheckAffCheck

说明Description

AffCheck 工具确认持久聊天后端数据库用户和组附属记录与 Active Directory 域服务的记录相匹配。The AffCheck tool confirms that the Persistent Chat back-end database user and group affiliation records match that of Active Directory Domain Services.

要求Requirements

该工具随加入域的计算机上的 PersistentChatResKit 安装程序一起安装。The tool is installed with the PersistentChatResKit installer on a domain joined machine.

运行该工具所使用的用户帐户必须具有对持久聊天后端数据库和 Active Directory 域服务的读取访问权限。The user account under which the tool is run must have Read access to the Persistent Chat back-end database and Active Directory Domain Services.

用法Usage

根据配置文件中的说明配置 AffCheck.exe.config 文件,并运行不带命令行参数的 AffCheck 工具。Configure the AffCheck.exe.config file according to the instructions in the config file and run the AffCheck tool without command-line parameters. 以下是默认 AffCheck.exe.config 的内容。Following are the contents of the default AffCheck.exe.config.

AffCheck.exe.config:AffCheck.exe.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings>
        <!--Domain Controller IP Address-->
        <add key="LDAP" value="LDAP://0.0.0.0/"/>
        
        <!-- Domain DN  This is case sensitive, it must match exactly-->
        <add key="DomainComponent" value ="DC=DOMAIN,DC=COM"/>
        
        <!--Domain Administrator Login and Password-->
        <add key="DomainLogin" value="DOMAIN\Administrator"/>
        <add key="DomainPassword" value ="password"/>
        
        <!-- Connection string to Group Chat Database-->
        <add key="ConnectionString" value="data source=SQL_SERVER\INSTANCE;initial catalog=DATABASE_NAME;integrated security=SSPI"/>
        
        <!--Check group affiliations-->
        <add key="CheckGroups" value="true"/>
        
        <!--Check user affilations-->
        <add key="CheckUsers" value="true"/>
        
        <!--List all affiliations if there is a mismatch between database and active directory-->
        <add key="ListAffiliations" value="true"/>
    
        <!--If you need to offset the results of the number of affilations in AD(can be negative to add to AD parent count)-->
        <add key="Offset" value ="0"/>
    
        <!--If you need to ignore certain parents, provide a semi colon delimitted list.-->
        <add key="Ignore" value ="DC=uatest,DC=test,DC=contoso,DC=com;DC=test,DC=contoso,DC=com"/>
      </appSettings>
    </configuration>

ChatMonitoringSummaryChatMonitoringSummary

说明Description

PersistentChatMonitoringSummary 工具将持久聊天监视信息从监控数据库移动到指定的 CSV 日志文件中。The PersistentChatMonitoringSummary tool moves Persistent Chat monitoring information from the monitoring database into a specified CSV log file.

CSV 文件将包含按会话总数、成功会话、意外故障、预期失败次数以及诊断 ID、失败次数和失败说明细分意外故障的连续聊天会话的细目。The CSV file will contain a breakdown of Persistent Chat sessions by number of total sessions, successful sessions, unexpected failures, expected failures, and a breakdown of the unexpected failures by diagnostic ID, number of failures, and failure description.

要求Requirements

在有权访问监控数据库的加入域的计算机上安装持久聊天资源工具包工具。Install the Persistent Chat Resource Kit tools on a domain-joined machine that has access to the Monitoring database.

运行该工具所使用的用户帐户必须具有对监控数据库的读取权限。The user account under which the tool runs must have Read access to the Monitoring database.

PersistentChatMonitoringSummary.exe.config 的文件中,必须包含一个 <connectionStrings> 定义监控数据库的连接字符串的节。The file, PersistentChatMonitoringSummary.exe.config, must contain a <connectionStrings> section that defines the connection string to the Monitoring database. 它还必须包含将为其收集监控数据的 PersistentChatEndpointUri 的键,以及将生成的 CSV 文件的位置的文件路径。It must also contain a key for the PersistentChatEndpointUri that the monitoring data will be gathered for, and a file path to a location for the CSV file that will be generated. 有关示例,请参阅已安装的配置文件。Refer to the installed config file for examples. 文件必须与工具位于同一目录中。The file must be located in the same directory as the tool.

用法Usage

    PersistentChatMonitoringSummary [-StartDateTime <date>] [-EndDateTime <date>]

这些参数定义数据的选择:These parameters define the selection of data:

StartDateTime: (可选)指定选择期的开始日期。StartDateTime: Optionally specifies the start date of the selection period. 默认值: 1/1/1753 12:00:00 AMDefault: 1/1/1753 12:00:00 AM

EndDateTime: (可选)指定选择期的结束日期。EndDateTime: Optionally specifies the last date of the selection period. 默认值: NowDefault: Now

示例Example

    C:\Users\Administrator.VDOMAIN>Desktop\PersistentChatMonitoringSummary.exe
    Reading database connection information, Persistent Chat endpoint uri, and csv output path information from the application config file...
    Connecting to Monitoring database with connection string specified in the application config file...
    Gathering Persistent Chat Session Summary information between "1/1/1753 12:00:00 AM" and "11/19/2012 10:11:25 AM" for Persistent Chat Endpoint Uri "persistentChatEndpointUri@domain.com"...
    Press enter to continue or hit ctr-c if these settings are incorrect...
    
    The summary information about Persistent Chat sessions from the Monitoring database has been output to C:\PersistentChatMonitoring_dd4ace24-4c8a-4a3d-8fd4-591bdfacf47b.csv
    Press enter to exit...

持久聊天应力工具Persistent Chat Stress Tool

说明Description

持久聊天压力工具提供了一种简单的方法来模拟持久聊天的使用情况,以测试实际性能,包括各种用户模型以更好地适合预期的使用方案。The Persistent Chat Stress tool provides an easy way to simulate usage of Persistent Chat to test real-world performance, including varied user models to better fit your expected usage scenarios.

要求Requirements

将持久聊天资源工具包工具安装到可访问持久聊天后端数据库的加入域的计算机上。Install the Persistent Chat Resource Kit tools onto a domain-joined machine that has access to the Persistent Chat back-end database.

除了此 控制器 计算机之外,还需要多个 加载程序 计算机。In addition to this controller machine, you will need several loader machines. 对于用户模型中的每个10K 用户,加载项计算机上至少需要4GB 的可用 RAM。For every 10K users in your user model, you will need at least 4GB of free RAM on a loader machine. 例如,运行80K 用户将需要在所有加载程序计算机上分配 32 GB RAM。For example, a run with 80K users will require about 32GB of RAM spread across all loader machines. 建议您至少具有三个加载程序计算机,而不考虑预期的负载。We recommend that you have at least three loader machines, regardless of expected load.

加载程序计算机必须安装 .NET 4.5 Framework 以及安装的 Visual c + + 2012 可再发行组件。Loader machines must have the .NET 4.5 Framework as well as the Visual C++ 2012 Redistributable installed.

配置Configuration

将 ChatStressTool 文件复制到可从所有加载程序计算机访问的共享文件夹中。Copy ChatStressTool files into a shared folder accessible from all loader machines.

创建在压力运行中使用的用户和频道:Create users and channels for use in the stress run:

  • 为您的用户模型调用创建任意多个用户,为 Lync 启用它们,并将其持久聊天策略设置为 "启用"。Create as many users as your user model calls for, enable them for Lync, and set their Persistent Chat policy to Enabled.

  • 为您的压力通道创建一个类别,然后根据该类别的需要创建任意多个会议室。Create a category for your stress channels, and then create as many rooms as are needed under that category. 类别应将所有压力用户放在其 允许 列表中 (通过添加其 OU) 的方式,并且压力会议室应具有 开放的隐私设置。The category should have all stress users in its Allowed list (by way of adding their OU), and stress rooms should have a privacy setting of Open.

  • 我们建议创建额外的压力房间。We recommend creating extra stress rooms. 您可以使用以下 Windows PowerShell 命令行界面命令创建50000聊天室:You can create 50,000 rooms with the following Windows PowerShell command-line interface command:

        for ($i = 0; $i -le 50000; $i++) { New-CsPersistentChatRoom -Category <parent category> -Name "StressChan_$i" -Privacy Open }
    

编辑配置文件以适用于您的拓扑:Edit the configuration files to fit your topology:

LoaderProcess.exe.config中,将 "controller.contoso.com" 更改为控制器计算机的完全限定的域名 (FQDN) 。In LoaderProcess.exe.config, change “controller.contoso.com” to the controller machine’s fully qualified domain name (FQDN).

StressLauncher.exe.config 中:In StressLauncher.exe.config:

  1. 将 "LoaderBinary" 设置值更改为共享文件夹的路径。Change the “LoaderBinary” setting value to the shared folder’s path.

  2. 将 "AdminUser"/"AdminPassword" 更改为具有对加载程序计算机的管理员访问权限的凭据。Change “AdminUser”/”AdminPassword” to credentials that have admin access to loader machines.

  3. 将 "ChannelCategory" 更改为在其下创建了压力通道的类别的名称。Change “ChannelCategory” to the name of the category that stress channels have been created under.

  4. 将 "UserNamePattern" 和 "UserPasswordPattern" 更改为与你的压力用户凭据相匹配的模板。Change “UserNamePattern” and “UserPasswordPattern” to a template that matches your stress user credentials. {0} 将替换为用户的索引号。{0} is replaced with the user’s index number.

  5. 将 "域" 更改为测试拓扑的 SIP 域。Change “Domain” to the SIP domain of your test topology.

  6. 将 "ConnectionString" 更改为持久聊天后端数据库的连接字符串。Change “ConnectionString” to a connection string for your Persistent Chat back-end database.

  7. 将 "UserIndexStart" 更改为第一个压力用户的索引。Change “UserIndexStart” to the index of the first stress user.

  8. 将 "LyncFQDN" 更改为前端池的 FQDN。Change “LyncFQDN” to the FQDN of your Front End pool.

  9. 修改 "计算机" 列表,以包含所有加载程序计算机的计算机名称。Modify the “Machines” list to include machine names for all of your loader machines.

  10. 更改服务终结 (点的 baseAddress 默认值为 "controller.contoso.com" ) 到控制器计算机的 FQDN。Change the baseAddress of the service endpoint (default is “controller.contoso.com”) to the FQDN of your controller machine.

用法Usage

配置完成后,在控制器计算机上打开 StressLauncher.exe。After configuration is complete, open StressLauncher.exe on the controller machine. 您可以以任何用户的形式启动 StressLauncher。You can launch StressLauncher as any user. 必须在配置文件中指定用于在加载程序计算机上启动加载程序进程的凭据。The credentials under which the loader processes start on the loader machines must be specified in the config file. 此外,还必须为连接字符串提供对持久聊天后端数据库的读取访问权限。You also must give a connection string that has Read access to the Persistent Chat back-end database. 如果此连接字符串使用集成的 Windows 身份验证,则必须以具有此访问权限的用户身份启动 StressLauncher。If this connection string uses integrated Windows authentication, you must launch StressLauncher as a user that has this access.

根据需要更改用户模型设置。Alter the user model settings as needed. 单击 " 开始加载 " 以启动运行。Click Start Load to initiate a run. 一分钟后,用户将开始登录,进度栏将开始填充。After a minute or so, users will start being signed in, and the progress bar will begin to fill. 在这种情况下,您可能可以运行控制器计算机并采用性能度量。At this point, you may can the controller machine working and take performance measurements.

ChatUpgradeVerifierChatUpgradeVerifier

说明Description

ChatUpgradeVerifier 是一种持久的聊天特定数据库比较工具。ChatUpgradeVerifier is a Persistent Chat specific database comparison tool. 该工具将组聊天 2007 R2 或组聊天2010数据库 (2007/2010Db) 与持久聊天2013数据库 (2013Db) 进行比较。The tool compares either the Group Chat 2007 R2 or Group Chat 2010 Database (2007/2010Db) to the Persistent Chat 2013 Database (2013Db).

该工具将逐个检查、每个类别、持久聊天室和外接程序在 2007/2010Db 中进行检查,以查看它是否出现在2013Db 中。The tool will check, one by one, each category, Persistent Chat room, and add-in in 2007/2010Db to see if it appears in the 2013Db. 比较包括检查类别、聊天室或外接中的所有设置、类别中的任何主体以及类别或聊天室上的角色中的任何主体。The comparison includes checking all settings on the category, chat room, or add-in, any principals in scope on the category, and any principal in a role on either the category or the chat room. 如果类别或聊天室未在2013Db 中正确显示,则这些差异将输出到冲突文件中。If a category or a chat room does not appear correctly in the 2013Db, the differences will be output to a conflicts file. 如果在升级后进行了升级,则会更改 2007/2010Db,然后运行此工具时,冲突文件的输出将会有所不同。If, after the upgrade has occurred, the 2007/2010Db is changed and then this tool is run, there will be a differences output to the conflicts file. 请注意,此应用程序仅为数据库比较工具,不会验证升级过程。Note that this application is a database comparison tool only and does not validate the upgrade process.

要求Requirements

在已加入域的计算机上安装持久聊天资源工具包工具,该计算机可访问持久聊天) 的旧版本和当前版本的现有聊天后端数据库 (。Install the Persistent Chat Resource Kit tools on a domain-joined machine that has access to the Persistent Chat back-end databases (previous and current versions for Persistent Chat).

运行该工具所使用的用户帐户必须具有对持久聊天数据库的读取权限。The user account under which the tool runs must have Read access to the Persistent Chat databases.

ChatUpgradeVerifier.exe.config 文件必须包含 GroupChat2007R2Db 参数或 GroupChat2010Db 参数,并将连接字符串指向相应的 Group Chat 数据库 (Groupchat 2007R2 或 2010) 。The ChatUpgradeVerifier.exe.config file must contain either the GroupChat2007R2Db parameter or the GroupChat2010Db parameter, with a connection string to the appropriate Group Chat database (either Groupchat 2007R2 or 2010). 它还必须包含 PersistentChat2013Db 参数,并将连接字符串连接到持久聊天2013数据库。It must also contain a PersistentChat2013Db parameter, with a connection string to the Persistent Chat 2013 database.

用法Usage

运行不带任何参数的 ChatUpgradeVerifierRun ChatUpgradeVerifier without any parameters.

示例Example

正在运行 ChatUpgradeVerifier.exe。Running ChatUpgradeVerifier.exe.

持久聊天使用情况报告Persistent Chat Usage Report

说明Description

ChatUsageReport 工具生成持久聊天服务使用情况的 HTML 报告。The ChatUsageReport tool generates an HTML report of Persistent Chat service usage.

要求Requirements

在有权访问持久聊天后端数据库的加入域的计算机上安装持久聊天资源工具包工具。Install the Persistent Chat Resource Kit tools on a domain-joined machine that has access to the Persistent Chat back-end database.

运行该工具所使用的用户帐户必须具有对持久聊天后端数据库的读取访问权限。The user account under which the tool is run must have Read access to the Persistent Chat back-end database.

ChatUsageReport.exe.config 的文件中,必须包含 <connectionStrings> 定义持久聊天后端数据库的连接字符串的节。The file, ChatUsageReport.exe.config, must contain a <connectionStrings> section defining the connection string to the Persistent Chat back-end database. 默认配置文件的内容包含在此处,供您参考。The contents of the default config file are included here, for your reference.

用法Usage

    ChatUsageReport [-StartDate {date}] [-EndDate {date}] [-TopActiveUsers {n}] [-TopActiveRooms {n}] [-LeastActiveRooms {n}] [-RoomsInactiveSince {Date}] [-OutputFolder {path}]

这些参数定义数据的选择:These parameters define the selection of data:

起始日期: (可选)指定选择期的 UTC 开始日期。StartDate: Optionally specifies the UTC start date of the selection period. 默认:最早日期Default: Earliest Date

结束日期: (可选)指定选择期的 UTC 结束日期。EndDate: Optionally specifies the UTC end date of the selection period. 默认值: NowDefault: Now

这些参数定义了显示数据的方式和方式:These parameters define how and what data is displayed:

TopActiveUsers: 如果指定此值,则报告将包含 n 个最活跃的用户,这取决于用户在所选时段内已在聊天室中发布的邮件数。TopActiveUsers: If this is specified, the report will include the n most active users in terms of the number of messages the user has posted in the chat room for the selected period. 默认值:10Default: 10

TopActiveRooms: 如果指定此值,则报告将包含 n 个最活跃的聊天室,这取决于所选时段的会议室中投递的邮件数。TopActiveRooms: If this is specified, the report will include the n most active chat rooms in terms of the number of messages posted in the room for the selected period. 默认值:10Default: 10

LeastActiveRooms: 如果指定此值,则报告将包含 n 个最小活动聊天室,条件是在所选时段的聊天室中发布的邮件数。LeastActiveRooms: If this is specified, the report will include the n least active chat rooms in terms of the number of messages posted in the chat room for the selected period. 聊天室将至少发布一封邮件。Rooms will have at least one message posted. 默认值:10Default: 10

RoomsInactiveSince: 如果指定此类型,报告将包含自指定日期后处于非活动状态的聊天室的列表。RoomsInactiveSince: If this is specified, the report will include a list of chat rooms that have been inactive since the specified date. 默认值:整个时间Default: Entire Time

OutputFolder: 将在其中放置 ChatUsageReport.html 和 graph 图像的文件夹。OutputFolder: The folder where the ChatUsageReport.html and the graph images will be placed. 这必须在配置文件或命令行中进行定义。This must be defined in the config file or on the command line.

此外,还可以在与工具位于同一目录中的 ChatUsageReport.exe.config 文件中指定所有命令行参数值。All of the command line parameter values can also be specified in the ChatUsageReport.exe.config file that is located in the same directory as the tool. 如果在配置文件和命令行中指定了任何值,则命令行值将替代 config 文件值。If any value is specified in both the config file and the command line, the command line value will override the config file value.

OutputOutput

报告将始终包含以下输出:The report will always include the following output:

  • 前 n 个最活跃聊天室(按所选时间段的邮件投递数表示)。Top n most active chat rooms by number of message posts for selected period.

  • 按所选时间段的邮件投递次数排名前 n 个的最活跃的用户。Top n most active users by number of message posts for selected period.

  • 前 n 个最小活动聊天室(按选定时间段内的邮件投递数表示)。Top n least active chat rooms by number of message posts for selected period.

  • 在数据库的整个生命周期中或自指定的日期起处于非活动状态的聊天室。Chat rooms that are inactive for the entire life of the database, or since the specified date.

  • 选定时间段内的每日邮件投递趋势。Daily message post trend for selected period.

  • 选定时段的每周邮件投递趋势。Weekly message post trend for selected period.

  • 选定时段的每月邮件投递趋势。Monthly message post trend for selected period.

  • 选定时间段内的邮件投递总数。Total message posts for selected period.

  • 已启用的会议室总数。Total number of enabled rooms.

示例Example

下面的示例将生成2001年的使用率报告,并将报告放置在 ChatUsageReport.exe.config 中指定的 OutputFolder 中。The following example generates a usage report for the entire year 2001 and places the report in the OutputFolder specified in the ChatUsageReport.exe.config.

    ChatUsageReport -RoomsInactiveSince 06-20-2010

ChatUsageReport.exe.config:ChatUsageReport.exe.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <connectionStrings>
        <!-- The PersistentChat connection string must be defined in this file. -->
        <add name="PersistentChat" connectionString="Data Source=contoso.com\RTC;Initial Catalog=mgc;Integrated Security=SSPI"/>
      </connectionStrings>
      <appSettings>
        <!-- The OutputFolder must be defined here or on the command line. -->
        <add key="OutputFolder" value="."/>
        <!-- The values below are the same as the application defaults. -->
        <add key="StartDate" value="01/01/0001"/>
        <add key="EndDate" value="12/31/9999"/>
        <add key="TopActiveUsers" value="10"/>
        <add key="TopActiveRooms" value="10"/>
        <add key="LeastActiveRooms" value="10"/>
        <add key="RoomsInactiveSince" value="01/01/0001"/>
      </appSettings>
    </configuration></configuration>

ScheduleADSyncForPrincipalScheduleADSyncForPrincipal

说明Description

ScheduleADSyncForPrincipal 是 Microsoft SQL Server 2012 脚本,它必须在连接到持久聊天后端数据库时直接从 SQL Server Management Studio 中运行。ScheduleADSyncForPrincipal is a Microsoft SQL Server 2012 script that must be run directly from within SQL Server Management Studio when connected to the Persistent Chat back-end database. 通过此脚本,您可以强制持久聊天将用户的记录与 Active Directory 域服务的记录同步,而不是等待计划的同步时间。This script enables you to force Persistent Chat to synchronize its records of a user with those of Active Directory Domain Services, rather than waiting for the scheduled synchronization time.

要求Requirements

运行脚本所使用的用户帐户必须具有对持久聊天后端数据库的所有者访问权限。The user account under which the script is run must have owner access to the Persistent Chat back-end database.

用法Usage

以下是默认脚本的内容:Following are the contents of the default script:

    /*
    This script will schedule a principal for a forced AD synchronization cycle
    
    If you're using Sql Server Management Studio, pressing Ctrl+Shift+M will 
    allow you to specify values for the template parameter.
    */
    
        insert into
          tblPrincipalMeta
          (
           prinID
          ,prinAffiliationsDirty
          ,prinAttributesDirty
          ,prinDeleted
          )
          select
            prinID
           ,1
           ,1
           ,0
          from
            tblPrincipal
          where
            prinID not in (select prinID from tblPrincipalMeta) and
            prinID = <PrinID,int,0>
     
        update
          tblPrincipalMeta
        set
          prinAffiliationsDirty = 1
         ,prinAttributesDirty = 1
         ,tryCount = 0
         ,nextTry = null
        where
         prinID = <PrinID,int,0>