This file contains 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
#Install-Module -name DomainHealthChecker # Only needed if you don't already have the Module installed | |
import-module -name DomainHealthChecker | |
$all = @() | |
#You need the DKIM selector to pull the correct DKIM record. | |
$urls_check = @( [pscustomobject]@{'domain'="domain0.com";'dkim_selector'="s6840"}, | |
[pscustomobject]@{'domain'="domain1.com";'dkim_selector'="cast717"} | |
) | |
$runon = Get-date -Format "MM/dd/yyyy HH:mm tt K" | |
foreach ($url in $urls_check) { | |
#There is a bug in Invoke-SpfDkimDmarc, v1.6 where it only uses `dkim` as a selector value, so need to use the Get-DKIMRecord cmdlet so you can use the DKIM Selector. |
This file contains 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
nmap -p 443 --script ssl-cert mrisimmons.com | grep "Subject Alternative Name" |
This file contains 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 Test-ADAuthentication { | |
param( | |
$username, | |
$password) | |
(New-Object DirectoryServices.DirectoryEntry "",$username,$password).psbase.name -ne $null | |
} | |
Test-ADAuthentication -username {Enter User Name} -password {Enter Password} |
This file contains 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
<# Add this to your $Profile | |
To edit, from inside cli or ISE type: notepad $Profile | |
If its not created then create it. | |
The add below and save. | |
Now to update all your Modules you type the function name, upgrade | |
#> | |
This file contains 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
# aws-ec2-snapshot-count-and-aged-out-with-cost.ps1 | |
Import-Module AWSPowerShell.netcore | |
## Powershell.Core safe (PoSh 6+) | |
#Import-Module AWSPowerShell.NetCore | |
## Ed Walsh | |
## Date: 12/9/2020 | |
## Modified: 02/06/2024 | |
<# Get the count of Snapshots for an AWS account across all AWS Regions, along with count over set days old, and what is oldest date of snapshot. | |
calculate the cost per GB for old snapshots | |
$AllSnapshotsForRemoval variable can be fed to a foreach to delete the aged out snapshots |
This file contains 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
# aws-ec2-elb-detail-inventory-with-SecurityGroups-all-aws-regions.ps1 | |
<# | |
Description: Pull all EC2's and all ELB's with details includes the Security Groups each EC2 has accross all AWS Regions. | |
Written: Ed Walsh | |
PowerShell.Core tested: Tested | |
Version: 1.2.0 | |
Create Date : 5/1/2023 | |
Revised Date: 10/13/2023 | |
#> | |
This file contains 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
# AWS-IAM-Users-with-IAMGroups-Memberships.ps1 | |
<# | |
Description: This will show the IAM Users and the IAM Group memberships they are in. | |
For Password_LastUsed, if the account does not have a password, which means no access to AWS Console, or if the password was never used, it outputs "1/1/0001 12:00:00 AM", I capture this and replace with a blank. | |
Written: Ed Walsh | |
PowerShell.Core tested: Not Tested | |
Version: 1.0.0 | |
Create Date: 04/26/2023 | |
Revised Date: 04/26/2023 | |
#> |
This file contains 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
#This is how to change the IIS Site ID using Site ID # or IIS Site Name. | |
Import-Module WebAdministration | |
# Pull all of the IIS Sites into variable $sm, after ; says to display on screen $sm.Sites list | |
$sm = Get-IISServerManager ; $sm.Sites | |
# Change site with Id 5 to Id 7 | |
$site = $sm.Sites | where-object { $_.Id -eq 5 } |
This file contains 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
# This will check what .NET Framework installed on the server. | |
# | |
#From: https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed | |
$release = Get-ItemPropertyValue -LiteralPath 'HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full' -Name Release | |
switch ($release) { | |
{ $_ -ge 533320 } { $version = '4.8.1 or later'; break } | |
{ $_ -ge 528040 } { $version = '4.8'; break } | |
{ $_ -ge 461808 } { $version = '4.7.2'; break } |
This file contains 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
# aws-acm-inventory.ps1 | |
<# | |
Description: Pull an Inventory List from AWS Certificate Manager (ACM) across all AWS regions. Export to a CSV file. | |
Written: Ed Walsh | |
PowerShell.Core tested: Not Tested | |
MS-Graph: No | |
Version: 1.1.0 | |
Create Date: 3/30/2023 | |
Revised Date: 3/30/2023 | |
#> |