Leaked source code of windows server 2003
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.

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