I've created a custom query to report back any devices plugged into a specific vlan that does not meet our standard naming convention. Is there a better way to create this report? I have about 40 VLANs that I need to report on so, it's not a huge issue to copy and paste each line and edit. Just curious.
SELECT IPAM_DhcpLeases.ClientIpAddress, IPAM_DhcpLeases.ClientName, IPAM_DhcpLeases.ClientMAC, IPAM_DhcpLeases.ScopeId,
CASE
WHEN IPAM_DhcpLeases.ScopeId = 47 THEN 'User VLAN'
WHEN IPAM_DhcpLeases.ScopeId = 30 THEN 'User VLAN-2'
END AS [Server]
FROM IPAM_DhcpLeases
WHERE
(IPAM_DhcpLeases.ScopeId = 47
AND (IPAM_DhcpLeases.ClientName NOT LIKE 'EXAMPLE%' AND IPAM_DhcpLeases.ClientName NOT LIKE 'EXAMPLE-1%'))
OR
(IPAM_DhcpLeases.ScopeId = 39
AND IPAM_DhcpLeases.ClientName NOT LIKE 'EXAMPLE-2%')
ORDER BY IPAM_DhcpLeases.ScopeId