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.

147 lines
7.8 KiB

  1. #include "resource.h"
  2. #include "windows.h"
  3. #include "cmdlineres.h"
  4. #include "cmdline.rc"
  5. STRINGTABLE DISCARDABLE
  6. BEGIN
  7. IDS_WHOAMI_HLP1 "\nWhoAmI has three ways of working: \n\nSyntax 1:\n"
  8. IDS_WHOAMI_HLP2 " WHOAMI [/UPN | /FQDN | /LOGONID]\n\n"
  9. IDS_WHOAMI_HLP3 ""
  10. IDS_WHOAMI_HLP4 "Syntax 2:\n"
  11. IDS_WHOAMI_HLP5 " WHOAMI { [/USER] [/GROUPS] [/PRIV] } [/FO format] [/NH]\n\n"
  12. IDS_WHOAMI_HLP6 ""
  13. IDS_WHOAMI_HLP7 "Syntax 3:\n"
  14. IDS_WHOAMI_HLP8 " WHOAMI /ALL [/FO format] [/NH]\n\n"
  15. IDS_WHOAMI_HLP9 ""
  16. IDS_WHOAMI_HLP10 "Description:\n"
  17. IDS_WHOAMI_HLP11 " This utility can be used to get user name and group information\n"
  18. IDS_WHOAMI_HLP12 " along with the respective security identifiers (SID), privileges,\n"
  19. IDS_WHOAMI_HLP13 " logon identifier (logon ID) for the current user (access token)\n"
  20. IDS_WHOAMI_HLP14 " on the local system. i.e. who is the current logged on user?\n"
  21. IDS_WHOAMI_HLP15 " If no switch is specified, tool displays the user name in NTLM\n"
  22. IDS_WHOAMI_HLP16 " format (domain\\username).\n\n"
  23. IDS_WHOAMI_HLP17 ""
  24. IDS_WHOAMI_HLP18 ""
  25. IDS_WHOAMI_HLP19 "Parameter List:\n"
  26. IDS_WHOAMI_HLP20 " /UPN Displays the user name in User Principal \n"
  27. IDS_WHOAMI_HLP21 " Name (UPN) format.\n\n"
  28. IDS_WHOAMI_HLP22 " /FQDN Displays the user name in Fully Qualified \n"
  29. IDS_WHOAMI_HLP23 " Distinguished Name (FQDN) format.\n\n"
  30. IDS_WHOAMI_HLP24 " /USER Displays information on the current user\n"
  31. IDS_WHOAMI_HLP25 " along with the security identifier (SID).\n\n"
  32. IDS_WHOAMI_HLP26 ""
  33. IDS_WHOAMI_HLP27 " /GROUPS Displays group membership for current user,\n"
  34. IDS_WHOAMI_HLP28 " type of account, security identifiers (SID)\n"
  35. IDS_WHOAMI_HLP29 " and attributes.\n\n"
  36. IDS_WHOAMI_HLP30 " /PRIV Displays security privileges of the current\n"
  37. IDS_WHOAMI_HLP31 " user.\n\n"
  38. IDS_WHOAMI_HLP32 " /LOGONID Displays the logon ID of the current user.\n\n"
  39. IDS_WHOAMI_HLP33 ""
  40. IDS_WHOAMI_HLP34 " /ALL Displays the current user name, groups \n"
  41. IDS_WHOAMI_HLP35 " belonged to along with the security \n"
  42. IDS_WHOAMI_HLP36 " identifiers (SID) and privileges for the \n"
  43. IDS_WHOAMI_HLP37 " current user access token.\n\n"
  44. IDS_WHOAMI_HLP38 ""
  45. IDS_WHOAMI_HLP39 " /FO format Specifies the output format to be displayed.\n"
  46. IDS_WHOAMI_HLP40 " Valid values are TABLE, LIST, CSV.\n"
  47. IDS_WHOAMI_HLP41 " Column headings are not displayed with CSV\n"
  48. IDS_WHOAMI_HLP42 " format. Default format is TABLE.\n\n"
  49. IDS_WHOAMI_HLP43 " /NH Specifies that the column header should not\n"
  50. IDS_WHOAMI_HLP44 " be displayed in the output. This is\n"
  51. IDS_WHOAMI_HLP45 " valid only for TABLE and CSV formats.\n\n"
  52. IDS_WHOAMI_HLP46 " /? Displays this help message.\n\n"
  53. IDS_WHOAMI_HLP47 ""
  54. IDS_WHOAMI_HLP48 "Examples:\n"
  55. IDS_WHOAMI_HLP49 " WHOAMI\n"
  56. IDS_WHOAMI_HLP50 " WHOAMI /UPN\n"
  57. IDS_WHOAMI_HLP51 " WHOAMI /FQDN \n"
  58. IDS_WHOAMI_HLP52 " WHOAMI /LOGONID\n"
  59. IDS_WHOAMI_HLP53 " WHOAMI /USER\n"
  60. IDS_WHOAMI_HLP54 " WHOAMI /USER /FO LIST\n"
  61. IDS_WHOAMI_HLP55 " WHOAMI /USER /FO CSV\n"
  62. IDS_WHOAMI_HLP56 " WHOAMI /GROUPS\n"
  63. IDS_WHOAMI_HLP57 " WHOAMI /GROUPS /FO CSV /NH\n"
  64. IDS_WHOAMI_HLP58 " WHOAMI /PRIV\n"
  65. IDS_WHOAMI_HLP59 " WHOAMI /PRIV /FO TABLE\n"
  66. IDS_WHOAMI_HLP60 " WHOAMI /USER /GROUPS\n"
  67. IDS_WHOAMI_HLP61 " WHOAMI /USER /GROUPS /PRIV\n"
  68. IDS_WHOAMI_HLP62 " WHOAMI /ALL\n"
  69. IDS_WHOAMI_HLP63 " WHOAMI /ALL /FO LIST\n"
  70. IDS_WHOAMI_HLP64 " WHOAMI /ALL /FO CSV /NH\n"
  71. IDS_WHOAMI_HLP65 " WHOAMI /?\n"
  72. END
  73. STRINGTABLE DISCARDABLE
  74. BEGIN
  75. IDS_INVALID_SYNERROR "ERROR: Invalid syntax. \nType ""WHOAMI /?"" for usage.\n"
  76. IDS_INVALID_SID "ERROR: Unexpected error occurred.\n"
  77. IDS_INVALID_FORMAT "ERROR: Invalid format (/FO) specified.\nType ""WHOAMI /?"" for usage.\n"
  78. IDS_FORMAT_MSG_FAIL "ERROR: Unexpected error occurred - error code was %u.\n"
  79. IDS_NO_GROUPS "ERROR: Unable to get group membership information.\n"
  80. IDS_ERROR_UPN "ERROR: Unable to get User Principal Name (UPN) as the current logged-on user\n is not a domain user.\n"
  81. IDS_ERROR_FQDN "ERROR: Unable to get Fully Qualified Distinguished Name (FQDN) as the current\n logged-on user is not a domain user.\n"
  82. IDS_NOT_NH_LIST "ERROR: /NH switch cannot be used with the LIST format.\nType ""WHOAMI /?"" for usage.\n"
  83. END
  84. STRINGTABLE DISCARDABLE
  85. BEGIN
  86. IDS_IGNORE_LOCALCREDENTIALS "\nWARNING: User credentials cannot be used for local connections.\n"
  87. END
  88. STRINGTABLE DISCARDABLE
  89. BEGIN
  90. IDS_LIST_USER_NAMES "USER INFORMATION\n"
  91. IDS_DISPLAY_USER_DASH "----------------\n\n"
  92. IDS_LIST_GROUP_NAMES "GROUP INFORMATION\n"
  93. IDS_DISPLAY_GROUP_DASH "-----------------\n\n"
  94. IDS_LIST_LOGON_ID "LOGON ID INFORMATION\n"
  95. IDS_DISPLAY_LOGON_DASH "--------------------\n\n"
  96. IDS_LIST_PRIV_NAMES "PRIVILEGES INFORMATION\n"
  97. IDS_DISPLAY_PRIV_DASH "----------------------\n\n"
  98. IDS_LIST_FQDN "FQDN\n"
  99. IDS_LIST_UPN "UPN\n"
  100. IDS_SLASH "-----\n"
  101. IDS_STATE_ENABLED "Enabled"
  102. IDS_STATE_DISABLED "Disabled"
  103. IDS_COL_USERNAME "User Name"
  104. IDS_COL_SID "SID"
  105. IDS_COL_GROUP_NAME "Group Name"
  106. IDS_COL_TYPE_GROUP "Type"
  107. IDS_COL_GROUP_SID "SID"
  108. IDS_COL_ATTRIBUTE "Attributes"
  109. IDS_COL_PRIV_NAME "Privilege Name"
  110. IDS_COL_PRIV_DESC "Description"
  111. IDS_COL_PRIV_STATE "State"
  112. IDS_TYPE_USER "User"
  113. IDS_TYPE_GROUP "Group"
  114. IDS_TYPE_DOMAIN "Domain"
  115. IDS_TYPE_ALIAS "Alias"
  116. IDS_TYPE_WELLKNOWN "Well-known group"
  117. IDS_TYPE_DELETACCOUNT "Deleted account"
  118. IDS_TYPE_INVALIDSID "Invalid SID"
  119. IDS_TYPE_UNKNOWN "Unknown SID type"
  120. IDS_ATTRIB_MANDATORY "Mandatory group"
  121. IDS_ATTRIB_BYDEFAULT "Enabled by default"
  122. IDS_ATTRIB_ENABLED "Enabled group"
  123. IDS_ATTRIB_OWNER "Group owner"
  124. IDS_ATTRIB_USEFORDENY "Group used for deny only"
  125. IDS_ATTRIB_LOGONID "Logon ID"
  126. IDS_ATTRIB_LOCAL "Local Group"
  127. END
  128. #include <ntverp.h>
  129. #define VER_FILETYPE VFT_APP
  130. #define VER_FILESUBTYPE VFT2_UNKNOWN
  131. #define VER_FILEDESCRIPTION_STR "whoami - displays logged on user information"
  132. #define VER_INTERNALNAME_STR "whoami.exe"
  133. #define VER_ORIGINALFILENAME_STR "whoami.exe"
  134. #include <common.ver>