Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

245 lines
15 KiB

  1. #include <windows.h>
  2. #include "resource.h"
  3. #include "cmdlineres.h"
  4. #include "cmdline.rc"
  5. /////////////////////////////////////////////////////////////////////////////
  6. //
  7. // String Table
  8. //
  9. STRINGTABLE DISCARDABLE
  10. BEGIN
  11. IDS_UTILITY_NAME "EVENTTRIGGERS"
  12. IDS_QUERY_TYPE "type"
  13. IDS_QUERY_ID "id"
  14. IDS_QUERY_TRIGGERNAME "triggername"
  15. IDS_QUERY_SOURCENAME "source"
  16. IDS_QUERY_AND " AND "
  17. IDS_QUERY_EQ " = "
  18. END
  19. STRINGTABLE DISCARDABLE
  20. BEGIN
  21. IDS_HELP_M1 "\nEVENTTRIGGERS /parameter [arguments]\n\n"
  22. IDS_HELP_M2 "Description:\n"
  23. IDS_HELP_M3 " This command-line tool enables an administrator to display and\n"
  24. IDS_HELP_M4 " configure ""Event Triggers"" on local or remote system.\n\n"
  25. IDS_HELP_M5 "Parameter List:\n"
  26. IDS_HELP_M6 " /Create Create a new Event Trigger that will monitor and act\n"
  27. IDS_HELP_M7 " upon the occurrence of NT Log Events of given criteria.\n\n"
  28. IDS_HELP_M8 " /Delete Deletes an Event Trigger by its trigger ID.\n\n"
  29. IDS_HELP_M9 " /Query Displays the Event Trigger properties and settings."
  30. IDS_HELP_M10 "\n\n"
  31. IDS_HELP_M11 " /? Displays this help/usage.\n\n"
  32. IDS_HELP_M12 "Examples:\n"
  33. IDS_HELP_M13 " EVENTTRIGGERS /Create /?\n"
  34. IDS_HELP_M14 " EVENTTRIGGERS /Delete /?\n"
  35. IDS_HELP_END " EVENTTRIGGERS /Query /?\n"
  36. END
  37. STRINGTABLE DISCARDABLE
  38. BEGIN
  39. IDS_HELP_C1 "\nEVENTTRIGGERS /Create [/S system [/U username [/P [password]]]]\n"
  40. IDS_HELP_C2 " /TR triggername /TK taskname [/D description]\n"
  41. IDS_HELP_C3 " [/L log] { [/EID id] [/T type] [/SO source] }\n"
  42. IDS_HELP_C4 " [/RU username [/RP password]]\n\n"
  43. IDS_HELP_C5 "Description:\n"
  44. IDS_HELP_C6 " Create a new Event Trigger that will monitor and act upon the\n"
  45. IDS_HELP_C7 " occurrence of NT Log Events of a given criteria.\n\n"
  46. IDS_HELP_C8 " NOTE: Using /EID, /T and /SO together act as a series of AND's.\n\n"
  47. IDS_HELP_C9 "Parameter List:\n"
  48. IDS_HELP_C10 " /S system Specifies the remote system to connect to.\n\n"
  49. IDS_HELP_C11 " /U [domain\]user Specifies the user context under which the\n"
  50. IDS_HELP_C12 " command should execute.\n\n"
  51. IDS_HELP_C13 " /P [password] Specifies the password for the given user\n"
  52. IDS_HELP_C14 " context. Prompts for input if omitted.\n\n"
  53. IDS_HELP_C15 " /TR triggername Specifies a friendly name to associate with\n"
  54. IDS_HELP_C16 " the Event Trigger.\n\n"
  55. IDS_HELP_C17 " /L log Specifies the NT Event Log(s) to monitor\n"
  56. IDS_HELP_C18 " events from. Valid types include:"
  57. IDS_HELP_C19 "\n"
  58. IDS_HELP_C20 " Application, System, Security, DNS Server\n"
  59. IDS_HELP_C21 " Log and Directory Log. The wildcard ""*""\n"
  60. IDS_HELP_C22 " may be used and the default value is ""*"".\n\n"
  61. IDS_HELP_C23 " /EID id Specifies a specific Event ID the Event\n"
  62. IDS_HELP_C24 " Trigger should monitor for.\n\n"
  63. IDS_HELP_C25 " /T type Specifies an Event Type that the trigger\n"
  64. IDS_HELP_C26 " should monitor for. Valid values include:\n"
  65. IDS_HELP_C27 " ""ERROR"", ""INFORMATION"", ""WARNING"",\n"
  66. IDS_HELP_C28 " ""SUCCESSAUDIT"" and ""FAILUREAUDIT"".\n\n"
  67. IDS_HELP_C29 " /SO source Specifies a specific Event Source the Event\n"
  68. IDS_HELP_C30 " Trigger should monitor for.\n\n"
  69. IDS_HELP_C31 " /D description Specifies the description of the Event\n"
  70. IDS_HELP_C32 " Trigger.\n\n"
  71. IDS_HELP_C33 " /TK taskname Specifies the task to execute when the\n"
  72. IDS_HELP_C34 " Event Trigger conditions are met.\n\n"
  73. IDS_HELP_C35 " /RU username Specifies the user account (user context)\n"
  74. IDS_HELP_C36 " under which the task runs. For the system\n"
  75. IDS_HELP_C37 " account value must be """".\n\n"
  76. IDS_HELP_C38 " /RP password Specifies the password for the user.\n"
  77. IDS_HELP_C39 " To prompt for the password, the value\n"
  78. IDS_HELP_C40 " must be either ""*"" or none.\n"
  79. IDS_HELP_C41 " Password will not effect for the ""SYSTEM""\n"
  80. IDS_HELP_C42 " account.\n\n"
  81. IDS_HELP_C43 " /? Displays this help/usage.\n\n"
  82. IDS_HELP_C44 "Examples:\n"
  83. IDS_HELP_C45 " EVENTTRIGGERS /Create /?\n"
  84. IDS_HELP_C46 " EVENTTRIGGERS /Create /TR ""Disk Cleanup"" /L SYSTEM /T ERROR\n"
  85. IDS_HELP_C47 " /TK c:\\windows\\system32\\cleanmgr.exe\n"
  86. IDS_HELP_C48 " EVENTTRIGGERS /Create /S system /U user /TR ""Low Disk Space""\n"
  87. IDS_HELP_C49 " /EID 4133 /T WARNING\n"
  88. IDS_HELP_C50 " /TK \\\\srv\\share\\dsk.cmd\n"
  89. IDS_HELP_C51 " EVENTTRIGGERS /Create /S system /U domain\\user /P password\n"
  90. IDS_HELP_C52 " /TR ""Disk Backup"" /EID 4133 /L SYSTEM\n"
  91. IDS_HELP_C53 " /T ERROR /TK \\\\system\\share\\ntbackup.exe\n"
  92. IDS_HELP_C54 " EVENTTRIGGERS /Create /RU user /RP password /TR ""Disk Backup""\n"
  93. IDS_HELP_CREATE_END " /TK \\\\system\\share\\ntbackup.exe /EID 4\n"
  94. END
  95. STRINGTABLE DISCARDABLE
  96. BEGIN
  97. IDS_HELP_D1 "\nEVENTTRIGGERS /Delete [/S system [/U username [/P [password]]]]\n"
  98. IDS_HELP_D2 " /TID id [/TID id1 [...[/TID idn]]]\n\n"
  99. IDS_HELP_D3 "Description:\n"
  100. IDS_HELP_D4 " Delete an Event Trigger from the system by its ID.\n\n"
  101. IDS_HELP_D5 "Parameter List:\n"
  102. IDS_HELP_D6 " /S system Specifies the remote system to connect to.\n\n"
  103. IDS_HELP_D7 " /U [domain\]user Specifies the user context under which the\n"
  104. IDS_HELP_D8 " command should execute.\n\n"
  105. IDS_HELP_D9 " /P [password] Specifies the password for the given user\n"
  106. IDS_HELP_D10 " context. Prompts for input if omitted.\n\n"
  107. IDS_HELP_D11 " /TID id Specifies the Event Trigger to be deleted\n"
  108. IDS_HELP_D12 " by ""Event Trigger ID"". The ""*"" wildcard\n"
  109. IDS_HELP_D13 " may be used.\n\n"
  110. IDS_HELP_D14 " /? Displays this help/usage.\n\n"
  111. IDS_HELP_D15 "Examples:\n"
  112. IDS_HELP_D16 " EVENTTRIGGERS /Delete /?\n"
  113. IDS_HELP_D17 " EVENTTRIGGERS /Delete /TID 1 /TID 2 /TID 4 /TID 6\n"
  114. IDS_HELP_D18 " EVENTTRIGGERS /Delete /S system /U domain\\user /TID *\n"
  115. IDS_HELP_DELETE_END " EVENTTRIGGERS /Delete /S system /U username /P password /TID 1\n"
  116. END
  117. STRINGTABLE DISCARDABLE
  118. BEGIN
  119. IDS_HELP_Q1 "\nEVENTTRIGGERS /Query [/S system [/U username [/P [password]]]]\n"
  120. IDS_HELP_Q2 " [/FO format] [/NH] [/V]\n\n"
  121. IDS_HELP_Q3 "Description:\n"
  122. IDS_HELP_Q4 " Displays the Event Trigger properties and settings.\n\n"
  123. IDS_HELP_Q5 "Parameter List:\n"
  124. IDS_HELP_Q6 " /S system Specifies the remote system to connect to.\n\n"
  125. IDS_HELP_Q7 " /U [domain\]user Specifies the user context under which the\n"
  126. IDS_HELP_Q8 " command should execute.\n\n"
  127. IDS_HELP_Q9 " /P [password] Specifies the password for the given user\n"
  128. IDS_HELP_Q10 " context. Prompts for input if omitted.\n\n"
  129. IDS_HELP_Q11 " /FO format Specifies the format in which the output is\n"
  130. IDS_HELP_Q12 " to be displayed.\n"
  131. IDS_HELP_Q13 " Valid values: ""TABLE"", ""LIST"", ""CSV"".\n\n"
  132. IDS_HELP_Q14 " /NH Specifies that the ""Column Header"" should\n"
  133. IDS_HELP_Q15 " not be displayed in the output.\n"
  134. IDS_HELP_Q16 " Valid only for TABLE and CSV formats.\n\n"
  135. IDS_HELP_Q17 " /V Specifies that the detailed information\n"
  136. IDS_HELP_Q18 " should be displayed in the output.\n\n"
  137. IDS_HELP_Q19 " /? Displays this help/usage.\n\n"
  138. IDS_HELP_Q20 "Examples:\n"
  139. IDS_HELP_Q21 " EVENTTRIGGERS /Query /?\n"
  140. IDS_HELP_Q22 " EVENTTRIGGERS /Query /FO list /V\n"
  141. IDS_HELP_Q23 " EVENTTRIGGERS /Query /FO csv /NH \n"
  142. IDS_HELP_QUERY_END " EVENTTRIGGERS /Query /S system /U domain\\user /P password /V\n"
  143. IDS_ASK_PASSWORD "Type run as password for %s:"
  144. END
  145. STRINGTABLE DISCARDABLE
  146. BEGIN
  147. IDS_INCORRECT_SYNTAX "Invalid syntax.\nType ""%s /?"" for usage.\n"
  148. IDS_TYPE_PASSWARD "Type the password for "
  149. IDS_LAST_CHAR " : "
  150. IDS_CREATE_SUCCESS "SUCCESS: The Event Trigger ""%s"" has been created.\n"
  151. IDS_HOSTNAME "Hostname"
  152. IDS_TRIGGER_ID "Trigger ID"
  153. IDS_TRIGGER_NAME "Event Trigger Name"
  154. IDS_TASK_USERNAME "Run As (Username)"
  155. END
  156. STRINGTABLE DISCARDABLE
  157. BEGIN
  158. IDS_TASK "Task"
  159. IDS_EVENT_QUERY "Query"
  160. IDS_DESCRIPTION "Description"
  161. IDS_DELETE_SUCCESS "SUCCESS: The Event Trigger ""%s"" (Trigger ID = %d) has been removed.\n"
  162. IDS_EVENTS_WITH "Events With"
  163. IDS_DELETE_ERROR "INFO: Event Trigger id ""%d"" does not exists.\n"
  164. IDS_USERNAME_REQUIRED "Invalid syntax. /P can be specified only when /U is specified.\n"
  165. IDS_DUPLICATE_TRG_NAME "ERROR: Event Trigger Name ""%s"" already exists.\n"
  166. IDS_UNABLE_DELETE "INFO: Unable to delete Event Trigger id ""%d"".\n"
  167. END
  168. STRINGTABLE DISCARDABLE
  169. BEGIN
  170. IDS_STRING_TABLE "TABLE"
  171. IDS_STRING_CSV "CSV"
  172. IDS_STRING_LIST "LIST"
  173. IDS_TYPE_OPTIONS "error|information|successaudit|failureaudit|warning"
  174. IDS_FORMAT_OPTIONS "table|list|csv"
  175. IDS_NO_EVENTID "INFO: No event trigger id found for deletion.\n"
  176. IDS_NO_EVENT_FOUNT "INFO: No event triggers found.\n"
  177. IDS_LOG_NOT_EXISTS "ERROR: ""%s"" Log does not exists on system.\n"
  178. IDS_ID_VALUE_OUT_OF_RANGE
  179. "ERROR: Event trigger id value should be between (1 - %d).\n"
  180. IDS_ID_TYPE_SOURCE "Invalid syntax. Either of /EID, /so or /T missing.\n"
  181. IDS_ID_SHOW_ERROR "ERROR: "
  182. IDS_ID_DEFAULT_MISSING "Hint: /TK is missing.\n"
  183. IDS_CLASS_NOT_REG "ERROR: ""CmdTriggerConsumer"" class not registered with WMI.\n"
  184. IDS_FAILURE_AUDIT "FAILUREAUDIT"
  185. END
  186. STRINGTABLE DISCARDABLE
  187. BEGIN
  188. IDS_SUCCESS_AUDIT "SUCCESSAUDIT"
  189. IDS_AUDIT_FAILURE "audit failure"
  190. IDS_AUDIT_SUCCESS "audit success"
  191. IDS_ID_TRIG_NAME_MISSING "Invalid syntax. Trigger name missing or empty.\n"
  192. IDS_ACCESS_DENIED "Access is denied."
  193. IDS_INVALID_PARAMETER "ERROR: Unable to create event trigger named ""%s"".\n"
  194. IDS_OUTOF_MEMORY "ERROR: Out of memory.\n"
  195. IDS_ERROR_USERNAME_EMPTY "Invalid syntax. User name should not be empty.\n"
  196. IDS_ERROR_SERVERNAME_EMPTY "Invalid syntax. System name should not be empty.\n"
  197. IDS_INVALID_ID "Specified ID is invalid.\n"
  198. IDS_ID_TK_NAME_MISSING "Invalid syntax. Task name missing or empty.\n"
  199. IDS_ID_REQUIRED "Invalid syntax. ID missing.\n"
  200. IDS_ID_NON_NUMERIC "ID must be numeric or ""*"".\n"
  201. IDS_HEADER_NOT_ALLOWED "Invalid syntax. /NH is allowed only for ""TABLE"" and ""CSV"" formats.\n"
  202. IDS_ERROR_USERNAME_BUT_NOMACHINE
  203. "Invalid syntax. /U can be specified only when /S is specified.\n"
  204. IDS_COM_ERROR "ERROR: Internal COM error.\n"
  205. IDS_ERROR_COM_ERROR "%s Error Code: 0x%08lx\n"
  206. IDS_ID_SOURCE_EMPTY "Invalid syntax. Source should not be empty.\n"
  207. IDS_ID_DESC_EMPTY "Invalid syntax. Description should not be empty.\n"
  208. IDS_ID_LOG_EMPTY "Invalid syntax. Log(s) should not be empty.\n"
  209. IDS_ID_NA "N/A"
  210. IDS_TYPE_HELP "Type ""%s /%s /?"" for usage.\n"
  211. IDS_ID_INVALID_TRIG_NAME "Trigger name is invalid.\n"
  212. IDS_RUN_AS_USERNAME_REQUIRED "Invalid syntax. /RP can be specified only when /RU is specified.\n"
  213. IDS_WARNING_PASSWORD "WARNING: Password will be ignored for ""%s"" user.\n"
  214. IDS_ERROR_R_U_EMPTY "Invalid syntax. Run as user name should not be empty.\n"
  215. IDS_MSG_EVTRIG_C "Creating EventTrigger..."
  216. IDS_MSG_CONNECTING "Connecting to server..."
  217. IDS_MSG_EVTRIG_D "Deleting EventTrigger(s)..."
  218. IDS_MSG_EVTRIG_Q "Loading Event Trigger Information ..."
  219. IDS_INVALID_R_U "WARNING: The new event trigger has been created, but may not run because the account information could not be set.\n"
  220. IDS_WARN_NULL_PASSWORD "WARNING: When the run as password is empty the task may not be triggered because of the security policy.\n"
  221. END
  222. //
  223. // Version resources
  224. //
  225. #include <ntverp.h>
  226. #define VER_FILETYPE VFT_APP
  227. #define VER_FILESUBTYPE VFT2_UNKNOWN
  228. #define VER_FILEDESCRIPTION_STR "Event Triggers"
  229. #define VER_INTERNALNAME_STR "EventTriggers.exe"
  230. #define VER_ORIGINALFILENAME_STR "EvTrig.exe"
  231. #include <common.ver>