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
# Hunt for the owner of the mailbox: | |
Get-MailboxFolderStatistics "[email protected]" | ft Name, Identity, folderpath, foldertype > folderstats.txt | |
# Using the name of the mailbox owner, get the CalendarSharingOwnerSmtpAddress and SharingOwnerRemoteFolderId properties: | |
Get-MailboxFolderStatistics -Identity "theuser" | ForEach-Object { | |
If ($_.FolderPath -match "/Calendar/Advisory Team Calendar"){ # Example calendar, needs to be changed |
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
import os | |
import pathlib | |
collection = os.getcwd() | |
#print(collection) | |
for i, filename in enumerate(os.listdir(collection)): | |
file_extension = pathlib.Path(filename).suffix | |
#print("File Extension: ", file_extension) | |
if(file_extension == ".png"): | |
os.rename(collection +"\\"+ filename, collection +"\\"+ str(i).zfill(4) + ".png") |
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 choco .exe and add choco to PATH | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" | |
:::: Browsers | |
:: choco install brave -fy | |
:: choco install googlechrome -fy | |
:: choco install firefox -fy | |
:::: Text editors / IDEs | |
:: choco install atom -fy |
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
Connect-IPPSSession -UserPrincipalName [email protected] | |
New-ComplianceSearchAction -SearchName "name of the content search" -Purge -PurgeType SoftDelete | |
Get-ComplianceSearchAction -Identity "name of the compliance action" |
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 Get-Temperature { | |
$t = Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | |
$returntemp = @() | |
foreach ($temp in $t.CurrentTemperature) | |
{ | |
$currentTempKelvin = $temp / 10 | |
$currentTempCelsius = $currentTempKelvin - 273.15 | |
$currentTempFahrenheit = (9/5) * $currentTempCelsius + 32 | |
$returntemp += $currentTempCelsius.ToString() + " C : " + $currentTempFahrenheit.ToString() + " F : " + $currentTempKelvin + " K" | |
} |
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
# Get the ID and security principal of the current user account | |
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID) | |
# Get the security principal for the Administrator role | |
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator | |
# Check to see if we are currently running "as Administrator" | |
if ($myWindowsPrincipal.IsInRole($adminRole)) | |
{ |
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
$Folder = "S:\path\to\folder" | |
$User = "Jane Doe" | |
$userPermissions = @() | |
$userPermissions += (Get-ADPrincipalGroupMembership $User).name | |
$folderPermissions = @() | |
$folderPermissions += (((Get-Acl $Folder).Access).IdentityReference).Value | |
$match = 0 |
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
import java.util.Collections; | |
import java.util.Comparator; | |
final int N_NODES = 128; | |
int nodeCount = 0; | |
ArrayList<Node> nodes = new ArrayList(); | |
ArrayList<Edge> edges = new ArrayList(); | |
ArrayList<Edge> mst = new ArrayList(); | |
void setup() { |
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
# Tristan Madden | |
# 2022-04-11 | |
# trimad.github.io | |
$cmd= @(netsh wlan show profile) | |
$profiles = @() | |
foreach ($line in $cmd) | |
{ | |
$skip = 27 | |
if($line -Match "All User Profile") |
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
float x = 0; | |
float y = 0; | |
float[][] magicX = { | |
{0.00, 0.00}, | |
{0.85, 0.04}, | |
{0.20, -0.26}, | |
{-0.15, 0.28} | |
}; |
NewerOlder