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-DhcpScopeSettings { | |
<# | |
.SYNOPSIS | |
Modifies DHCP scope settings including lease duration, DNS settings, and DNS domain for specified scopes. | |
.DESCRIPTION | |
This function allows bulk modification of DHCP scope settings on a specified DHCP server. | |
It can modify: | |
- Lease duration |
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-AzureRoleAssignments { | |
<# | |
.SYNOPSIS | |
Retrieves Azure Role Assignments for specified scopes. | |
.DESCRIPTION | |
The Get-AzureRoleAssignments function retrieves Azure Role Assignments for either a specific subscription, a management group, or all accessible subscriptions. It can optionally include group members for assignments made to groups. | |
.PARAMETER SubscriptionId | |
Specifies the ID of the subscription to retrieve role assignments from. If not specified, and ManagementGroupId is also not specified, the function will retrieve role assignments from all accessible subscriptions. |
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-NordloSChannelLoggingEvents { | |
<# | |
.SYNOPSIS | |
Extracts Schannel logging events from the Windows Event Log. | |
.DESCRIPTION | |
This function retrieves Schannel logging events from either the System or ForwardedEvents log. | |
It can filter events based on a specified time period and output the results to a CSV file. | |
.PARAMETER Period |
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 Test-PortReachable { | |
<# | |
.SYNOPSIS | |
Tests if different tcp ports are reachable, a few builtin scenarios are included | |
.DESCRIPTION | |
This tool checks if one or more ports are reachable on one or more hosts. It can also check if RPC is open and it will display | |
which RPC Service is available on that port. | |
.EXAMPLE | |
Test-PortReachable -Scenario WebServer -Target "www.gp.se", "www.svt.se", "www.boras.se", "www.aftonbladet.se", "www.existerarinte.se" | |
Connects to the ports included in the scenario "WebServer" and displays the results. |
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
#Credit: https://gist.github.com/ethzero/47f657ca635752b5bdb45f99eae40182 | |
function Send-Base64EncodedfileThroughClipboard { | |
[CmdletBinding()] | |
param ( | |
# Path to file to encode | |
[Parameter(Mandatory = $true, | |
Position = 0, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true, |
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-InstalledSoftware { | |
[CmdletBinding()] | |
param ( | |
) | |
$InstalledSoftware = Get-ChildItem "HKLM:\software\WOW6432Node\Microsoft\windows\CurrentVersion\Uninstall" | ForEach-Object { Get-ItemProperty $_.PSPath } | |
$InstalledSoftware += Get-ChildItem "HKLM:\software\Microsoft\windows\CurrentVersion\Uninstall" | ForEach-Object { Get-ItemProperty $_.PSPath } | |
foreach ($Software in $InstalledSoftware) { |
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 GetFileAccessEvents { | |
$events = Get-WinEvent -FilterHashtable @{ | |
LogName = 'ForwardedEvents' | |
Id = 4663 | |
StartTime = (Get-Date).AddHours(-24) | |
} | |
$AccessTypes = @{ | |
[int]4416 = 'ReadData_ListDirectory' | |
[int]4417 = 'WriteData_AddFile' |
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 GetFolderPermissionInfo { | |
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
[string] | |
$Path = $(get-location).ProviderPath, | |
[switch] | |
$ExportCsv, | |
[string] | |
$CSVPath="ACLReport-$(get-date -Format "yyyy-MM-dd_HHmm").csv", |
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
#Källa https://www.bvanleeuwen.nl/faq/?p=1182 | |
#Modifierat för att ta med info om failover status på scope-nivå | |
import-module DHCPServer | |
#Get all Authorized DCs from AD configuration | |
$DHCPs = Get-DhcpServerInDC | Where-Object {$_.DnsName -eq 'sa2netsrv01.prod.pk.local'} | |
$filename = "c:\nordlo\DHCPScopes_DNS_$(get-date -Uformat "%Y%m%d-%H%M%S").csv" | |
$Report = @() |
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
#WIP in progress as of 2022-01-12 | |
function Start-ExchangeMaintenance { | |
[CmdletBinding()] | |
param | |
( | |
[parameter(Mandatory = $true)] | |
[validateNotNullOrEmpty()] | |
[String]$MaintenanceServer, |
NewerOlder