private void GenerateUserInformation() { AddBeginTable(); AddHeaderText("Domain"); AddHeaderText("Nb User Accounts"); AddHeaderText("Nb Enabled"); AddHeaderText("Nb Disabled"); AddHeaderText("Nb Active"); AddHeaderText("Nb Inactive"); AddHeaderText("Nb Locked"); AddHeaderText("Nb pwd never Expire"); AddHeaderText("Nb SidHistory"); AddHeaderText("Nb Bad PrimaryGroup"); AddHeaderText("Nb Password not Req."); AddHeaderText("Nb Des enabled."); AddHeaderText("Nb Trusted delegation"); AddHeaderText("Nb Reversible password"); AddBeginTableData(); HealthcheckAccountData total = new HealthcheckAccountData(); foreach (HealthcheckData data in Report) { total.Add(data.UserAccountData); AddEndRow(); AddPrintDomain(data.Domain); AddCellNum(data.UserAccountData.Number); AddCellNum(data.UserAccountData.NumberEnabled); AddCellNum(data.UserAccountData.NumberDisabled); AddCellNum(data.UserAccountData.NumberActive); AddCellNum(data.UserAccountData.NumberInactive); AddCellNum(data.UserAccountData.NumberLocked); AddCellNum(data.UserAccountData.NumberPwdNeverExpires); AddCellNum(data.UserAccountData.NumberSidHistory); AddCellNum(data.UserAccountData.NumberBadPrimaryGroup); AddCellNum(data.UserAccountData.NumberPwdNotRequired); AddCellNum(data.UserAccountData.NumberDesEnabled); AddCellNum(data.UserAccountData.NumberTrustedToAuthenticateForDelegation); AddCellNum(data.UserAccountData.NumberReversibleEncryption); AddEndRow(); } AddEndTable(() => { AddCellText("Total"); AddCellNum(total.Number); AddCellNum(total.NumberEnabled); AddCellNum(total.NumberDisabled); AddCellNum(total.NumberActive); AddCellNum(total.NumberInactive); AddCellNum(total.NumberLocked); AddCellNum(total.NumberPwdNeverExpires); AddCellNum(total.NumberSidHistory); AddCellNum(total.NumberBadPrimaryGroup); AddCellNum(total.NumberPwdNotRequired); AddCellNum(total.NumberDesEnabled); AddCellNum(total.NumberTrustedToAuthenticateForDelegation); AddCellNum(total.NumberReversibleEncryption); }); }
private void GenerateComputerInformation() { AddBeginTable(); AddHeaderText("Domain"); AddHeaderText("Nb Computer Accounts"); AddHeaderText("Nb Enabled"); AddHeaderText("Nb Disabled"); AddHeaderText("Nb Active"); AddHeaderText("Nb Inactive"); AddHeaderText("Nb SidHistory"); AddHeaderText("Nb Bad PrimaryGroup"); AddHeaderText("Nb Trusted delegation"); AddHeaderText("Nb Reversible password"); AddBeginTableData(); HealthcheckAccountData total = new HealthcheckAccountData(); foreach (HealthcheckData data in Report) { if (data.ComputerAccountData == null) { continue; } total.Add(data.ComputerAccountData); AddBeginRow(); AddPrintDomain(data.Domain); AddCellNum(data.ComputerAccountData.Number); AddCellNum(data.ComputerAccountData.NumberEnabled); AddCellNum(data.ComputerAccountData.NumberDisabled); AddCellNum(data.ComputerAccountData.NumberActive); AddCellNum(data.ComputerAccountData.NumberInactive); AddCellNum(data.ComputerAccountData.NumberSidHistory); AddCellNum(data.ComputerAccountData.NumberBadPrimaryGroup); AddCellNum(data.ComputerAccountData.NumberTrustedToAuthenticateForDelegation); AddCellNum(data.ComputerAccountData.NumberReversibleEncryption); AddEndRow(); } AddEndTable(() => { AddCellText("Total"); AddCellNum(total.Number); AddCellNum(total.NumberEnabled); AddCellNum(total.NumberDisabled); AddCellNum(total.NumberActive); AddCellNum(total.NumberInactive); AddCellNum(total.NumberSidHistory); AddCellNum(total.NumberBadPrimaryGroup); AddCellNum(total.NumberTrustedToAuthenticateForDelegation); AddCellNum(total.NumberReversibleEncryption); }); GenerateConsolidatedOperatingSystemList(); }
private void GenerateDCInformation() { AddBeginTable("All DC stats"); AddHeaderText("Domain"); AddHeaderText("Domain controller"); AddHeaderText("Operating System"); AddHeaderText("Creation Date", "Indicates the creation date of the underlying computer object."); AddHeaderText("Startup Time"); AddHeaderText("Uptime"); AddHeaderText("Owner", "This is the owner of the underlying domain controller object stored in the active directory partition. The nTSecurityDescriptor attribute stores its value."); AddHeaderText("Null sessions", "Indicates if an anonymous user can extract information from the domain controller"); AddHeaderText("SMB v1", "Indicates if the domain controller supports this unsafe SMB v1 network protocol."); AddHeaderText("Remote spooler", "Indicates if the spooler service is remotely accessible."); AddHeaderText("FSMO role", "Flexible Single Master Operation. Indicates the server responsible for each role."); AddBeginTableData(); HealthcheckAccountData total = new HealthcheckAccountData(); foreach (HealthcheckData data in Report) { if (data.DomainControllers == null) { continue; } foreach (var dc in data.DomainControllers) { AddBeginRow(); AddPrintDomain(data.Domain); AddCellText(dc.DCName); AddCellText(dc.OperatingSystem); AddCellText((dc.CreationDate == DateTime.MinValue ? "Unknown" : dc.CreationDate.ToString("u"))); AddCellText((dc.StartupTime == DateTime.MinValue ? (dc.LastComputerLogonDate.AddDays(60) < DateTime.Now ? "Inactive?" : "Unknown") : (dc.StartupTime.AddMonths(6) < DateTime.Now ? /*"<span class='unticked'>" +*/ dc.StartupTime.ToString("u") /* + "</span>" */: dc.StartupTime.ToString("u")))); AddCellText((dc.StartupTime == DateTime.MinValue ? "" : (DateTime.Now.Subtract(dc.StartupTime)).Days + " days")); AddCellText((String.IsNullOrEmpty(dc.OwnerName) ? dc.OwnerSID : dc.OwnerName)); AddCellText((dc.HasNullSession ? "YES" : "NO"), true, !dc.HasNullSession); AddCellText((dc.SupportSMB1 ? "YES" : "NO"), true, !dc.SupportSMB1); if (data.version >= new Version(2, 5, 3)) { AddCellText((dc.RemoteSpoolerDetected ? "YES" : "NO"), true, !dc.RemoteSpoolerDetected); } else { AddCellText("Not available"); } if (data.version >= new Version(2, 7)) { Add(@"<Td>"); if (dc.FSMO != null) { Add(string.Join(",<br>", dc.FSMO.ConvertAll(x => ReportHelper.Encode(x)).ToArray())); } Add("</Td>"); } else { AddCellText("Not available"); } AddEndRow(); } } AddEndTable(); }
private void GenerateComputerInformation() { Add(@" <div class=""row""> <div class=""col-md-12 table-responsive""> <table class=""table table-striped table-bordered sortable-theme-bootstrap"" data-sortable=""""> <thead><tr> <th>Domain</th> <th>Nb Computer Accounts</th> <th>Nb Enabled</th> <th>Nb Disabled</th> <th>Nb Active</th> <th>Nb Inactive</th> <th>Nb SidHistory</th> <th>Nb Bad PrimaryGroup</th> <th>Nb Trusted delegation</th> <th>Nb Reversible password</th> </tr> </thead> <tbody> "); HealthcheckAccountData total = new HealthcheckAccountData(); foreach (HealthcheckData data in Report) { total.Add(data.ComputerAccountData); Add(@" <tr> <td class='text'>" + PrintDomain(data.Domain) + @"</td> <td class='num'>" + data.ComputerAccountData.Number + @"</td> <td class='num'>" + data.ComputerAccountData.NumberEnabled + @"</td> <td class='num'>" + data.ComputerAccountData.NumberDisabled + @"</td> <td class='num'>" + data.ComputerAccountData.NumberActive + @"</td> <td class='num'>" + data.ComputerAccountData.NumberInactive + @"</td> <td class='num'>" + data.ComputerAccountData.NumberSidHistory + @"</td> <td class='num'>" + data.ComputerAccountData.NumberBadPrimaryGroup + @"</td> <td class='num'>" + data.ComputerAccountData.NumberTrustedToAuthenticateForDelegation + @"</td> <td class='num'>" + data.ComputerAccountData.NumberReversibleEncryption + @"</td> </tr>" ); } Add(@" </tbody> <tfoot> <tr> <td class='text'><b>Total</b></td> <td class='num'><b>" + total.Number + @"</b></td> <td class='num'><b>" + total.NumberEnabled + @"</b></td> <td class='num'><b>" + total.NumberDisabled + @"</b></td> <td class='num'><b>" + total.NumberActive + @"</b></td> <td class='num'><b>" + total.NumberInactive + @"</b></td> <td class='num'><b>" + total.NumberSidHistory + @"</b></td> <td class='num'><b>" + total.NumberBadPrimaryGroup + @"</b></td> <td class='num'><b>" + total.NumberTrustedToAuthenticateForDelegation + @"</b></td> <td class='num'><b>" + total.NumberReversibleEncryption + @"</b></td> </tr> </tfoot> </table> </div> </div> "); GenerateConsolidatedOperatingSystemList(); }
private void GenerateUserInformation() { Add(@" <div class=""row""> <div class=""col-md-12 table-responsive""> <table class=""table table-striped table-bordered""> <thead><tr> <th>Domain</th> <th>Nb User Accounts</th> <th>Nb Enabled</th> <th>Nb Disabled</th> <th>Nb Active</th> <th>Nb Inactive</th> <th>Nb Locked</th> <th>Nb pwd never Expire</th> <th>Nb SidHistory</th> <th>Nb Bad PrimaryGroup</th> <th>Nb Password not Req.</th> <th>Nb Des enabled.</th> <th>Nb Trusted delegation</th> <th>Nb Reversible password</th> </tr> </thead> <tbody> "); HealthcheckAccountData total = new HealthcheckAccountData(); foreach (HealthcheckData data in Report) { total.Add(data.UserAccountData); Add(@" <tr> <td class='text'>" + PrintDomain(data.Domain) + @"</td> <td class='num'>" + data.UserAccountData.Number + @"</td> <td class='num'>" + data.UserAccountData.NumberEnabled + @"</td> <td class='num'>" + data.UserAccountData.NumberDisabled + @"</td> <td class='num'>" + data.UserAccountData.NumberActive + @"</td> <td class='num'>" + data.UserAccountData.NumberInactive + @"</td> <td class='num'>" + data.UserAccountData.NumberLocked + @"</td> <td class='num'>" + data.UserAccountData.NumberPwdNeverExpires + @"</td> <td class='num'>" + data.UserAccountData.NumberSidHistory + @"</td> <td class='num'>" + data.UserAccountData.NumberBadPrimaryGroup + @"</td> <td class='num'>" + data.UserAccountData.NumberPwdNotRequired + @"</td> <td class='num'>" + data.UserAccountData.NumberDesEnabled + @"</td> <td class='num'>" + data.UserAccountData.NumberTrustedToAuthenticateForDelegation + @"</td> <td class='num'>" + data.UserAccountData.NumberReversibleEncryption + @"</td> </tr>" ); } Add(@" </tbody> <tfoot> <tr> <td class='text'><b>Total</b></td> <td class='num'><b>" + total.Number + @"</b></td> <td class='num'><b>" + total.NumberEnabled + @"</b></td> <td class='num'><b>" + total.NumberDisabled + @"</b></td> <td class='num'><b>" + total.NumberActive + @"</b></td> <td class='num'><b>" + total.NumberInactive + @"</b></td> <td class='num'><b>" + total.NumberLocked + @"</b></td> <td class='num'><b>" + total.NumberPwdNeverExpires + @"</b></td> <td class='num'><b>" + total.NumberSidHistory + @"</b></td> <td class='num'><b>" + total.NumberBadPrimaryGroup + @"</b></td> <td class='num'><b>" + total.NumberPwdNotRequired + @"</b></td> <td class='num'><b>" + total.NumberDesEnabled + @"</b></td> <td class='num'><b>" + total.NumberTrustedToAuthenticateForDelegation + @"</b></td> <td class='num'><b>" + total.NumberReversibleEncryption + @"</b></td> </tr> </tfoot> </table> </div> </div> "); }