View CheckProfileStoragePermissions.ps1
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
<# | |
.SYNOPSIS | |
I used this to find inconsistent file/folder ACL for FSLogix Profile Container folders in Azure Files (Azure Storage). It's not perfect but did a good enough job. This script is highly specific for my use-case. Feel free to change it for your needs. | |
.DESCRIPTION | |
This script scans the specified folder for subfolders. It checks if the Owner of the subfolder has exactly "Modify, Synchronize" rights for the folder. It then checks if the subfolder-owner also has these rights for files inside that subfolder. If there is more than one (1) file in the subfolder, it throws a warning but continues. | |
.NOTES |
View Apply-DNS-Workaround-CVE-2020-1350.ps1
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
<# by diecknet | |
# This script is mostly based on code by reddit users /u/bernys and /u/Lanathell | |
# I added checks to see if DNS service is running again. | |
# Also see: | |
# - https://support.microsoft.com/en-us/help/4569509/windows-dns-server-remote-code-execution-vulnerability | |
# - https://www.reddit.com/r/sysadmin/comments/hr5dfe/keep_your_eyes_out_for_a_critical/ | |
#> | |
Import-Module ActiveDirectory | |
$AllDomainControllers = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ } |
View Copy2Clipboard.ps1
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
<# | |
I initially used this code: | |
history | Select-Object -Last 1 -ExpandProperty CommandLine | clip | |
But recently found this shorter version at https://powershellmagazine.com/post/2012-11-06-pstip-send-the-last-command-executed-to-clipboard/ | |
#> | |
(Get-History)[-1].commandline | clip |
View ActiveDirectory-Snippets.ps1
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 DNS Host A entry with PowerShell | |
# Forward / Host A | |
Add-DnsServerResourceRecordA -Name "test123" -ZoneName "myzone.local" -IPv4Address "10.0.0.1" -ComputerName mydnsserver | |
# Add PTR: | |
Add-DnsServerResourceRecordPtr -ZoneName 00.10.in-addr.arpa -Name 1.0 -PtrDomainName myhost.myzone.local -ComputerName mydnsserver | |
######################################################################################## |
View Convert-SPOTimezoneToString.ps1
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 Convert-SPOTimezoneToString( | |
# ID of a SPO Timezone | |
[int]$ID | |
) { | |
<# | |
.SYNOPSIS | |
Convert a Sharepoint Online Time zone ID to a human readable string. | |
.NOTES | |
By Andreas Dieckmann - https://diecknet.de |
View Hashtable-Access-Performance-Test.ps1
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
<# | |
Hashtable Access Performance Test | |
Settings: | |
$maxentries = Number of entries to put into the hashtable | |
$iterations = Number of access test per method | |
#> | |
$maxentries = 100000 | |
$iterations = 5000 | |
$meineHashtable = @{} |