As there is no notification with the iManage Email Filing Server when folder status turns from Succeeded to reset the folder , we use the following SQL Statement to notify us via email when there are problems
$PSEmailServer = "smptserver"
##SQL Query Function no SQL installs needed all powershell baby
function Invoke-SQL ($SQLServer, $SqlQuery) {
#Uncomment below to double check the statement
#Write-Host $SqlQuery
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Server = $SQLServer; Integrated Security = True"
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand
$SqlCmd.CommandText = $SqlQuery
$SqlCmd.Connection = $SqlConnection
$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
$SqlAdapter.SelectCommand = $SqlCmd
$DataSet = New-Object System.Data.DataSet
[void]$SqlAdapter.Fill($DataSet)
$SqlConnection.Close()
return $dataset.tables
}
$sqlresult = Invoke-SQL imanagesqlserver "select COUNT(1) from [imanagedatabase].[MHGROUP].EM_PROJECTS where ENABLED='Y' AND (STATUS=-1 or STATUS=-3)"
$DocGenCount = $sqlresult| select -expand Column1
if ($DocGenCount -gt 0 ) {
Send-MailMessage -From "[email protected]" -to "[email protected]" -Subject "EFS Problem Database Support" -Body "Current number of Issues $DocGenCount "
}
We recently got alerts through however logging into the Worksite Email Filing Server Management GUI there were no marked folders for resetting. This was due to the email address of the iManage user not matching the users filing email