Wednesday, March 27, 2013

So I recently upgraded PostgreSQL from 8.3 to 8.4 and more or less at the same time upgraded Bacula to 5.2.14 from some earlier version, I don't remember what can I say.

Anyway in the process I ran into this error when opening bconsole:

JobId 0: Fatal error: Pool Default not in database. sql_create.c:189 pool record Default already existsI couldn't for the life of me figure this out.So I eventually got into pgsql as bacula and did a select statement

I had an issue where several users that no longer work here still had active sync devices in AD for whatever reason so I needed to get rid of them.Quick Google Search found this Technet threadThe long and short of it are these two lines that gather all the active sync devices that haven't checked in within the past 30 days and then removes them.For my purposes I changed it 90 days the first time through, however I now run this script once monthly.-- Powershell Start --$DevicesToRemove = Get-ActiveSyncDevice -result unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSuccessSync -le (Get-Date).AddDays("-30")}$DevicesToRemove | foreach-object {Remove-ActiveSyncDevice ([string]$_.Guid) -confirm:$false}
-- Powershell End --Now let's say the user doesn't have a mailbox on Exchange anymore.You first have to temporarily recreate the mailbox-- Powershell Start --Enable-Mailbox -Identity:'OU/User'-- Powershell End --Then rerun the above script.If you don't create the mailbox you get a can't find recipient error.Then after the active sync devices are gone simply run-- Powershell Start --Remove-Mailbox -Identity:'OU/User'-- Powershell End --If for some reason you still can't remove the Active Sync devices you can open ADSI Edit and look forCN=ExchangeActiveSyncDevices container under the user objectThen simply remove that.