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
<# | |
Foxit PhantomPDF Remover/Cleaner | |
V1.5 - DPO - Apr. 2022 | |
#> | |
param ( | |
[switch]$LeaveUUID | |
) | |
Write-Host 'Looking for Foxit PhantomPDF installs...' | |
$foxitPhantom = Get-Package 'Foxit Phan*' -AllVersions -ErrorAction SilentlyContinue |
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
<# | |
Create self-deleting task that reboots the computer at midnight. | |
#> | |
$midnight = (Get-date -Hour 0 -Minute 0 -Second 0).AddDays(1) | |
$taskname = 'Reboot at midnight' | |
$taskdescription = 'Reboots computer at midnight.' | |
if (Get-ScheduledTask -TaskName $taskname -ErrorAction SilentlyContinue) { | |
Unregister-ScheduledTask -TaskName $taskname -Confirm:$false |
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
param ( | |
[string]$CsvPath = (Join-Path $PSScriptRoot 'AllowList.csv'), | |
[string]$MS365User = '[email protected]', | |
[string]$BarracudaQuarantineEmail = '[email protected]', | |
[switch]$IncludeBlockLists | |
) | |
$getSessions = Get-PSSession | Select-Object -Property State, Name | |
$isConnected = [bool](@($getSessions) -like '@{State=Opened; Name=ExchangeOnlineInternalSession*').Count -gt 0 | |
If (!$isConnected) { |
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-ForPort { | |
param ( | |
[Parameter(Mandatory)] | |
[string]$Server, | |
[Parameter(Mandatory)] | |
[int]$Port, | |
[int]$RetryCount = 3, | |
[switch]$Quiet | |
) |
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-ADUserNestedMemberships { | |
param ( | |
[string]$SAMAccountName = $env:USERNAME | |
) | |
$userNestedMembership = @() | |
$domainConnection = New-Object DirectoryServices.DirectoryEntry | |
$domainConnection.AuthenticationType = [System.DirectoryServices.AuthenticationTypes]::Secure |
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
$chromeFolder = Join-Path $env:LOCALAPPDATA '\Google\Chrome' | |
$setupPath = Join-Path $chromeFolder '\Application\*.*\Installer\setup.exe' | |
# Use setup.exe from most recent version folder found. | |
if ((gci $setupPath).Count -gt 1) { | |
$setupPath = gci $setupPath | sort -Descending | |
$setupPath = $setupPath[0] | |
} | |
$argList = '--uninstall --multi-install --chrome --force-uninstall' |
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
Connect-MicrosoftTeams | |
$teams = Get-Team | |
foreach ($team in $teams) { | |
$teamApps = Get-TeamsAppInstallation -TeamId $team.GroupId | |
foreach ($app in $teamApps) { | |
Write-Output ('{0},{1},{2}' -f $team.DisplayName, $app.DisplayName, $app.TeamsAppId) >> c:\temp\TeamApps.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
$users = Get-ADUser -Server $DomainController -Filter * -Properties Name, DirectReports | |
foreach ($user in $users) { | |
$name = $user.Name | |
foreach ($report in $user.DirectReports) { | |
write-output (("$name, $report").Replace("CN=","") -replace ",OU=.*", "") >> c:\temp\ReportsByUser.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
Install-Module -Name AWS.Tools.Installer | |
Install-AWSToolsModule AWS.Tools.S3 -CleanUp | |
$bucket = 'some-s3-bucket' | |
Set-AWSCredential ` | |
-AccessKey '<Get Your Own>' ` | |
-SecretKey '<Get Your Own>' | |
# Gather files to upload |
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 GetPickListChoice { | |
param ( | |
[Parameter(Mandatory=$true)] | |
[string[]]$PickList, | |
[string]$Prompt = 'Type to search, Tab to cycle matches, Backspace to reset, ''?'' for a list: ', | |
[switch]$PromptNoNewLine | |
) | |
function ClearCurrentChoice { | |
for ($i = $origCursorPos.X; $i -lt $endPos; $i++) { |