01-23-2015 01:10 AM
01-25-2015 08:29 PM
Hi,
You can use this
select domain_PolicyClient.PolicyName, domain_PolicyClient.clientName, MAX(domain_PolicyClient.policyversionno)
from domain_PolicyClient
GROUP BY domain_PolicyClient.clientName, domain_PolicyClient.PolicyName
ORDER BY domain_PolicyClient.PolicyName
It adds another column at the end (MAX(domain_PolicyClient.policyversionno) that you can ignore. I don't know enough about SQL to know how to hide it :).
01-26-2015 12:06 AM
Ok thx, but it still shows me deleted policies, what does it mean policyversionno? Some got =1 some =13 or 10
??
This query shows me poliecies which are not shown in netbck GUI..
There is also "active" flag, but I cannot what what does it mean.
01-26-2015 02:31 AM
Ah ok, sorry, I got side tracked by the policy version number. They indicate how many times a policy has changed, 13 being 13 changes.
I'll work on the deleted bit :)
01-26-2015 02:58 AM
01-26-2015 04:10 AM
Fixed
select domain_PolicyClient.PolicyName, domain_PolicyClient.clientName
from domain_PolicyClient, domain_policy
WHERE domain_PolicyClient.PolicyName = domain_Policy.Name AND domain_policy.status IN (0)
GROUP BY domain_PolicyClient.clientName, domain_PolicyClient.PolicyName
ORDER BY domain_PolicyClient.PolicyName
01-26-2015 05:30 AM
Hm thx, it looked good, but I have checked, and some policies are inactive :) heh, I think I will have to do this manualy..
01-26-2015 10:21 AM
Included the check for active only (text in BOLD)
select domain_PolicyClient.PolicyName, domain_PolicyClient.clientName
from domain_PolicyClient, domain_policy
WHERE domain_PolicyClient.PolicyName = domain_Policy.Name AND domain_policy.status IN (0) AND domain_policy.active IN (1)
GROUP BY domain_PolicyClient.clientName, domain_PolicyClient.PolicyName
ORDER BY domain_PolicyClient.PolicyName
01-27-2015 11:26 PM
Hi,
Have you verified its working now?
01-27-2015 11:47 PM
select domain_PolicyClient.PolicyName, domain_PolicyClient.clientName
from domain_PolicyClient, domain_policy
WHERE domain_PolicyClient.PolicyName = domain_Policy.Name AND domain_policy.status IN (0) AND domain_policy.active IN (1)
GROUP BY domain_PolicyClient.clientName, domain_PolicyClient.PolicyName
ORDER BY domain_PolicyClient.PolicyName
No this query still shows me deactivated policies. While I change domain_policy.active IN (0) this shows me all deactivated policy (and its good outpust, its the same numer of rows we did manually)
So still is something wrong with query :)
01-28-2015 12:17 AM
Hmm, works fine on mine. There must be some other discrepancy that you're catching in your environment.
01-28-2015 12:31 AM
Anyway I am looking for another SQL,
What I have to do is list all scheduler (calendar only) with policy name, scheduler type, days, start time and end time
Like this:
Policy name Type ScheduleType ScheduleName Daily Weekly Monthly
policy1 standard Calendar sched1 Mon,Tu Saturday
start 12:00 end 14:00 start 14:00 end 15:00
Is it possible? Cuz it looks more complex I was trying to write it using domain_Schedule and domain_ScheduleCalendar but with no success