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
| # 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 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
| # 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. | |
| *** This script assumes you have an AWS Profile setup in your PowerShell. This link explains how to set it up. https://www.virtualtothecore.com/using-aws-credentials-in-powershell-scripts/ | |
| Written: Ed Walsh | |
| PowerShell.Core tested: Tested | |
| Version: 1.3.0 | |
| Create Date : 5/1/2023 | |
| Revised Date: 8/14/2024 |
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
| # 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 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
| #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 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
| # 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 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
| # 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 | |
| #> |
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
| #running_server_list_from_ssm.ps1 | |
| #Use to pull a list of running servers (Windows and/or Linux depending on what you select in $Filters) removing any that are not in AD and are associated to WORKGROUP. | |
| #3/29/2023 | |
| Import-Module -name AWSPowershell | |
| $Servers = @() | |
| # Get the Running EC2 Instances managed by SSM | |
| $Filters = @(@{ Key = 'PingStatus'; values = 'Online' }; @{ key = "PlatformTypes"; values = ("Linux", "Windows") }; @{ Key = "ResourceType"; values = "EC2Instance" }) |
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
| # AWS_SecurityGroups_to_EC2_List.ps1 | |
| <# | |
| Description: Pulls a list of AWS Security Groups and the EC2's they are assigned to. Exports to Excel, with two Pivot Tables. | |
| Written: Ed Walsh | |
| PowerShell.Core tested: Not Tested | |
| MS-Graph: No | |
| Version: 1.0.0 | |
| Create Date: 2/21/2023 | |
| Revised Date: 2/21/2023 | |
| #> |
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
| ## EC2-Inventory_with-Details.ps1 | |
| ## Get EC2 Instance List (Inventory) with Details Output to CSV file and Gridview. CSV file in User Documents Profile Folder. | |
| ## Written: Ed Walsh | |
| ## Date: 11/1/2018 | |
| ## PowerShell Version Compatible: PS v5.1, or Comment out Gridview Line for PS v6+ | |
| ## Version: 1.2.0 | |
| ## Revision Date: 10/4/2019 Added Dedicated Tenant check and column. | |
| ## Revision Date: 06/30/2020 Added Description column. | |
| ## Revision Date: 12/16/2021 Made this run accross all AWS Regions | |