Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE Rightfax
- GO
- select
- FUSR.UserID, FUSR.UserName, FUSR.SID,
- FGRP.GroupID,
- STDIDNum, STGenFaxNum, STCallback, STOperNum, STFromName, STFromPhone, STToFaxNum, STToContactNum, STToName, STToCompany, STToCityState,
- FUSR.FCSModelName,
- CASE
- When FUSR.RouteType is NULL or FUSR.RouteType = 0 Then 'None'
- When FUSR.RouteType = 4 Then 'Folder'
- When FUSR.RouteType = 11 Then 'Exchange Mail'
- When FUSR.RouteType = 12 Then 'SMTP Mail'
- ELSE 'Unknown'
- END as [Route Type],
- FUSR.RouteInfo,
- CASE
- When FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'None'
- When FUSR.NotifyType = 0 Then 'Group Default'
- When FUSR.NotifyType = 18 Then 'SMTP Mail'
- When FUSR.NotifyType = 17 Then 'Exchange Mail'
- When FUSR.NotifyType = 16 Then 'Lotus Mail'
- ELSE 'Unknown'
- END as [Notify Type],
- FUSR.NotifyInfo,
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'None'
- ELSE CASE
- WHEN FUSR.ReceiveNotify is NULL OR FUSR.ReceiveNotify = 0 Then 'None'
- WHEN FUSR.ReceiveNotify = 1 Then 'Once when received'
- WHEN FUSR.ReceiveNotify = 2 Then 'Periodically until viewed'
- ELSE 'Unknown'
- END
- END as [Receive Notify],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x1 = 0x1 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify Fax Incomplete Once],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x2 = 0x2 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify Fax Incomplete Periodically],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x4 = 0x4 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify Once During XMIT],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x8 = 0x8 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify Periodically During XMIT],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x10 = 0x10 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify XMIT Error will Retry],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x20 = 0x20 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify XMIT Success],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x40 = 0x40 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify XMIT permanently failed],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x80 = 0x0 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify Fax Held for Preview],
- CASE
- WHEN FUSR.NotifyType is NULL or FUSR.NotifyType = 53199 Then 'No'
- ELSE CASE
- WHEN FUSR.SendNotify is NULL Then 'No'
- WHEN FUSR.SendNotify & 0x100 = 0x100 Then 'Yes'
- ELSE 'No'
- END
- END as [Notify Fax Held for Approval],
- FUSR.UserDIDNumber as [Incoming Fax Num],
- FUSR.AutoPrintFlags, FUSR.AutoPrintNetPrintID, FUSR.AutoSentPrinter, FUSR.DefaultPrinter,
- FUSR.HighestPriority, FUSR.DefaultPriority
- from Users as FUSR
- inner join Groups as FGRP
- on FUSR.GroupID = FGRP.handle
- Where FUSR.UserID not in ('RFINLUSER', 'Administrator', 'Default', 'Walkup')
- Order by FUSR.AutoPrintFlags
- /* Send Notify flags
- 0/1 Fax Incomplete Once only
- 0/2 Fax Incomplete Periodically
- 0/4 Fax Once During Transmission
- 0/8 Fax Periodically During Transmission
- 0/16 Fax Error will Retry
- 0/32 Fax Successfully Sent
- 0/64 Fax Permanent Fail
- 0/128 Fax Held for preview [0 = Send notification for held for preview ; 1 = no notification]
- 0/256 Fax Held for Approval [1 = Send notification for Needs Approval]
- */
Advertisement
Add Comment
Please, Sign In to add comment