garysharp / Disco

Disco ICT Management
GNU Affero General Public License v3.0
26 stars 9 forks source link

Expired wireless certificates deletion/update #90

Open pconnell247 opened 9 years ago

pconnell247 commented 9 years ago

Problem: Unable to delete and re-assign a wireless certificate that has expired for an active device from the Disco console.

JamesDodds commented 9 years ago

I've used the below SQL update to disable expired certs from the past two months. Still have to go and run the bootstrapper to add a new cert, but better than doing manually with Access...

USE [Disco]
GO

UPDATE [dbo].[DeviceCertificates]
   SET [Enabled]=0
 WHERE (Disco.dbo.DeviceCertificates.ExpirationDate between DATEADD(month, -2, GETDATE()) and GETDATE() and disco.dbo.DeviceCertificates.Enabled=1)
GO