This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function New-TabbedHTML { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory=$true)][ValidateScript({ | |
($_ | Get-Member | Where-Object {$_.membertype -eq "NoteProperty"}).count -eq 2 -AND | |
($_ | Get-member | Where-Object {$_.membertype -eq "Noteproperty"}).Name -contains "Content" -AND | |
($_ | Get-member | Where-Object {$_.membertype -eq "Noteproperty"}).Name -contains "Title" | |
})][array]$inputArray, | |
[Parameter(ValueFromPipeline = $true, mandatory = $false)][ValidateSet('horizontal', 'vertical')][String]$Alignment = "vertical", | |
[Parameter(Mandatory=$true)][string]$title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Author : Nitish Kumar ([email protected]) | |
Performs Entra ID Assessment | |
version 1.0 | 17/07/2024 Initial version | |
version 1.1 | 19/07/2024 Error handling improvements | |
version 1.2 | 28/07/2024 Application details performance improvements | |
Disclaimer: This script is designed to only read data from the entra id and should not cause any problems or change configurations but author do not claim to be responsible for any issues. Do due dilligence before running in the production environment | |
#> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Author : Nitish Kumar ([email protected]) | |
Performs Entra ID Assessment | |
version 1.0 | 17/07/2024 Initial version | |
version 1.2 | 28/07/2024 Application details performance improvements | |
Disclaimer: This script is designed to only read data from the entra id and should not cause any problems or change configurations but author do not claim to be responsible for any issues. Do due dilligence before running in the production environment | |
#> | |
Import-module Microsoft.Graph.Authentication |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module Microsoft.Graph.Users | |
$Scopes = @( | |
"User.Read.All", | |
"Directory.Read.All" , | |
"AuditLog.Read.All" | |
) | |
Connect-MgGraph -Scopes $Scopes | |
$Users = get-mguser -all -Property UserPrincipalname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get list of all domain controllers | |
$Dcs = Get-ADDomainController -filter * | |
#Target last 7 days logs | |
$StartDate = (Get-Date).AddDays(-7) | |
# Can change event ID here | |
$eventId = 4738 | |
$count = $dcs.count |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 3.0 | |
#Requires -Modules ActiveDirectory, GroupPolicy, DnsServer | |
<# | |
Author : Nitish Kumar | |
Performs Active Directory Forest Assessment | |
version 1.0 | 06/06/2023 Initial version | |
version 1.1 | 15/06/2023 Covered most areas though error proofing and dependency over wsman still remains | |
version 1.2 | 16/06/2023 Number of small fixes included wrong calulations on empty groups | |
version 1.3 | 21/06/2023 PowerShell jobs for AD health checks and Domain Summary details, Also chosing least latency DC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Author : Nitish Kumar | |
AD delegated rights report | |
version 1.0 | 06/09/2023 Initial version | |
Disclaimer: This script is designed for illustration purposes only and the author do not claim to be responsible for any issues if caused by the script in production usages. Do due dilligence before running in the production environment | |
#> | |
# Initialize an empty array to store delegated permissions on OUs | |
$global:delegatedPermissionsOnOUs = @() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Author : Nitish Kumar | |
Produces GPO inventory report | |
version 1.0 | 01/09/2023 Initial version | |
Disclaimer: This script is designed to only read data from the domain and should not cause any problems or change configurations but author do not claim to be responsible for any issues. Do due dilligence before running in the production environment | |
#> | |
Import-Module ActiveDirectory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Start-SecurityCheck { | |
[CmdletBinding()] | |
Param( | |
[Parameter(ValueFromPipeline = $true, mandatory = $true)]$DomainName, | |
[Parameter(ValueFromPipeline = $true, mandatory = $true)][pscredential]$Credential | |
) | |
$SecuritySettings = @() | |
$DCs = (Get-ADDomainController -Filter * -Server $DomainName -Credential $Credential).hostname | |
$PDC = (Test-Connection -Computername (Get-ADDomainController -Filter * -Server $DomainName -Credential $Credential).Hostname -count 1 -AsJob | Get-Job | Receive-Job -Wait | Where-Object { $null -ne $_.Responsetime } | sort-object Responsetime | select-Object Address -first 1).Address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Output formating options | |
$logopath = "https://camo.githubusercontent.com/239d9de795c471d44ad89783ec7dc03a76f5c0d60d00e457c181b6e95c6950b6/68747470733a2f2f6e69746973686b756d61722e66696c65732e776f726470726573732e636f6d2f323032322f31302f63726f707065642d696d675f32303232303732335f3039343534372d72656d6f766562672d707265766965772e706e67" | |
$ReportPath = "$env:USERPROFILE\desktop\ADReport_$(get-date -Uformat "%Y%m%d-%H%M%S").html" | |
$CopyRightInfo = " @Copyright Nitish Kumar <a href='https://github.com/laymanstake'>Visit nitishkumar.net</a>" | |
# CSS codes to format the report | |
$header = @" | |
<style> | |
body { background-color: #b9d7f7; } | |
h1 { font-family: Arial, Helvetica, sans-serif; color: #e68a00; font-size: 28px; } |
NewerOlder