Auditing Group Policy changes


https://blogs.msdn.microsoft.com/canberrapfe/2012/05/01/auditing-group-policy-changes/

Advertisements

AD user DirectReports


Get-ADUser chadmin -Properties * | Select-Object -ExpandProperty DirectReports

Note : chadmin is user name

Powershell Operator and AD commands


server up time report


$servers = "mccoyb02","foo","mccoyb01","reisrv1"
$path = "c:\ephemeral\uptime.html" 

$header = @"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>System Status Report</title>
<style type="text/css">
<!--
body {
background-color: #E0E0E0;
font-family: sans-serif
}
table, th, td {
background-color: white;
border-collapse:collapse;
border: 1px solid black;
padding: 5px
}
-->
</style>
"@
$body = @"
<h1>Server Status</h1>
<p>The following report was run on $(get-date).</p>
"@

$results = foreach ($server in $servers) 
{ 
    if (Test-Connection $server -Count 1 -ea 0 -Quiet) 
    { 
        $status = "Up" 
    } 
    else 
    { 
        $status = "Down"
    } 
    [PSCustomObject]@{
        ServerName = $server
        Reuslts = $status
    }
} 

$results | ConvertTo-Html -head $header -body $body | foreach {
    $PSItem -replace "<td>Down</td>", "<td style='background-color:#FF8080'>Down</td>"
} | Out-File C:\Ephemeral\uptime.html
& .\uptime.html


sample report:


Links-3


https://resources.oreilly.com/examples/9780596520601/

https://resources.oreilly.com/examples/9780596520601/commit/745939d00ce806e31ea8fd1ec23c42f028fdad9e

How to Find Unused Organizational Units in Active Directory

https://blogs.technet.microsoft.com/chadcox/2018/03/13/ad-powershell-tip-how-to-find-unused-organizational-units-in-active-directory/

Active Directory Domain Deployment Checklist

https://social.technet.microsoft.com/wiki/contents/articles/40225.active-directory-domain-deployment-checklist.aspx

https://blogs.technet.microsoft.com/askds/2011/04/29/sites-sites-everywhere/

Configuring Audit Polices for Active Directory

https://www.manageengine.com/products/active-directory-audit/help/getting-started/manual-configuration-dc-auditing.html

Top 25 Active Directory Security Best Practices

https://activedirectorypro.com/active-directory-security-best-practices/

PowerShell Basics: How to Check Active Directory Replication Status:

https://techcommunity.microsoft.com/t5/ITOps-Talk-Blog/PowerShell-Basics-How-to-Check-Active-Directory-Replication/ba-p/326364

Change Account Lockout & Password Complexity Policy

https://www.top-password.com/blog/change-account-lockout-password-complexity-policy-in-windows/

Memory Dump configuration:

https://support.microsoft.com/en-in/help/950858/dedicated-dump-files-are-unexpectedly-truncated-to-4-gb-on-a-computer

A Step-By-Step Guide to Restore Deleted Objects in Active Directory

https://www.lepide.com/how-to/restore-deleted-objects-in-active-directory.html

Recovering a Deleted Cluster Name Object (CNO)

https://blogs.technet.microsoft.com/askcore/2009/04/27/recovering-a-deleted-cluster-name-object-cno-in-a-windows-server-2008-failover-cluster/

WINDOWS TIME SERVICE CONCEPTS AND CONFIGURATION

https://vmexpo.wordpress.com/2015/09/13/windows-time-service-concepts-and-configuration/

Services status report


#========================================================================
# Check the services Information status
# Version 1.0 19-03-2019
# Created by: Test
#========================================================================
$date=Get-Date
$Header = @”
<style>

TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}
TH{border-width: 1px;padding: 3px;border-style: solid;border-color: black;}
TD{border-width: 1px;padding: 3px;border-style: solid;border-color: black;}

table
{
font-family:”Trebuchet MS”, Arial, Helvetica, sans-serif;
border-collapse:collapse;
}
td
{
font-size:1em;
border:1px solid #98bf21;
padding:5px 5px 5px 5px;
}
th
{
font-size:1.1em;
text-align:center;
padding-top:5px;
padding-bottom:5px;
padding-right:7px;
padding-left:7px;
background-color:#A7C942;
color:#ffffff;
}
name tr
{
color:#F00000;
background-color:#EAF2D3;
}

</style>
<h1>Services status</span></h1><br>

<h1>This report is generated on $date </span></h1><br>
“@

$GService = Get-WmiObject win32_service | select name,DisplayName,state,startname,startmode | ConvertTo-HTML -AS Table -Fragment | Out-String

# To change the services status color

$StatusColor = @{Stopped = ‘ bgcolor=”RED”>Stopped<‘;Running = ‘ bgcolor=”Green”>Running<‘;}
$StatusColor.Keys | foreach { $GService = $GService -replace “>$_<“,($StatusColor.$_) }

#Save the HTML Web Page
ConvertTo-HTML -head $Header -PostContent $GService|Out-File c:\temp\TableHTML.html

#Open TableHTML.html

Invoke-Item c:\temp\TableHTML.html

VMware Blog

%d bloggers like this: