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 Get-WindowsFirewallLog { | |
| <# | |
| .SYNOPSIS | |
| Retrieves entries from the Windows Firewall log based on specified criteria. | |
| .DESCRIPTION | |
| This function reads the Windows Firewall log file and filters entries based on the provided string. | |
| .PARAMETER Action | |
| The firewall action to filter by. Valid values are 'Drop', 'Allow', or 'All'. | |
| .PARAMETER Direction | |
| The traffic direction to filter by. Valid values are 'Inbound', 'Outbound', or 'All'. |
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 Get-ExchangeLogFileRequired { | |
| <# | |
| .SYNOPSIS | |
| Checks if log files are required for database recovery/backups for a specified Exchange mailbox database. | |
| .DESCRIPTION | |
| This function uses the eseutil command to check the header of the specified Exchange mailbox database file | |
| to determine if any log files are required for database recovery or backups. | |
| .PARAMETER DBName | |
| The name of the Exchange mailbox database to check. | |
| .EXAMPLE |
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 Get-ADUserAndGroupADSIsearcher { | |
| <# | |
| .SYNOPSIS | |
| Retrieves Active Directory user and group information using ADSISearcher. | |
| .DESCRIPTION | |
| This function searches for a user in Active Directory and retrieves their group memberships. | |
| .EXAMPLE | |
| Get-ADUserAndGroupADSIsearcher -UserName "Tim West" | |
| .EXAMPLE | |
| Get-ADUserAndGroupADSIsearcher -samAccountName "JDoe" | Select-String "SERVER1-RemoteDesktopUsers" |
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 Get-WindowsFirewallRules { | |
| <# | |
| .SYNOPSIS | |
| Retrieves the current Windows Firewall rules based on Local Port, Name, Remote IP. | |
| .DESCRIPTION | |
| This function fetches and displays the current firewall rules configured on the Windows system. | |
| .PARAMETER LocalPort | |
| The local port number to filter the firewall rules. | |
| .PARAMETER Name | |
| The name of the firewall rule to filter. |
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 Set-FirewallLogFile { | |
| <# | |
| .SYNOPSIS | |
| Sets up the Windows Firewall log file with the correct permissions. | |
| .DESCRIPTION | |
| This function creates a Windows Firewall log file at the specified location and sets the appropriate permissions for system services and administrators. | |
| Requires Administrator privileges. System reboot is required for changes to take effect. | |
| Added NetSH commands to configure firewall logging as overkill just in case. | |
| Script works for standard and .old log files after reboot |
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 Set-UserPassword { | |
| <# | |
| .SYNOPSIS | |
| Change your AD password, use SAMAccount Name to change another users password | |
| .DESCRIPTION | |
| Change your AD password, use SAMAccount Name to change another users password | |
| .EXAMPLE | |
| Set-UserPassword | |
| .EXAMPLE | |
| Set-UserPassword -SAMAccountName 'jsmith' |
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 Get-UsersPasswordPolicy { | |
| <# | |
| .SYNOPSIS | |
| Retrieves password policy settings for a user from Active Directory. | |
| .DESCRIPTION | |
| Gets the effective password policy for a user, including fine-grained password policies if applied. | |
| Returns user password status along with policy requirements. | |
| .PARAMETER UserName | |
| The username (SamAccountName) to query. Defaults to the current user. | |
| .EXAMPLE |
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 Invoke-ExchangeDatabaseFailover { | |
| <# | |
| .SYNOPSIS | |
| Initiates a failover of an Exchange mailbox database to another server within its Database Availability Group (DAG). | |
| .DESCRIPTION | |
| This function allows administrators to trigger a failover of a specified Exchange mailbox database to another server | |
| within its Database Availability Group (DAG). Optionally, a target server can be specified for the failover. | |
| .PARAMETER DatabaseName | |
| The name of the Exchange mailbox database to failover. | |
| .PARAMETER TargetServer |
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
| <# | |
| .SYNOPSIS | |
| A collection of functions to retrieve various Windows system information such as DNS servers, gateway, IP addresses, subnet masks, MAC addresses, uptime, disk space, mapped drives, and more. | |
| .DESCRIPTION | |
| This script contains multiple functions that can be used to gather different pieces of information about a Windows | |
| system. Each function is designed to perform a specific task and can be called independently. | |
| .PARAMETER | |
| N/A | |
| .EXAMPLE | |
| Get-DNSServers |
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 Get-VisualCRuntime { | |
| <# | |
| .SYNOPSIS | |
| Get Visual Studio Latest Installed RunTime | |
| .EXAMPLE | |
| Get-VisualCRuntime | |
| #> | |
| [CmdletBinding()] | |
| Param( | |
| [switch]$Latest # See here for latest https://aka.ms/vc14/vc_redist.x64.exe, https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170 |
NewerOlder