The PI AF Diagnostics (AFDiag) utility is a command-line utility that you can use to enable or disable PI AF server features and perform other administrative functions. The utility makes a direct connection with the associated SQL Server database and requires the SQL Server sysadmin or db_afadmin role.