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.

2037 lines
57 KiB

  1. //Localizable
  2. var L_USERRESULTS_TEXT = "Group Policy Results for ";
  3. var L_COMPUTERRESULTS_TEXT = "Group Policy Results for ";
  4. var L_POLICY_TEXT= "Policy";
  5. var L_USERINFO_TEXT= "User Information";
  6. var L_USER_TEXT= "UserName:";
  7. var L_LASTGPAPPLIED_TEXT= "Last time Group Policy was applied:";
  8. var L_GPAPPLIEDFROM_TEXT= "Group Policy was applied from";
  9. //var TAG_SHOWDETAIL = "Show Detail";
  10. //var TAG_HIDEDETAIL = "Hide Detail";
  11. var L_GPOLIST_TEXT= "Applied Group Policy Objects";
  12. var L_FRIENDLYNAME_TEXT = "Friendly Name";
  13. var L_GUID_TEXT = "GUID";
  14. var L_SECURITYGR_TEXT = "Security Group Membership when Group Policy was applied";
  15. var L_COMPINFO_TEXT = "Computer Information";
  16. var L_COMPUTERNAME_TEXT = "ComputerName:";
  17. var L_SITE_TEXT = "Site:";
  18. var L_IECFG_TEXT = "Internet Explorer Automatic Browser Configuration";
  19. var L_AUTOCONFIG_TEXT = "Automatic Configuration";
  20. var L_CONFIGFILE_TEXT = "Configuration File";
  21. var L_LOCATION_TEXT = "Location";
  22. var L_IEPROXYSETTINGS_TEXT = "Internet Explorer Proxy Server Settings";
  23. var L_LAN_TEXT = "LAN Proxy Server Settings";
  24. var L_PROXYSERVER_TEXT = "Proxy Server";
  25. var L_ADDRESS_TEXT = "Address";
  26. var L_PORT_TEXT = "Port";
  27. var L_IED11_TEXT = "Automatically detect configuration settings";
  28. var L_IED12_TEXT = "Enable automatic configuration";
  29. var L_IED21_TEXT = "Auto Configuration URL (.INS file)";
  30. var L_IED22_TEXT = "Auto Configuration URL (.JS, .JVS, PAC file)";
  31. var L_IED31_TEXT = "Use a proxy server";
  32. var L_IED32_TEXT = "Use the same proxy server for all connections";
  33. var L_IED33_TEXT = "Bypass proxy server for internal addresses";
  34. var L_IED41_TEXT = "HTTP";
  35. var L_IED42_TEXT = "Secure";
  36. var L_IED43_TEXT = "FTP";
  37. var L_IED44_TEXT = "Gopher";
  38. var L_YES_TEXT = "Yes";
  39. var L_NO_TEXT = "No";
  40. var L_LOGONSCRIPTS_TEXT = "Logon Scripts";
  41. var L_PARAMETERS_TEXT = "Parameters";
  42. var L_SOURCEGPO_TEXT = "Source GPO";
  43. var L_LOGOFFSCRIPTS_TEXT = "Logoff Scripts";
  44. var L_REDIRECTEDFOLDERS_TEXT = "Redirected Folders";
  45. var L_FOLDERNAME_TEXT = "Folder Name";
  46. var L_FOLDERPATH_TEXT = "Path";
  47. var L_FOLDERSETTING_TEXT = "Setting";
  48. var L_REGSETTINGS_TEXT = "Registry Settings";
  49. var L_DISPLAYNAME_TEXT = "Display Name";
  50. var L_KEYNAME_TEXT = "Registry Key";
  51. var L_STATE_TEXT = "State";
  52. //var L_REGINFO_TEXT = "Only registry settings set from default.adm files will have their Display Name listed in the tables above.";
  53. var L_REGINFO_TEXT = "<b>Note</b> Only registry settings from default .adm files have their display names listed in the table above.";
  54. var L_STARTUPSCRIPTS_TEXT = "Startup Scripts";
  55. var L_SHUTDOWNSCRIPTS_TEXT = "Shutdown Scripts";
  56. var L_APPSINSTALLED_TEXT = "Programs Installed";
  57. var L_NAME_TEXT = "Name";
  58. var L_VERSION_TEXT = "Version";
  59. var L_SOURCE_TEXT = "Source";
  60. var L_DEPLOYEDSTATE_TEXT = "Deployed State";
  61. var L_ASSIGNED_TEXT = "Assigned";
  62. var L_PUBLISHED_TEXT = "Published";
  63. var L_ARPAPPS_TEXT = "Programs listed in Add or Remove Programs";
  64. var L_RGROUPS_TEXT = "Security Settings - Restricted Groups";
  65. var L_GNAME_TEXT = "Group Name";
  66. var L_MEMBERS_TEXT = "Members";
  67. var L_FILESYS_TEXT = "Security Settings - File System";
  68. var L_ONAME_TEXT = "Object Name";
  69. var L_GUNAMES_TEXT = "Groups or User names";
  70. var L_PERMISIONS_TEXT = "Permissions";
  71. var L_REGISTRY_TEXT = "Security Settings - Registry";
  72. var L_RSOPTOOLLINK_TEXT = "<b>Run the Resultant Set of Policy tool</b>";
  73. //var L_RSOPTOOLLINKMSG_TEXT = "For more detailed information on policy settings that were applied to this computer run the the Resultant Set of Policy tool";
  74. var L_RSOPTOOLLINKMSG_TEXT = "View more detailed information about policy settings that were applied to this computer.";
  75. var L_EMAILREPORTLINK_TEXT = "<b>Save a snapshot of the currently displayed information to an .htm file</b>";
  76. //var L_EMAILREPORTLINKPROMPT_TEXT = "Please enter a full path name of a file to save to";
  77. var L_EMAILREPORTLINKPROMPT_TEXT = "Type the path to the location where you want to save the file:";
  78. //var L_EMAILREPORTLINKMSG_TEXT = "Save this report to a file so that you can email it to another user and get assistance in troubleshooting your computer.";
  79. var L_EMAILREPORTLINKMSG_TEXT = "Save this report to a file so that you can e-mail it to someone who can help you troubleshoot your computer.";
  80. var L_SAVEFILEERRORPART1_TEXT = "An error occurred trying to save the file '";
  81. var L_SAVEFILEERRORPART2_TEXT = "'\nThe error was '";
  82. var L_SAVEFILEERRORPART3_TEXT = "'";
  83. var L_SAVEFILEERRORPART4_TEXT = "'\nTry saving the file to your My Documents folder.\ne.g. '";
  84. var L_SAVEFILEERRORPART5_TEXT = "'";
  85. var L_INVALD_TEXT = "Invalid";
  86. var L_ALLOW_TEXT = "allow";
  87. var L_DENY_TEXT = "deny";
  88. var L_BASIC_TEXT = "Basic";
  89. var L_ADVANCED_TEXT = "Advanced";
  90. var L_NOTTAVAIL_TEXT = "Not available";
  91. var L_RIGHTS_TEXT = new Object();
  92. L_RIGHTS_TEXT["GA"] = "Full Control";
  93. L_RIGHTS_TEXT["GR"] = "Generic Read";
  94. L_RIGHTS_TEXT["GW"] = "Generic Write ";
  95. L_RIGHTS_TEXT["GX"] = "Execute Generic";
  96. L_RIGHTS_TEXT["RC"] = "Read Control";
  97. L_RIGHTS_TEXT["SD"] = "Delete";
  98. L_RIGHTS_TEXT["WD"] = "Change Security";
  99. L_RIGHTS_TEXT["WO"] = "Change Owner";
  100. L_RIGHTS_TEXT["RP"] = "Ads Read Property";
  101. L_RIGHTS_TEXT["WP"] = "Ads Write Property";
  102. L_RIGHTS_TEXT["CC"] = "Ads Create Child";
  103. L_RIGHTS_TEXT["DC"] = "Ads Delete Child";
  104. L_RIGHTS_TEXT["LC"] = "Ads List";
  105. L_RIGHTS_TEXT["SW"] = "Ads Self";
  106. L_RIGHTS_TEXT["LO"] = "Ads List Object";
  107. L_RIGHTS_TEXT["DT"] = "Ads Delete Tree";
  108. L_RIGHTS_TEXT["CR"] = "Ads Control Access";
  109. L_RIGHTS_TEXT["FA"] = "Full Control";
  110. L_RIGHTS_TEXT["FR"] = "Read File";
  111. L_RIGHTS_TEXT["FW"] = "Write File";
  112. L_RIGHTS_TEXT["FX"] = "Execute File";
  113. L_RIGHTS_TEXT["KA"] = "Key Full Control";
  114. L_RIGHTS_TEXT["KR"] = "Read Key";
  115. L_RIGHTS_TEXT["KW"] = "Write Key";
  116. L_RIGHTS_TEXT["KX"] = "Execute Key";
  117. var L_USERS_TEXT = new Object();
  118. L_USERS_TEXT["AO"] = "Account operators";
  119. L_USERS_TEXT["AU"] = "Authenticated users";
  120. L_USERS_TEXT["BA"] = "Built-in administrators";
  121. L_USERS_TEXT["BG"] = "Built-in guests";
  122. L_USERS_TEXT["BO"] = "Backup operators";
  123. L_USERS_TEXT["BU"] = "Built-in users";
  124. L_USERS_TEXT["CA"] = "Certificate server administrators";
  125. L_USERS_TEXT["CG"] = "Creator group";
  126. L_USERS_TEXT["CO"] = "Creator owner";
  127. L_USERS_TEXT["DA"] = "Domain administrators";
  128. L_USERS_TEXT["DC"] = "Domain computers";
  129. L_USERS_TEXT["DD"] = "Domain controllers";
  130. L_USERS_TEXT["DG"] = "Domain guests";
  131. L_USERS_TEXT["DU"] = "Domain users";
  132. L_USERS_TEXT["ED"] = "Enterprise domain controllers";
  133. L_USERS_TEXT["IU"] = "Interactively logged-on user";
  134. L_USERS_TEXT["LA"] = "Local administrator";
  135. L_USERS_TEXT["LG"] = "Local guest";
  136. L_USERS_TEXT["NU"] = "Network logon user";
  137. L_USERS_TEXT["PO"] = "Printer operators";
  138. L_USERS_TEXT["PS"] = "Personal self";
  139. L_USERS_TEXT["PU"] = "Power users";
  140. L_USERS_TEXT["RC"] = "Restricted code";
  141. L_USERS_TEXT["RE"] = "Replicator";
  142. L_USERS_TEXT["SA"] = "Schema administrators";
  143. L_USERS_TEXT["SO"] = "Server operators";
  144. L_USERS_TEXT["SU"] = "Service logon user";
  145. L_USERS_TEXT["SY"] = "Local System";
  146. L_USERS_TEXT["WD"] = "World (Everyone)";
  147. var L_DISABLED_TEXT = "Resultant Set Of Policy Logging has been disabled on this computer.<br>For more information contact your Administrator.";
  148. var L_NOPOLICY_TEXT = "No Group Policy Settings have been applied to you or your computer.<br><a href=\"#\" class=\"sys-font-body sys-link-normal\" onclick=\"Run('%windir%\\help\\spconcepts.chm')\">Learn more about using Group Policy to customize your computer.</a>";
  149. //var L_MSGARP_TEXT = "This list of Software Applications seen in Add / Remove Programs is determined by the last time Add / Remove Programs was used be this user. To get the most up to date list, run Add / Remove Programs from the Control Panel and re-run this report.";
  150. var L_MSGARP_TEXT = "<b>Note</b> This list of programs is determined by the last time Add or Remove Programs was used by the current user. To get the most up-to-date list, open Control Panel, click <b>Add or Remove Programs</b>, and then run this report again.";
  151. var L_SDDLTITLE_TEXT = "resolve to friendly name, this can take several seconds";
  152. var L_GMT_TEXT = " GMT";
  153. //End Localizable
  154. var TAG_A_EMAIL = "<a href=\"#\" onclick=\"EmailReport_OnClick()\" class=\"sys-font-body sys-link-normal\">";
  155. var TAG_BARROW = "<img border=0 src=\"graphics\\barrow.gif\">";
  156. var TAG_A_RSOP = "<a href=\"#\" onclick=\"Run('Rsop.msc')\" class=\"sys-font-body sys-link-normal\">";
  157. var DOWNIMG = "down.bmp"
  158. //var TAG_SHOWDETAIL = "<img border=\"0\" src=\"graphics\\"+DOWNIMG+"\">";
  159. //var TAG_HIDEDETAIL = "<img border=\"0\" src=\"graphics\\up.gif\">";
  160. var TAG_SHOWDETAIL = "<helpcenter:bitmap style=\"width:19px;height:19px;vertical-align:middle;\" SRCNORMAL=\"hcp://system/sysinfo/graphics/"+DOWNIMG+"\"></helpcenter:bitmap>";
  161. var TAG_HIDEDETAIL = "<helpcenter:bitmap style=\"width:19px;height:19px;vertical-align:middle;\" SRCNORMAL=\"hcp://system/sysinfo/graphics/up.bmp\"></helpcenter:bitmap>";
  162. var g_svcs_cimv2 = null;
  163. var g_svcs_LoggingProvider = null;
  164. var g_svcs_NamespaceName = null;
  165. var g_svcs_RSOPUser = null;
  166. var g_svcs_RSOPComputer = null;
  167. var g_server = null;
  168. var g_noPolicy = false;
  169. //var g_trace = true;
  170. var g_trace = false;
  171. var NS_CIMV2 = "root\\cimv2";
  172. var NS_USR = "root\\RSOP\\user";
  173. var NS_COMP = "root\\RSOP\\computer";
  174. var LOGON = 1, LOGOFF = 2, STARTUP = 3, SHUTDOWN = 4;
  175. var APPLIED = 1, REMOVED = 2, ARP = 3;
  176. //var EmailReportLink = "<form id=\"EmailForm\" action=\"mailto:[email protected]\" method=get><input name=subject type=hidden value=\"RSoP+Report\"><input name=body type=hidden value=><input type=submit value=\"" + L_EMAILREPORTLINK_TEXT + "\" onclick=\"EmailReport_OnClick()\"></form><br>";
  177. //var EmailReportLink = "<input type=button value=\"" + L_EMAILREPORTLINK_TEXT + "\" onclick=\"EmailReport_OnClick()\"><br>";
  178. //var EmailReportLink = "<a href=\"#\" onclick=\"EmailReport_OnClick()\"><img border=0 src=\"graphics\\barrow.gif\"></a>&nbsp;<b>" + L_EMAILREPORTLINK_TEXT + "</b><p>";
  179. //var EmailReportLink = "<a href=\"#\" onclick=\"EmailReport_OnClick()\"><img border=0 src=\"graphics\\barrow.gif\"></a>";
  180. //var RSoPToolLink = "<a href=\"#\" onclick=\"Run('Rsop.msc')\"><img border=0 src=\"graphics\\barrow.gif\"></a>&nbsp;<b>" + L_RSOPTOOLLINK_TEXT + "</b><p>";
  181. //var RSoPToolLink = "<a href=\"#\" onclick=\"Run('Rsop.msc')\"><img border=0 src=\"graphics\\barrow.gif\"></a>";
  182. // used to dynamically assign id's to elements
  183. var UniqueId = 5000
  184. function ToggleView(lnk, table)
  185. {
  186. //toggle between show & hide
  187. if(lnk.innerHTML.search(DOWNIMG) != -1)
  188. {
  189. lnk.innerHTML = TAG_HIDEDETAIL;
  190. document.all[table].all.tr.style.display = "";//show it
  191. }
  192. else
  193. {
  194. lnk.innerHTML = TAG_SHOWDETAIL;
  195. document.all[table].all.tr.style.display = "none";//don't show it
  196. }
  197. window.event.returnValue = false;
  198. }
  199. function ToggleViewEx(lnk, table)
  200. {
  201. //toggle between show & hide
  202. if(lnk.innerHTML.search(DOWNIMG) != -1)
  203. {
  204. lnk.innerHTML = TAG_HIDEDETAIL;
  205. document.all[table].all.tr1.style.display = "";//show it
  206. document.all[table].all.tr2.style.display = "";//show it
  207. }
  208. else
  209. {
  210. lnk.innerHTML = TAG_SHOWDETAIL;
  211. document.all[table].all.tr1.style.display = "none";//don't show it
  212. document.all[table].all.tr2.style.display = "none";//don't show it
  213. }
  214. window.event.returnValue = false;
  215. }
  216. function InitWBEMServices()
  217. {
  218. var loc = wbemlocator;
  219. // try{
  220. if(!g_svcs_cimv2)
  221. {
  222. trace("connecting g_svcs_cimv2");
  223. g_svcs_cimv2 = loc.ConnectServer(".", NS_CIMV2);
  224. }
  225. var insts = new Enumerator(g_svcs_cimv2.InstancesOf("Win32_ComputerSystem"));
  226. var mainArray = new Array();
  227. var subArray = new Array(4);
  228. for(; !insts.atEnd(); insts.moveNext())
  229. {
  230. var inst = insts.item();
  231. subArray[0] = inst.UserName;
  232. subArray[1] = inst.Domain;
  233. }
  234. var DomainName=null;
  235. var UserName=null;
  236. var LoggedOnUserName = new String(subArray[0]);
  237. var searchchar = /\\/;
  238. if(LoggedOnUserName.search(searchchar) == -1)
  239. {
  240. //Then the format of the user name is not domain\user format
  241. UserName = LoggedOnUserName;
  242. }
  243. else
  244. {
  245. var LoggedOnUserLength = LoggedOnUserName.length;
  246. DomainName = new String(LoggedOnUserName.split("\\",1));
  247. var DomainNameLength = DomainName.length;
  248. UserName = LoggedOnUserName.substring(DomainNameLength+1, LoggedOnUserLength);
  249. }
  250. var strQuery;
  251. if(DomainName == null)
  252. {
  253. strQuery = "Select * From Win32_UserAccount Where Name=" + "\"" + UserName + "\"";
  254. }
  255. else
  256. {
  257. strQuery = "Select * From Win32_UserAccount Where Name=" + "\"" + UserName + "\"" + " AND Domain=" + "\"" + DomainName + "\"";
  258. }
  259. var insts = new Enumerator(g_svcs_cimv2.ExecQuery(strQuery));
  260. var SIDArray = new Array(2);
  261. for(; !insts.atEnd(); insts.moveNext())
  262. {
  263. var inst = insts.item();
  264. SIDArray[1] = inst.SID;
  265. }
  266. trace("connecting to root\\rsop");
  267. var svcs = loc.ConnectServer(".", "root\\rsop");
  268. g_svcs_LoggingProvider = svcs.get("RsopLoggingModeProvider");
  269. var method = g_svcs_LoggingProvider.Methods_("RsopCreateSession");
  270. var inParam = method.inParameters.SpawnInstance_();
  271. trace("calling RsopCreateSession("+SIDArray[1]+")");
  272. inParam.userSid = SIDArray[1];
  273. var outParam;
  274. outParam = g_svcs_LoggingProvider.ExecMethod_("RsopCreateSession", inParam);
  275. g_svcs_NamespaceName = outParam.nameSpace;
  276. try
  277. {
  278. trace("connecting to "+g_svcs_NamespaceName+"\\User");
  279. g_svcs_RSOPUser = loc.ConnectServer(".", g_svcs_NamespaceName+"\\User");
  280. g_svcs_RSOPComputer = loc.ConnectServer(".", g_svcs_NamespaceName+"\\computer");
  281. }
  282. catch(e)
  283. {
  284. inParam.flags = 2;
  285. outParam = g_svcs_LoggingProvider.ExecMethod_("RsopCreateSession", inParam);
  286. g_svcs_NamespaceName = outParam.nameSpace;
  287. trace("connecting to "+g_svcs_NamespaceName+"\\User");
  288. g_svcs_RSOPUser = loc.ConnectServer(".", g_svcs_NamespaceName+"\\User");
  289. g_svcs_RSOPComputer = loc.ConnectServer(".", g_svcs_NamespaceName+"\\computer");
  290. }
  291. // }
  292. // catch(e)
  293. // {
  294. // HandleErr(e);
  295. // }
  296. }
  297. function CleanupWMI() {
  298. var method = g_svcs_LoggingProvider.Methods_("RsopDeleteSession");
  299. var inParam = method.inParameters.SpawnInstance_();
  300. inParam.nameSpace = g_svcs_NamespaceName;
  301. var outParam = g_svcs_LoggingProvider.ExecMethod_("RsopDeleteSession", inParam);
  302. }
  303. function displayTableSegment(outerDiv, dataArray) {
  304. var tableElement = document.all[outerDiv];
  305. var strHTML = "";
  306. var noOfInstances = dataArray.length;
  307. if (noOfInstances == 0)
  308. // tableElement.outerHTML = "<table width='100%'><tr bgcolor='#E6E6E6'><td align='left'>" + TAG_NONE + "</td></tr></table>";
  309. tableElement.outerHTML = "<table width=\"100%\" cellspacing=0 cellpadding=0><tr class=\"sys-table-cell-bgcolor2 sys-font-body sys-color-body\"><td align='left' style=\"padding : 0.5em;\">" + TAG_NONE + "</td></tr></table>";
  310. else
  311. {
  312. var cnt = 1;
  313. for(var i=0; i < noOfInstances; i++)
  314. {
  315. if(tableElement.all["tr_0"])
  316. {
  317. currTR = tableElement.all["tr_0"];
  318. if(cnt%2 == 0)
  319. {
  320. // currTR.bgcolor = "#FFFFFF";
  321. currTR.className = "sys-table-cell-bgcolor1 sys-font-body sys-color-body";
  322. cnt = 1;
  323. }
  324. else
  325. {
  326. // currTR.bgcolor = "#E6E6E6";
  327. currTR.className = "sys-table-cell-bgcolor2 sys-font-body sys-color-body";
  328. cnt++;
  329. }
  330. }
  331. else
  332. cnt = 0;
  333. for(var k=0; k < dataArray[i].length; k++)
  334. {
  335. if(tableElement.all["tr_" + (k+1)])
  336. {
  337. currTR = tableElement.all["tr_" + (k+1)];
  338. if(cnt%2 == 0)
  339. {
  340. // currTR.bgcolor = "#FFFFFF";
  341. currTR.className = "sys-table-cell-bgcolor1 sys-font-body sys-color-body";
  342. cnt = 1;
  343. }
  344. else
  345. {
  346. // currTR.bgcolor = "#E6E6E6";
  347. currTR.className = "sys-table-cell-bgcolor2 sys-font-body sys-color-body";
  348. cnt++;
  349. }
  350. }
  351. tableElement.all["Data_" + (k+1)].innerHTML = dataArray[i][k] ? dataArray[i][k] : TAG_NONE;
  352. //document.all[outerDiv + "_" + (k+1)].innerHTML = dataArray[i][k] ? dataArray[i][k] : TAG_UNKNOWN;
  353. }
  354. strHTML += tableElement.outerHTML;
  355. }
  356. tableElement.outerHTML = strHTML;
  357. }
  358. }
  359. function ShowUserInfo()
  360. {
  361. var insts = new Enumerator(g_svcs_cimv2.InstancesOf("Win32_ComputerSystem"));
  362. var mainArray = new Array();
  363. var subArray = new Array(3);
  364. for(; !insts.atEnd(); insts.moveNext())
  365. {
  366. var inst = insts.item();
  367. subArray[0] = inst.UserName;
  368. subArray[1] = inst.Domain;
  369. }
  370. UserResults.innerHTML = UserResults.innerHTML + subArray[0];
  371. var strQuery = "Select * From rsop_extensionstatus Where extensionguid = '{00000000-0000-0000-0000-000000000000}'";
  372. var insts = new Enumerator(g_svcs_RSOPUser.ExecQuery(strQuery));
  373. for(; !insts.atEnd(); insts.moveNext())
  374. {
  375. var inst = insts.item();
  376. subArray[2] = getDateTime(inst.endTime) + L_GMT_TEXT;
  377. }
  378. mainArray[mainArray.length] = subArray;
  379. displayTableSegment("UserInfo", mainArray);
  380. }
  381. function ShowListGPO(svcs)
  382. {
  383. var strQuery = "Select * From rsop_gplink Where appliedorder != 0";
  384. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  385. var mainArray = new Array();
  386. for(; !insts.atEnd(); insts.moveNext())
  387. {
  388. var subArray = new Array(2);
  389. var inst = insts.item();
  390. var gpoid = inst.GPO;
  391. if(gpoid)
  392. {
  393. gpoid = gpoid.slice(gpoid.search(/=/) + 1); //after the first "="
  394. strQuery = "Select * From rsop_gpo Where id = " + gpoid;
  395. var insts2 = new Enumerator(svcs.ExecQuery(strQuery));
  396. for(; !insts2.atEnd(); insts2.moveNext())
  397. {
  398. var inst2 = insts2.item();
  399. subArray[0] = inst2.name;
  400. subArray[1] = inst2.guidName;
  401. }
  402. }
  403. mainArray[mainArray.length] = subArray;
  404. }
  405. if(svcs == g_svcs_RSOPUser)
  406. displayTableSegment("usergpolist", mainArray);
  407. else
  408. displayTableSegment("compgpolist", mainArray);
  409. }
  410. function ShowSecurityGr(svcs)
  411. {
  412. var bSubString;
  413. var SecGroupArray, objVal=null;
  414. var i;
  415. var strQuery = "Select * From RSOP_Session";
  416. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  417. var mainArray = new Array();
  418. if (insts.atEnd()) {
  419. g_noPolicy = true;
  420. return;
  421. }
  422. for(; !insts.atEnd(); insts.moveNext())
  423. {
  424. var inst = insts.item();
  425. objVal = inst.SecurityGroups;
  426. if(objVal != null)
  427. {
  428. SecGroupArray = objVal.toArray();
  429. for(i=0;i<SecGroupArray.length;i++)
  430. {
  431. var subArray = new Array(1);
  432. // subArray[0] = SecGroupArray[i];
  433. // subArray[0] = "<a href=# id=\"a"+UniqueId+"\" title=\""+L_SDDLTITLE_TEXT+"\" class=\"sys-font-body sys-link-normal\" onclick=\"ResolveSID('"+SecGroupArray[i]+"', '"+UniqueId+"')\">"+SecGroupArray[i]+"</a>";
  434. subArray[0] = _ResolveSIDWorker(SecGroupArray[i]);
  435. UniqueId += 1;
  436. mainArray[mainArray.length] = subArray;
  437. }
  438. }
  439. }
  440. if(svcs == g_svcs_RSOPUser)
  441. displayTableSegment("usersecuritygr", mainArray);
  442. else
  443. displayTableSegment("compsecuritygr", mainArray);
  444. }
  445. function ShowScripts(type)
  446. {
  447. var svcs = null, elementName = null;
  448. switch(type)
  449. {
  450. case LOGON:
  451. elementName = "logon";
  452. svcs = g_svcs_RSOPUser;
  453. break;
  454. case LOGOFF:
  455. elementName = "logoff";
  456. svcs = g_svcs_RSOPUser;
  457. break;
  458. case STARTUP:
  459. elementName = "startup";
  460. svcs = g_svcs_RSOPComputer;
  461. break;
  462. case SHUTDOWN:
  463. elementName = "shutdown";
  464. svcs = g_svcs_RSOPComputer;
  465. break;
  466. default:
  467. //throw("type may not be null")
  468. }
  469. var strQuery = "Select * From RSOP_ScriptPolicySetting Where Precedence = 1 and ScriptType = " + type;
  470. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  471. var mainArray = new Array();
  472. for(; !insts.atEnd(); insts.moveNext())
  473. {
  474. var inst = insts.item();
  475. var inst1 = inst.scriptList;
  476. var gpoid = inst.GPOID;
  477. if(inst)
  478. {
  479. var inst2 = new VBArray(inst1).toArray();
  480. var i;
  481. for(i=0; i<inst2.length;i++)
  482. {
  483. var subArray = new Array(3);
  484. subArray[0] = intelliBreak(inst2[i].script, " ", 25);
  485. subArray[1] = intelliBreak(inst2[i].arguments, " ", 25);
  486. if(gpoid)
  487. {
  488. strQuery = "Select * From rsop_gpo Where id =" + "\"" + gpoid + "\"";
  489. var gpoinsts = new Enumerator(svcs.ExecQuery(strQuery));
  490. for(; !gpoinsts.atEnd(); gpoinsts.moveNext())
  491. {
  492. var gpo = gpoinsts.item();
  493. subArray[2] = gpo.Name;
  494. }
  495. }
  496. mainArray[mainArray.length] = subArray;
  497. }
  498. }
  499. }
  500. displayTableSegment(elementName, mainArray);
  501. }
  502. function ShowRedirectedFolders(svcs)
  503. {
  504. var strQuery = "Select * FROM RSOP_FolderRedirectionPolicySetting Where Precedence = 1";
  505. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  506. var mainArray = new Array();
  507. for(; !insts.atEnd(); insts.moveNext())
  508. {
  509. var inst = insts.item();
  510. var subArray = new Array(4);
  511. subArray[0] = inst.Name;
  512. subArray[1] = inst.resultantPath;
  513. subArray[2] = inst.installationType;
  514. // check and see if we know the string representation for this type
  515. if (subArray[2] == 1) {
  516. subArray[2] = L_BASIC_TEXT;
  517. } else if (subArray[2] == 2) {
  518. subArray[2] = L_ADVANCED_TEXT;
  519. }
  520. var gpoid = inst.GPOID;
  521. if(gpoid)
  522. {
  523. strQuery = "Select * From rsop_gpo Where id =" + "\"" + gpoid + "\"";
  524. var insts2 = new Enumerator(svcs.ExecQuery(strQuery));
  525. for(; !insts2.atEnd(); insts2.moveNext())
  526. {
  527. var inst2 = insts2.item();
  528. subArray[3] = inst2.Name;
  529. }
  530. }
  531. mainArray[mainArray.length] = subArray;
  532. }
  533. displayTableSegment("RedirectFolders", mainArray);
  534. }
  535. function ShowApps(svcs, type)
  536. {
  537. var strQuery = "Select * FROM RSOP_ApplicationManagementPolicySetting Where Precedence = 1 and EntryType = " + type;
  538. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  539. var mainArray = new Array();
  540. for(; !insts.atEnd(); insts.moveNext())
  541. {
  542. var inst = insts.item();
  543. if(type == ARP)
  544. {
  545. var subArray = new Array(4);
  546. }
  547. else
  548. {
  549. var subArray = new Array(5);
  550. }
  551. subArray[0] = intelliBreak(inst.Name, " ", 15);
  552. subArray[1] = intelliBreak(inst.VersionNumberHi + "." + inst.VersionNumberLo, " ", 10);
  553. if(type == APPLIED)
  554. {
  555. subArray[2] = intelliBreak(inst.PackageLocation, "\\", 25);
  556. }
  557. else
  558. {
  559. subArray[2] = intelliBreak(inst.PackageLocation, "", 40);
  560. }
  561. if(type == APPLIED)
  562. {
  563. subArray[3] = (inst.DeploymentType == 1) ? L_ASSIGNED_TEXT : ((inst.DeploymentType == 2) ? L_PUBLISHED_TEXT : TAG_UNKNOWN);
  564. }
  565. var gpoid = inst.GPOID;
  566. if(gpoid)
  567. {
  568. strQuery = "Select * From rsop_gpo Where id = '" + gpoid + "'";
  569. var insts2 = new Enumerator(svcs.ExecQuery(strQuery));
  570. for(; !insts2.atEnd(); insts2.moveNext())
  571. {
  572. var inst2 = insts2.item();
  573. if(type == ARP)
  574. {
  575. subArray[3] = intelliBreak(inst2.Name, "", 15);
  576. }
  577. else
  578. {
  579. subArray[4] = intelliBreak(inst2.Name, "", 15);
  580. }
  581. }
  582. }
  583. mainArray[mainArray.length] = subArray;
  584. }
  585. if(svcs == g_svcs_RSOPUser)
  586. {
  587. if(type == APPLIED)
  588. displayTableSegment("userinstalledapps", mainArray);
  589. else if(type == ARP)
  590. displayTableSegment("userarpapps", mainArray);
  591. }
  592. else
  593. {
  594. if(type == APPLIED)
  595. displayTableSegment("compinstalledapps", mainArray);
  596. else if(type == ARP)
  597. displayTableSegment("comparpapps", mainArray);
  598. }
  599. }
  600. function ShowRegSettings(svcs)
  601. {
  602. var bSubString;
  603. var objValue;
  604. var strQuery = "Select * From RSOP_RegistryPolicySetting Where Precedence = 1";
  605. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  606. var mainArray = new Array();
  607. for(; !insts.atEnd(); insts.moveNext())
  608. {
  609. var subArray = new Array(4);
  610. var inst = insts.item();
  611. //Check if the Registry key contains "Software\Policies\Microsoft\SystemCertificates"
  612. //If so skip this as we need not display the same
  613. var RegKeyString = new String(inst.registryKey);
  614. var regExp = /Software\\Policies\\Microsoft\\SystemCertificates/;
  615. var bSubString = RegKeyString.search(regExp);
  616. if(bSubString != -1)
  617. {
  618. continue;
  619. }
  620. name = inst.registryKey + ":" + inst.valueName
  621. // name = intelliBreak(inst.registryKey, "\\", 30);
  622. // subArray[0] = intelliBreak(name, "\\", 50);
  623. // intellibreak after ExpandRegistryNames
  624. subArray[0] = name;
  625. subArray[1] = intelliBreak(inst.registryKey, "\\", 15);
  626. subArray[1] += "\\" + "<br><b>" + intelliBreak(inst.valueName, "", 15) + "</b>";
  627. /*
  628. if (inst.valueName != null) {
  629. subArray[1] = intelliBreak(inst.valueName, "", 10);
  630. } else {
  631. subArray[1] = null;
  632. }
  633. */
  634. objValue = inst.value;
  635. objValue = objValue.toArray();
  636. // alert("rg="+inst.registryKey+"\nn="+inst.valueName+"\nvt="+inst.valueType+"\nv="+objValue.length);
  637. if(inst.valueType == 4) //This means that its a DWORD value
  638. {
  639. var sum=0;
  640. var j;
  641. objValue = objValue.reverse();
  642. for(j=0;j<objValue.length;j++)
  643. {
  644. sum <<=8;
  645. sum += objValue[j];
  646. }
  647. objValue = sum.toString(10);
  648. }
  649. else if(inst.valueType == 1) //This means its a REG_SZ value
  650. {
  651. var tempStr = "";
  652. var i=0;
  653. //Convert the byte Array into String - reason WMI gives it like that
  654. for(i=0;i<objValue.length;i += 2)
  655. {
  656. var char = 0;
  657. char = objValue[i+1];
  658. char <<= 8;
  659. char += objValue[i];
  660. // var newchar1 = objValue[i+1];
  661. // var newchar = newchar1 + objValue[i];
  662. if (char > 0) {
  663. tempStr += String.fromCharCode(char);
  664. }
  665. }
  666. objValue = intelliBreak(tempStr, "", 9);
  667. }
  668. else if (false) // we only handle REG_DWORD + REG_SZ
  669. {
  670. var tempStr = "";
  671. var i=0;
  672. //Convert the byte Array into String - reason WMI gives it like that
  673. for(i=0;i<objValue.length;i++)
  674. {
  675. var newchar1 = "0x" + objValue[i+1];
  676. var newchar = newchar1 + objValue[i];
  677. newchar = String.fromCharCode(newchar);
  678. tempStr += newchar;
  679. i++;
  680. }
  681. objValue = intelliBreak(tempStr, "", 9);
  682. } else {
  683. objValue = null;
  684. }
  685. subArray[2] = objValue;
  686. var gpoid = inst.GPOID;
  687. if(gpoid)
  688. {
  689. strQuery = "Select * From rsop_gpo Where id = '" + gpoid + "'";
  690. var insts2 = new Enumerator(svcs.ExecQuery(strQuery));
  691. for(; !insts2.atEnd(); insts2.moveNext())
  692. {
  693. var inst2 = insts2.item();
  694. subArray[3] = intelliBreak(inst2.Name, " ", 15);
  695. }
  696. }
  697. mainArray[mainArray.length] = subArray;
  698. }
  699. // now use the mainArray to find out if we can expand friendly names
  700. ExpandRegistryNames(mainArray);
  701. if(svcs == g_svcs_RSOPUser)
  702. displayTableSegment("userregsettings", mainArray);
  703. else
  704. displayTableSegment("compregsettings", mainArray);
  705. }
  706. function ShowCompInfo()
  707. {
  708. var insts = new Enumerator(g_svcs_cimv2.InstancesOf("Win32_ComputerSystem"));
  709. var mainArray = new Array();
  710. var subArray = new Array(4);
  711. for(; !insts.atEnd(); insts.moveNext())
  712. {
  713. var inst = insts.item();
  714. subArray[0] = inst.Name;
  715. subArray[1] = inst.Domain;
  716. }
  717. ComputerResults.innerHTML = ComputerResults.innerHTML + subArray[0];
  718. var insts = new Enumerator(g_svcs_RSOPComputer.InstancesOf("RSOP_Session"));
  719. for(; !insts.atEnd(); insts.moveNext())
  720. {
  721. var inst = insts.item();
  722. subArray[2] = inst.Site;
  723. }
  724. var strQuery = "Select * From rsop_extensionstatus Where extensionguid = '{00000000-0000-0000-0000-000000000000}'";
  725. var insts = new Enumerator(g_svcs_RSOPComputer.ExecQuery(strQuery));
  726. for(; !insts.atEnd(); insts.moveNext())
  727. {
  728. var inst = insts.item();
  729. subArray[3] = getDateTime(inst.endtime) + L_GMT_TEXT;
  730. }
  731. mainArray[mainArray.length] = subArray;
  732. displayTableSegment("CompInfo", mainArray);
  733. }
  734. function DisplayLocStrings() {
  735. setWaitMessage(MSG_WAIT);
  736. Refresh.innerHTML = TAG_REFRESH;
  737. UserResults.innerHTML = L_USERRESULTS_TEXT;
  738. UserInfo_View.innerHTML = TAG_HIDEDETAIL;
  739. with(UserInfo.all) {
  740. Caption.innerHTML = L_USERINFO_TEXT;
  741. Label1.innerHTML = "<B>" + L_USER_TEXT+ "</B>";
  742. Label2.innerHTML = "<B>" + TAG_DOMAIN + ":</B>";
  743. Label3.innerHTML = "<B>" + L_LASTGPAPPLIED_TEXT+ "</B>";
  744. }
  745. UserGPOList_View.innerHTML = TAG_HIDEDETAIL;
  746. with(UserGPOList.all) {
  747. Caption.innerHTML = L_GPOLIST_TEXT;
  748. Col1.innerHTML = "<B>" + L_FRIENDLYNAME_TEXT + "</B>";
  749. Col2.innerHTML = "<B>" + L_GUID_TEXT + "</B>";
  750. }
  751. UserSecurityGr_View.innerHTML = TAG_HIDEDETAIL;
  752. with(UserSecurityGr.all) {
  753. Caption.innerHTML = L_SECURITYGR_TEXT;
  754. }
  755. IeCfg_View.innerHTML = TAG_HIDEDETAIL;
  756. with(IeCfg.all) {
  757. Caption.innerHTML = L_IECFG_TEXT;
  758. Col11.innerHTML = "<B>" + L_AUTOCONFIG_TEXT + "</B>";
  759. Col12.innerHTML = "<B>" + L_STATE_TEXT + "</B>";
  760. Col13.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  761. Col21.innerHTML = "<B>" + L_CONFIGFILE_TEXT + "</B>";
  762. Col22.innerHTML = "<B>" + L_LOCATION_TEXT + "</B>";
  763. Col23.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  764. }
  765. IeProxySettings_View.innerHTML = TAG_HIDEDETAIL;
  766. with(IeProxySettings.all) {
  767. Caption.innerHTML = L_IEPROXYSETTINGS_TEXT;
  768. Col11.innerHTML = "<B>" + L_LAN_TEXT + "</B>";
  769. Col12.innerHTML = "<B>" + L_STATE_TEXT + "</B>";
  770. Col13.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  771. Col21.innerHTML = "<B>" + L_PROXYSERVER_TEXT + "</B>";
  772. Col22.innerHTML = "<B>" + L_ADDRESS_TEXT + "</B>";
  773. Col23.innerHTML = "<B>" + L_PORT_TEXT + "</B>";
  774. Col24.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  775. }
  776. LogonScripts_View.innerHTML = TAG_HIDEDETAIL;
  777. with(LogonScripts.all) {
  778. Caption.innerHTML = L_LOGONSCRIPTS_TEXT;
  779. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  780. Col2.innerHTML = "<B>" + L_PARAMETERS_TEXT + "</B>";
  781. Col3.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  782. }
  783. LogoffScripts_View.innerHTML = TAG_HIDEDETAIL;
  784. with(LogoffScripts.all) {
  785. Caption.innerHTML = L_LOGOFFSCRIPTS_TEXT;
  786. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  787. Col2.innerHTML = "<B>" + L_PARAMETERS_TEXT + "</B>";
  788. Col3.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  789. }
  790. RedirectedFolders_View.innerHTML = TAG_HIDEDETAIL;
  791. with(RedirectedFolders.all) {
  792. Caption.innerHTML = L_REDIRECTEDFOLDERS_TEXT;
  793. Col1.innerHTML = "<B>" + L_FOLDERNAME_TEXT + "<B>";
  794. Col2.innerHTML = "<B>" + L_FOLDERPATH_TEXT + "</B>";
  795. Col3.innerHTML = "<B>" + L_FOLDERSETTING_TEXT + "</B>";
  796. Col4.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  797. }
  798. UserInstalledApps_View.innerHTML = TAG_HIDEDETAIL;
  799. with(UserInstalledApps.all) {
  800. Caption.innerHTML = L_APPSINSTALLED_TEXT;
  801. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  802. Col2.innerHTML = "<B>" + L_VERSION_TEXT + "</B>";
  803. Col3.innerHTML = "<B>" + L_SOURCE_TEXT + "</B>";
  804. Col4.innerHTML = "<B>" + L_DEPLOYEDSTATE_TEXT + "</B>";
  805. Col5.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  806. }
  807. UserARPApps_View.innerHTML = TAG_HIDEDETAIL;
  808. with(UserARPApps.all) {
  809. Caption.innerHTML = L_ARPAPPS_TEXT;
  810. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  811. Col2.innerHTML = "<B>" + L_VERSION_TEXT + "</B>";
  812. Col3.innerHTML = "<B>" + L_SOURCE_TEXT + "</B>";
  813. Col4.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  814. }
  815. UserARPText.innerHTML = L_MSGARP_TEXT;
  816. UserRegSettings_View.innerHTML = TAG_HIDEDETAIL;
  817. with(UserRegSettings.all) {
  818. Caption.innerHTML = L_REGSETTINGS_TEXT;
  819. Col1.innerHTML = "<B>" + L_DISPLAYNAME_TEXT + "</B>";
  820. Col2.innerHTML = "<B>" + L_KEYNAME_TEXT + "</B>";
  821. Col3.innerHTML = "<B>" + L_STATE_TEXT + "</B>";
  822. Col4.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  823. }
  824. UserRegSettingsText.innerHTML = L_REGINFO_TEXT;
  825. ComputerResults.innerHTML = L_COMPUTERRESULTS_TEXT;
  826. CompInfo_View.innerHTML = TAG_HIDEDETAIL;
  827. with(CompInfo.all) {
  828. Caption.innerHTML = L_COMPINFO_TEXT;
  829. Label1.innerHTML = "<B>" + L_COMPUTERNAME_TEXT + "</B>";
  830. Label2.innerHTML = "<B>" + TAG_DOMAIN + ":</B>";
  831. Label3.innerHTML = "<B>" + L_SITE_TEXT + "</B>";
  832. Label4.innerHTML = "<B>" + L_LASTGPAPPLIED_TEXT+ "</B>";
  833. }
  834. CompGPOList_View.innerHTML = TAG_HIDEDETAIL;
  835. with(CompGPOList.all) {
  836. Caption.innerHTML = L_GPOLIST_TEXT;
  837. Col1.innerHTML = "<B>" + L_FRIENDLYNAME_TEXT + "</B>";
  838. Col2.innerHTML = "<B>" + L_GUID_TEXT + "</B>";
  839. }
  840. CompSecurityGr_View.innerHTML = TAG_HIDEDETAIL;
  841. with(CompSecurityGr.all) {
  842. Caption.innerHTML = L_SECURITYGR_TEXT;
  843. }
  844. StartupScripts_View.innerHTML = TAG_HIDEDETAIL;
  845. with(StartupScripts.all) {
  846. Caption.innerHTML = L_STARTUPSCRIPTS_TEXT;
  847. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  848. Col2.innerHTML = "<B>" + L_PARAMETERS_TEXT + "</B>";
  849. Col3.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  850. }
  851. ShutdownScripts_View.innerHTML = TAG_HIDEDETAIL;
  852. with(ShutdownScripts.all) {
  853. Caption.innerHTML = L_SHUTDOWNSCRIPTS_TEXT;
  854. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  855. Col2.innerHTML = "<B>" + L_PARAMETERS_TEXT + "</B>";
  856. Col3.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  857. }
  858. CompInstalledApps_View.innerHTML = TAG_HIDEDETAIL;
  859. with(CompInstalledApps.all) {
  860. Caption.innerHTML = L_APPSINSTALLED_TEXT;
  861. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  862. Col2.innerHTML = "<B>" + L_VERSION_TEXT + "</B>";
  863. Col3.innerHTML = "<B>" + L_SOURCE_TEXT + "</B>";
  864. Col4.innerHTML = "<B>" + L_DEPLOYEDSTATE_TEXT + "</B>";
  865. Col5.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  866. }
  867. CompARPApps_View.innerHTML = TAG_HIDEDETAIL;
  868. with(CompARPApps.all) {
  869. Caption.innerHTML = L_ARPAPPS_TEXT;
  870. Col1.innerHTML = "<B>" + L_NAME_TEXT + "</B>";
  871. Col2.innerHTML = "<B>" + L_VERSION_TEXT + "</B>";
  872. Col3.innerHTML = "<B>" + L_SOURCE_TEXT + "</B>";
  873. Col4.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  874. }
  875. CompARPText.innerHTML = L_MSGARP_TEXT;
  876. CompRegSettings_View.innerHTML = TAG_HIDEDETAIL;
  877. with(CompRegSettings.all) {
  878. Caption.innerHTML = L_REGSETTINGS_TEXT;
  879. Col1.innerHTML = "<B>" + L_DISPLAYNAME_TEXT + "</B>";
  880. Col2.innerHTML = "<B>" + L_KEYNAME_TEXT + "</B>";
  881. Col3.innerHTML = "<B>" + L_STATE_TEXT + "</B>";
  882. Col4.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  883. }
  884. CompRegSettingsText.innerHTML = L_REGINFO_TEXT;
  885. CompRestrictedGroups_View.innerHTML = TAG_HIDEDETAIL;
  886. with(CompRestrictedGroups.all) {
  887. Caption.innerHTML = L_RGROUPS_TEXT;
  888. Col1.innerHTML = "<B>" + L_GNAME_TEXT + "</B>";
  889. Col2.innerHTML = "<B>" + L_MEMBERS_TEXT + "</B>";
  890. Col3.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  891. }
  892. CompFileSystem_View.innerHTML = TAG_HIDEDETAIL;
  893. with(CompFileSystem.all) {
  894. Caption.innerHTML = L_FILESYS_TEXT;
  895. Col1.innerHTML = "<B>" + L_ONAME_TEXT + "</B>";
  896. Col2.innerHTML = "<B>" + L_PERMISIONS_TEXT + "</B>";
  897. Col3.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  898. }
  899. CompRegistry_View.innerHTML = TAG_HIDEDETAIL;
  900. with(CompRegistry.all) {
  901. Caption.innerHTML = L_REGISTRY_TEXT;
  902. Col1.innerHTML = "<B>" + L_ONAME_TEXT + "</B>";
  903. Col2.innerHTML = "<B>" + L_PERMISIONS_TEXT + "</B>";
  904. Col3.innerHTML = "<B>" + L_SOURCEGPO_TEXT + "</B>";
  905. }
  906. EmailLink1.innerHTML = TAG_A_EMAIL + TAG_BARROW + "</a>";
  907. EmailLink2.innerHTML = TAG_A_EMAIL + L_EMAILREPORTLINK_TEXT + "</a>";
  908. EmailLink3.innerHTML = L_EMAILREPORTLINKMSG_TEXT;
  909. RSOPToolLink1.innerHTML = TAG_A_RSOP + TAG_BARROW + "</a>";
  910. RSOPToolLink2.innerHTML = TAG_A_RSOP + L_RSOPTOOLLINK_TEXT + "</a>";
  911. RSOPToolLink3.innerHTML = L_RSOPTOOLLINKMSG_TEXT;
  912. }
  913. function LoadChores(n) {
  914. var ErrCaught = false;
  915. try
  916. {
  917. _body.style.cursor= "wait";
  918. switch (n) {
  919. case 0:
  920. trace("tracing on");
  921. // check that logging has not been disabled
  922. try
  923. {
  924. var reg = new ActiveXObject("WScript.Shell")
  925. val = reg.RegRead("HKLM\\Software\\Policies\\Microsoft\\Windows\\System\\RSoPLogging")
  926. if (val == 0) {
  927. setWaitMessage(L_DISABLED_TEXT);
  928. hide_meter();
  929. _body.style.cursor= "auto";
  930. return;
  931. }
  932. }
  933. catch (e)
  934. {
  935. // do nothing
  936. }
  937. break;
  938. case 1:
  939. //set remoteServer
  940. g_server = ShowServerName(L_POLICY_TEXT);
  941. Title.innerHTML = (g_server ? (TAG_REMOTECOMPINFO + " \\\\" + g_server) : TAG_LOCALADVINFO) + (L_POLICY_TEXT ? (" - " + L_POLICY_TEXT) : "");
  942. break;
  943. case 2:
  944. InitWBEMServices();
  945. break;
  946. case 3:
  947. ShowUserInfo();
  948. break;
  949. case 4:
  950. ShowListGPO(g_svcs_RSOPUser);
  951. break;
  952. case 5:
  953. ShowSecurityGr(g_svcs_RSOPUser);
  954. // check that we have some policy applied
  955. if (g_noPolicy) {
  956. // give a link to "%windir%\\help\\spconcepts.chm"
  957. setWaitMessage(L_NOPOLICY_TEXT);
  958. hide_meter();
  959. window.focus();
  960. return;
  961. }
  962. break;
  963. case 6:
  964. ShowScripts(LOGON);
  965. break;
  966. case 7:
  967. ShowScripts(LOGOFF);
  968. break;
  969. case 8:
  970. ShowRedirectedFolders(g_svcs_RSOPUser);
  971. break;
  972. case 9:
  973. ShowApps(g_svcs_RSOPUser, APPLIED);
  974. break;
  975. case 10:
  976. ShowApps(g_svcs_RSOPUser, ARP);//Add Remove Programs List
  977. break;
  978. case 11:
  979. ShowRegSettings(g_svcs_RSOPUser);
  980. break;
  981. case 12:
  982. ShowCompInfo();
  983. break;
  984. case 13:
  985. ShowListGPO(g_svcs_RSOPComputer);
  986. break;
  987. case 14:
  988. ShowSecurityGr(g_svcs_RSOPComputer);
  989. break;
  990. case 15:
  991. ShowScripts(STARTUP);
  992. break;
  993. case 16:
  994. ShowScripts(SHUTDOWN);
  995. break;
  996. case 17:
  997. ShowApps(g_svcs_RSOPComputer, APPLIED);
  998. break;
  999. case 18:
  1000. ShowApps(g_svcs_RSOPComputer, ARP);//Add Remove Programs List
  1001. break;
  1002. case 19:
  1003. ShowRegSettings(g_svcs_RSOPComputer);
  1004. break;
  1005. case 20:
  1006. ShowSecRGroups(g_svcs_RSOPComputer);
  1007. break;
  1008. case 21:
  1009. ShowSecFileSystem(g_svcs_RSOPComputer);
  1010. break;
  1011. case 22:
  1012. ShowSecRegistry(g_svcs_RSOPComputer);
  1013. break;
  1014. case 23:
  1015. ShowIeSettings(g_svcs_RSOPUser);
  1016. break;
  1017. } // switch
  1018. n += 1;
  1019. } // try
  1020. catch (e)
  1021. {
  1022. ErrCaught = true;
  1023. HandleErr(e);
  1024. }
  1025. try {
  1026. if (ErrCaught) {
  1027. DrawProgressBar(100, "")
  1028. } else {
  1029. DrawProgressBar((n/24)*100, "")
  1030. }
  1031. }catch (e) {}
  1032. trace ("n="+n);
  1033. if ((ErrCaught && n > 2) || n == 24) {
  1034. try {
  1035. CleanupWMI();
  1036. } catch (e) {
  1037. if (ErrCaught == false) {
  1038. ErrCaught = true;
  1039. HandleErr(e);
  1040. }
  1041. }
  1042. }
  1043. if (ErrCaught) {
  1044. hide_meter();
  1045. _body.style.cursor= "auto";
  1046. } else if (n == 24) {
  1047. hide_meter();
  1048. _header.style.display = "none";
  1049. _data.style.display = "";
  1050. _body.style.cursor= "auto";
  1051. } else {
  1052. window.setTimeout("LoadChores("+n+")", TIMEOUT);
  1053. }
  1054. }
  1055. /*
  1056. var ti = 0 ;
  1057. var tinc = 1;
  1058. var tcolor = "darkblue";
  1059. var tid = -1;
  1060. function window_Timer()
  1061. {
  1062. if (ti == 11) {
  1063. for (i=0; i<11; ++i) {
  1064. el = "td" + i;
  1065. document.all(el).style.backgroundColor = "white";
  1066. }
  1067. ti = 0;
  1068. // tcolor = "white";
  1069. // tinc = -1;
  1070. } else if (ti == -1) {
  1071. ti = 0;
  1072. tcolor = "blue";
  1073. tinc = 1;
  1074. }
  1075. el = "td" + ti;
  1076. document.all(el).style.backgroundColor = tcolor;
  1077. ti += tinc;
  1078. }
  1079. */
  1080. function dispatchFunction() {
  1081. _body.style.cursor= "wait";
  1082. // tid = window.setInterval(window_Timer, 500);
  1083. DisplayLocStrings();
  1084. SetProgressBarImage();
  1085. window.setTimeout("LoadChores(0)", TIMEOUT);
  1086. }
  1087. function hide_meter()
  1088. {
  1089. /*
  1090. for (i=0; i<11; ++i) {
  1091. el = "td" + i;
  1092. document.all(el).style.backgroundColor = "white";
  1093. }
  1094. window.clearInterval(tid);
  1095. */
  1096. }
  1097. function ShowSecRGroups(svcs)
  1098. {
  1099. var strQuery = "Select * From RSOP_RestrictedGroup Where Precedence = 1";
  1100. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  1101. var mainArray = new Array();
  1102. for(; !insts.atEnd(); insts.moveNext())
  1103. {
  1104. var subArray = new Array(3);
  1105. var inst = insts.item();
  1106. subArray[0] = intelliBreak(inst.GroupName, " ", 15);
  1107. subArray[1] = intelliBreak(inst.Members, " ", 30);
  1108. var gpoid = inst.GPOID;
  1109. if(gpoid)
  1110. {
  1111. strQuery = "Select * From rsop_gpo Where id = '" + gpoid + "'";
  1112. var insts2 = new Enumerator(svcs.ExecQuery(strQuery));
  1113. for(; !insts2.atEnd(); insts2.moveNext())
  1114. {
  1115. var inst2 = insts2.item();
  1116. subArray[2] = intelliBreak(inst2.Name, " ", 15);
  1117. }
  1118. }
  1119. mainArray[mainArray.length] = subArray;
  1120. } // for(; !insts.atEnd(); insts.moveNext())
  1121. displayTableSegment("comprestrictedgroups", mainArray);
  1122. }
  1123. function ShowSecFileSystem(svcs)
  1124. {
  1125. var strQuery = "Select * From RSOP_File Where Precedence = 1";
  1126. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  1127. var mainArray = new Array();
  1128. for(; !insts.atEnd(); insts.moveNext())
  1129. {
  1130. var subArray = new Array(3);
  1131. var inst = insts.item();
  1132. subArray[0] = intelliBreak(inst.Path, "", 13);
  1133. subArray[1] = FormatSDDL(inst.SDDLString);
  1134. var gpoid = inst.GPOID;
  1135. if(gpoid)
  1136. {
  1137. strQuery = "Select * From rsop_gpo Where id = '" + gpoid + "'";
  1138. var insts2 = new Enumerator(svcs.ExecQuery(strQuery));
  1139. for(; !insts2.atEnd(); insts2.moveNext())
  1140. {
  1141. var inst2 = insts2.item();
  1142. subArray[2] = intelliBreak(inst2.Name, " ", 15);
  1143. }
  1144. }
  1145. mainArray[mainArray.length] = subArray;
  1146. } // for(; !insts.atEnd(); insts.moveNext())
  1147. displayTableSegment("compfilesystem", mainArray);
  1148. }
  1149. function ShowSecRegistry(svcs)
  1150. {
  1151. var strQuery = "Select * From RSOP_RegistryKey Where Precedence = 1";
  1152. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  1153. var mainArray = new Array();
  1154. for(; !insts.atEnd(); insts.moveNext())
  1155. {
  1156. var subArray = new Array(3);
  1157. var inst = insts.item();
  1158. subArray[0] = intelliBreak(inst.Path, "", 13);
  1159. subArray[1] = FormatSDDL(inst.SDDLString);
  1160. var gpoid = inst.GPOID;
  1161. if(gpoid)
  1162. {
  1163. strQuery = "Select * From rsop_gpo Where id = '" + gpoid + "'";
  1164. var insts2 = new Enumerator(svcs.ExecQuery(strQuery));
  1165. for(; !insts2.atEnd(); insts2.moveNext())
  1166. {
  1167. var inst2 = insts2.item();
  1168. subArray[2] = intelliBreak(inst2.Name, " ", 15);
  1169. }
  1170. }
  1171. mainArray[mainArray.length] = subArray;
  1172. } // for(; !insts.atEnd(); insts.moveNext())
  1173. displayTableSegment("compregistry", mainArray);
  1174. }
  1175. function EmailReport_OnClick()
  1176. {
  1177. // document.forms("EmailForm").elements("body").value = escape(document.all.tags("HTML").item(0).outerHTML);
  1178. var b = 0;
  1179. var l = 0;
  1180. var txt = "";
  1181. var fso = new ActiveXObject("Scripting.FileSystemObject");
  1182. // unhide both registry tables
  1183. d1 = document.all["CompRegSettings"].all.tr.style.display;
  1184. d2 = document.all["UserRegSettings"].all.tr.style.display;
  1185. document.all["CompRegSettings"].all.tr.style.display = "";
  1186. document.all["UserRegSettings"].all.tr.style.display = "";
  1187. DefaultFileName = WshShell.ExpandEnvironmentStrings("%USERPROFILE%\\My Documents\\MyPolicy.htm")
  1188. FileName = window.prompt(L_EMAILREPORTLINKPROMPT_TEXT, DefaultFileName);
  1189. if (FileName) {
  1190. try {
  1191. var f= fso.CreateTextFile(FileName, true);
  1192. txt = document.all.tags("HTML").item(0).outerHTML;
  1193. // remove our onload javascript function from the saved file
  1194. txt = txt.replace("onload=dispatchFunction()>", ">")
  1195. while (true) {
  1196. // can't write in chunks larger than 64k/2 (bstr char limitation)
  1197. b = Math.min(txt.length, 1000);
  1198. txt1 = txt.slice(0, b);
  1199. // try {
  1200. f.Write(txt1);
  1201. // } catch (e) {
  1202. // alert(txt1);
  1203. // }
  1204. if (b < txt.length) {
  1205. txt = txt.slice(b, txt.length);
  1206. } else {
  1207. break;
  1208. }
  1209. }
  1210. f.Close();
  1211. } catch (e) {
  1212. if (FileName != DefaultFileName) {
  1213. alert(L_SAVEFILEERRORPART1_TEXT + FileName + L_SAVEFILEERRORPART2_TEXT + e.description + L_SAVEFILEERRORPART4_TEXT + DefaultFileName + L_SAVEFILEERRORPART5_TEXT);
  1214. } else {
  1215. alert(L_SAVEFILEERRORPART1_TEXT + FileName + L_SAVEFILEERRORPART2_TEXT + e.description + L_SAVEFILEERRORPART3_TEXT);
  1216. }
  1217. }
  1218. }
  1219. document.all["CompRegSettings"].all.tr.style.display = d1;
  1220. document.all["UserRegSettings"].all.tr.style.display = d2;
  1221. // document.forms("EmailForm").elements("body").value = "Test";
  1222. //document.EmailForm.submit();
  1223. window.event.returnValue = false;
  1224. }
  1225. function ShowIeSettings(svcs)
  1226. {
  1227. var inst = null;
  1228. var strQuery = "Select * From RSOP_IEConnectionSettings Where rsopPrecedence = 1";
  1229. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  1230. var inst = null;
  1231. for(; !insts.atEnd(); insts.moveNext())
  1232. {
  1233. inst = insts.item();
  1234. }
  1235. var mainArray = new Array();
  1236. var subArray = new Array(3);
  1237. subArray[0] = L_IED11_TEXT;
  1238. if (inst != null && inst.autoDetectConfigSettings) {
  1239. subArray[1] = L_YES_TEXT;
  1240. } else {
  1241. subArray[1] = L_NO_TEXT;
  1242. }
  1243. if (inst != null) {
  1244. subArray[2] = intelliBreak(inst.rsopID, " ", 15);
  1245. }
  1246. mainArray[mainArray.length] = subArray;
  1247. var subArray = new Array(3);
  1248. subArray[0] = L_IED12_TEXT;
  1249. if (inst != null && inst.autoConfigEnable) {
  1250. subArray[1] = L_YES_TEXT;
  1251. } else {
  1252. subArray[1] = L_NO_TEXT;
  1253. }
  1254. if (inst != null) {
  1255. subArray[2] = intelliBreak(inst.rsopID, " ", 15);
  1256. }
  1257. mainArray[mainArray.length] = subArray;
  1258. displayTableSegment("iecfg1", mainArray);
  1259. var mainArray = new Array();
  1260. var subArray = new Array(3);
  1261. subArray[0] = L_IED21_TEXT;
  1262. if (inst != null) {
  1263. subArray[1] = inst.autoConfigURL;
  1264. subArray[2] = intelliBreak(inst.rsopID, " ", 15);
  1265. }
  1266. mainArray[mainArray.length] = subArray;
  1267. var subArray = new Array(3);
  1268. subArray[0] = L_IED22_TEXT;
  1269. if (inst != null) {
  1270. subArray[1] = inst.autoProxyURL;
  1271. subArray[2] = intelliBreak(inst.rsopID, " ", 15);
  1272. }
  1273. mainArray[mainArray.length] = subArray;
  1274. displayTableSegment("iecfg2", mainArray);
  1275. var strQuery = "Select * From RSOP_IEProxySettings Where rsopPrecedence = 1";
  1276. var insts = new Enumerator(svcs.ExecQuery(strQuery));
  1277. var inst = null;
  1278. for(; !insts.atEnd(); insts.moveNext())
  1279. {
  1280. inst = insts.item();
  1281. }
  1282. var mainArray = new Array();
  1283. var subArray = new Array(3);
  1284. subArray[0] = L_IED31_TEXT;
  1285. if (inst != null && inst.enableProxy) {
  1286. subArray[1] = L_YES_TEXT;
  1287. } else {
  1288. subArray[1] = L_NO_TEXT;
  1289. }
  1290. if (inst != null) {
  1291. subArray[2] = intelliBreak(inst.rsopID, " ", 15);
  1292. }
  1293. mainArray[mainArray.length] = subArray;
  1294. var subArray = new Array(3);
  1295. subArray[0] = L_IED32_TEXT;
  1296. if (inst != null && inst.useSameProxy) {
  1297. subArray[1] = L_YES_TEXT;
  1298. } else {
  1299. subArray[1] = L_NO_TEXT;
  1300. }
  1301. if (inst != null) {
  1302. subArray[2] = intelliBreak(inst.rsopID, " ", 15);
  1303. }
  1304. var subArray = new Array(3);
  1305. subArray[0] = L_IED33_TEXT;
  1306. if (inst != null) {
  1307. var str = inst.proxyOverride;
  1308. if (str != null && str.search("<local>") != -1 ) {
  1309. subArray[1] = L_YES_TEXT;
  1310. } else {
  1311. subArray[1] = L_NO_TEXT;
  1312. }
  1313. } else {
  1314. subArray[1] = L_NO_TEXT;
  1315. }
  1316. if (inst != null) {
  1317. subArray[2] = intelliBreak(inst.rsopID, " ", 15);
  1318. }
  1319. mainArray[mainArray.length] = subArray;
  1320. displayTableSegment("ieproxysettings1", mainArray);
  1321. var mainArray = new Array();
  1322. var subArray = new Array(4);
  1323. subArray[0] = L_IED41_TEXT;
  1324. if (inst != null && inst.httpProxyServer) {
  1325. str = inst.httpProxyServer.toString();
  1326. rg = str.match(/([^:]*):([^:]*)/)
  1327. if (rg.length >= 2) {
  1328. subArray[1] = rg[1];
  1329. subArray[2] = rg[2];
  1330. }
  1331. }
  1332. if (inst != null) {
  1333. subArray[3] = intelliBreak(inst.rsopID, " ", 15);
  1334. }
  1335. mainArray[mainArray.length] = subArray;
  1336. var subArray = new Array(4);
  1337. subArray[0] = L_IED42_TEXT;
  1338. if (inst != null && inst.secureProxyServer) {
  1339. str = inst.secureProxyServer.toString();
  1340. rg = str.match(/([^:]*):([^:]*)/)
  1341. if (rg.length >= 2) {
  1342. subArray[1] = rg[1];
  1343. subArray[2] = rg[2];
  1344. }
  1345. }
  1346. if (inst != null) {
  1347. subArray[3] = intelliBreak(inst.rsopID, " ", 15);
  1348. }
  1349. mainArray[mainArray.length] = subArray;
  1350. var subArray = new Array(4);
  1351. subArray[0] = L_IED43_TEXT;
  1352. if (inst != null && inst.ftpProxyServer) {
  1353. str = inst.ftpProxyServer.toString();
  1354. rg = str.match(/([^:]*):([^:]*)/)
  1355. if (rg.length >= 2) {
  1356. subArray[1] = rg[1];
  1357. subArray[2] = rg[2];
  1358. }
  1359. }
  1360. if (inst != null) {
  1361. subArray[3] = intelliBreak(inst.rsopID, " ", 15);
  1362. }
  1363. mainArray[mainArray.length] = subArray;
  1364. var subArray = new Array(4);
  1365. subArray[0] = L_IED44_TEXT;
  1366. if (inst != null && inst.gopherProxyServer) {
  1367. str = inst.gopherProxyServer.toString();
  1368. rg = str.match(/([^:]*):([^:]*)/)
  1369. if (rg.length >= 2) {
  1370. subArray[1] = rg[1];
  1371. subArray[2] = rg[2];
  1372. }
  1373. }
  1374. if (inst != null) {
  1375. subArray[3] = intelliBreak(inst.rsopID, " ", 15);
  1376. }
  1377. mainArray[mainArray.length] = subArray;
  1378. displayTableSegment("ieproxysettings2", mainArray);
  1379. }
  1380. function FormatSDDL(sddl)
  1381. {
  1382. var first = true;
  1383. var retval = "";
  1384. switch (sddl.charAt(0)) {
  1385. case "D":
  1386. i = sddl.search(/\(/);
  1387. if (i == -1)
  1388. return TAG_NONE;
  1389. sddl = sddl.slice(i);
  1390. while (sddl.charAt(0) == "(") {
  1391. i = sddl.search(/\)/);
  1392. ace = sddl.slice(0, i+1);
  1393. rg = ace.match( /\(([^;]*);([^;]*);([^;]*);([^;]*);([^;]*);([^;]*)\)/ );
  1394. var permissions = "";
  1395. var rights = "";
  1396. if (rg != null && rg.length == 7) {
  1397. // special char #1 to bold this text after intellibreak
  1398. permissions += "`";
  1399. user = rg[6];
  1400. if (user.slice(0,2) == "S-") {
  1401. // var username = "@"+rg[6]+"$";
  1402. var username = _ResolveSIDWorker(rg[6]);
  1403. permissions += username;
  1404. } else {
  1405. if (L_USERS_TEXT[rg[6]] != null) {
  1406. permissions += L_USERS_TEXT[rg[6]];
  1407. } else {
  1408. permissions += rg[6];
  1409. }
  1410. } // else // if (user.slice(0,2) == "S-")) {
  1411. permissions += "_";
  1412. permissions += "(";
  1413. if (rg[1] == "A") permissions += L_ALLOW_TEXT + ":";
  1414. else if (rg[1] == "D") permissions += L_DENY_TEXT +":";
  1415. rights = rg[3];
  1416. first = true;
  1417. while (rights.length > 0) {
  1418. if (first == false) {
  1419. permissions += ",";
  1420. } else {
  1421. first = false;
  1422. }
  1423. if (L_RIGHTS_TEXT[rights.slice(0, 2)] != null) {
  1424. permissions += L_RIGHTS_TEXT[rights.slice(0, 2)];
  1425. } else {
  1426. // permissions += rights;
  1427. permissions += TAG_UNKNOWN;
  1428. rights = "XX";
  1429. }
  1430. rights = rights.slice(2);
  1431. } // while (rights.length > 0) {
  1432. first = false;
  1433. permissions += ")";
  1434. str = intelliBreak(permissions, "", 40);
  1435. str = str.replace(/`/g, "<b>");
  1436. str = str.replace(/_/g, "</b>");
  1437. str = str.replace(/@/g, "<a href=# id=\"a"+UniqueId+"\" title=\""+L_SDDLTITLE_TEXT+"\" class=\"sys-font-body sys-link-normal\" onclick=\"ResolveSID('"+rg[6]+"', '"+UniqueId+"')\">");
  1438. UniqueId += 1;
  1439. str = str.replace(/\$/g, "</a>");
  1440. retval += str;
  1441. if (retval.slice(-4) != "<br>") {
  1442. retval += "<br>";
  1443. }
  1444. } // if (rg != null && rg.length == 7)
  1445. sddl = sddl.slice(i+1);
  1446. } // while (sddl.charAt(0) == "(") {
  1447. break;
  1448. case "S":
  1449. case "O":
  1450. case "G":
  1451. }
  1452. return retval;
  1453. }
  1454. function trace(msg) {
  1455. if (g_trace) {
  1456. WaitMessage.innerHTML += msg + "<br>";
  1457. }
  1458. }
  1459. function setWaitMessage(msg) {
  1460. if (g_trace) {
  1461. WaitMessage.innerHTML += msg + "<br>";
  1462. } else {
  1463. WaitMessage.innerHTML = msg;
  1464. }
  1465. }
  1466. function ResolveSID(sid, elname) {
  1467. var el = document.all["a" + elname];
  1468. _body.style.cursor= "wait";
  1469. el.style.cursor = "wait";
  1470. window.setTimeout("_ResolveSID(\""+sid+"\", \""+elname+"\")", TIMEOUT);
  1471. window.event.returnValue = false;
  1472. }
  1473. function _ResolveSIDWorker(sid) {
  1474. var newname = TAG_UNKNOWN
  1475. try {
  1476. newname = pchealth.Security.GetUserDomain(sid);
  1477. if (newname.length > 0) {
  1478. newname += "\\";
  1479. }
  1480. newname += pchealth.Security.GetUserName(sid);
  1481. } catch (e) {
  1482. newname = sid;
  1483. }
  1484. return newname;
  1485. }
  1486. function _ResolveSID(sid, elname) {
  1487. alert("_ResolveSID(\""+sid+"\", \""+elname+"\")");
  1488. var newname = _ResolveSIDWorker(sid);
  1489. // _body.style.cursor= "wait";
  1490. /*
  1491. strQuery = "Select * From Win32_Account Where SID=\"" + sid + "\"";
  1492. var insts = new Enumerator(g_svcs_cimv2.ExecQuery(strQuery));
  1493. if ( !insts.atEnd())
  1494. {
  1495. var inst = insts.item();
  1496. newname = inst.Domain + "\\" + inst.Name;
  1497. }
  1498. */
  1499. var el = document.all["a" + elname];
  1500. el.innerHTML = newname;
  1501. // alert("ih="+el.innerHTML+"\noh="+el.outerHTML+"\nbefore="+txt+"\nafter="+txt.replace(sid, newname)+"\nnewname="+newname);
  1502. _body.style.cursor= "auto";
  1503. el.style.cursor = "auto";
  1504. }
  1505. function ExpandRegistryNames(mainArray)
  1506. {
  1507. var policies = new Object();
  1508. var regentries = new Array();
  1509. for (i=0;i<mainArray.length;++i) {
  1510. regentries[i] = new Object();
  1511. rg = mainArray[i][0].match(/(.*):(.*)/)
  1512. if (rg.length == 3) {
  1513. regentries[i].key = rg[1];
  1514. regentries[i].value = rg[2];
  1515. regentries[i].policy = null;
  1516. }
  1517. }
  1518. WshShell = new ActiveXObject("WScript.Shell")
  1519. FilePath = WshShell.ExpandEnvironmentStrings("%windir%\\inf\\system.adm")
  1520. parseADM(FilePath, -1, policies, regentries);
  1521. FilePath = WshShell.ExpandEnvironmentStrings("%windir%\\inf\\wmplayer.adm")
  1522. parseADM(FilePath, -1, policies, regentries);
  1523. FilePath = WshShell.ExpandEnvironmentStrings("%windir%\\inf\\conf.adm")
  1524. parseADM(FilePath, -1, policies, regentries);
  1525. FilePath = WshShell.ExpandEnvironmentStrings("%windir%\\inf\\inetres.adm")
  1526. parseADM(FilePath, 0, policies, regentries);
  1527. // plug them in
  1528. for (i=0;i<regentries.length;++i) {
  1529. if (regentries[i].policy != null && regentries[i].policy.friendlyName != null) {
  1530. mainArray[i][0] = intelliBreak(regentries[i].policy.friendlyName, " ", 20);
  1531. } else {
  1532. // mainArray[i][0] = intelliBreak(mainArray[i][0], "\\", 20);
  1533. mainArray[i][0] = L_NOTTAVAIL_TEXT;
  1534. }
  1535. }
  1536. } // ExpandRegistryNames
  1537. function parseADM(admFile, unicodeFile, policies, regentries) {
  1538. var fso = new ActiveXObject("scripting.filesystemobject")
  1539. var f = fso.OpenTextFile(admFile, 1, false, unicodeFile)
  1540. var policy = ""
  1541. var valuename = ""
  1542. var keyname = ""
  1543. while ( f.AtEndOfStream != true) {
  1544. l = f.ReadLine();
  1545. d = l.match(/POLICY\s*!!([\w\d]*)/)
  1546. if (d != null && d.length > 1) {
  1547. policy = d[1];
  1548. }
  1549. d = l.match(/KEYNAME\s*"(.*)"/)
  1550. if (d != null && d.length > 1) {
  1551. keyname = d[1];
  1552. }
  1553. d = l.match(/VALUENAME\s*"(.*)"/)
  1554. if (d != null && d.length > 1) {
  1555. valuename = d[1];
  1556. for (i=0;i<regentries.length;++i) {
  1557. if (regentries[i].key == keyname &&
  1558. regentries[i].value == valuename) {
  1559. if (policies[policy] == null) {
  1560. policies[policy] = new Object();
  1561. policies[policy].friendlyName = "";
  1562. }
  1563. regentries[i].policy = policies[policy];
  1564. }
  1565. }
  1566. }
  1567. d = l.match(/VALUEPREFIX\s*"(.*)"/)
  1568. if (d != null && d.length > 1) {
  1569. // we have a list prefix
  1570. valuename = d[1];
  1571. for (i=0;i<regentries.length;++i) {
  1572. if (regentries[i].key == keyname &&
  1573. regentries[i].value.search(valuename) != -1) {
  1574. if (policies[policy] == null) {
  1575. policies[policy] = new Object();
  1576. policies[policy].friendlyName = "";
  1577. }
  1578. regentries[i].policy = policies[policy];
  1579. }
  1580. }
  1581. }
  1582. if (l == "[strings]") {
  1583. break;
  1584. }
  1585. } // while ( f.AtEndOfStream != true) {
  1586. // now find the friendly names
  1587. while ( f.AtEndOfStream != true) {
  1588. l = f.ReadLine();
  1589. d = l.match(/(.*)="(.*)"/)
  1590. if (d != null && d.length > 2) {
  1591. if (policies[d[1]] != null ) {
  1592. policies[d[1]].friendlyName = d[2];
  1593. }
  1594. }
  1595. }
  1596. } // parseADM