Skip to content

Instantly share code, notes, and snippets.

View aaronparker's full-sized avatar

Aaron Parker aaronparker

View GitHub Profile
Verifying that +aaronparker is my blockchain ID. https://onename.com/aaronparker
$Cred = Get-Credential
$session = New-CsOnlineSession -Credential $cred -Verbose -OverrideAdminDomain home.stealthpuppy.com
Import-PSSession $Session
Set-CsOAuthConfiguration -ClientAdalAuthOverride Allowed
@aaronparker
aaronparker / IvantiApplicationControlMessageBox.css
Last active May 17, 2018 02:55
Ivanti Application Control Message Box styling
body{
font-family:'Segoe UI','Regular';
background-color:#E6E6E6;
color:#000;
font-size:11pt;
margin:0px;
padding:0px;
overflow:hidden;
}
.header,.description,.confirm-btn{
@aaronparker
aaronparker / Switch-EmsLicenses.ps1
Created December 1, 2018 12:32
Find users registered in Intune with EMS E3 and replace with EMS E5 licenses
# Connect to Office 365
Connect-MsolService
# Get specific user accounts
Get-MsolUser -UserPrincipalName "bill.murray@stealthpuppy.com"
# Get license SKUs
Get-MsolAccountSku
# EMS licenses
@aaronparker
aaronparker / Disable-AzureADUserPasswordExpiration.ps1
Last active February 9, 2019 10:45
Disable password expiration for an individual Azure AD account
# Install the Azure AD module and log into Azure AD
Install-Module AzureADPreview
Connect-AzureAD
# Get details of the specific account
$user = Get-AzureADUser -SearchString "user@domain.com"
# View password policy on the acccount
$user | Select-Object @{N = "PasswordNeverExpires"; E = {$_.PasswordPolicies -contains "DisablePasswordExpiration"}}
@aaronparker
aaronparker / Get-AzureBlobItems.ps1
Last active May 13, 2019 00:59
Get-AzureBlobItems function to return an array from a list of files in an Azure blob storage container.
Function Get-AzureBlobItems {
<#
.SYNOPSIS
Returns an array of items and properties from an Azure blog storage URL.
.DESCRIPTION
Queries an Azure blog storage URL and returns an array with properties of files in a Container.
Requires Public access level of anonymous read access to the blob storage container.
Works with PowerShell Core.
@aaronparker
aaronparker / Get-DigitalSignatures.ps1
Last active August 21, 2019 06:27
Get digital signatures from files in a target folder.
<#
.SYNOPSIS
Get digital signatures from files in a target folder.
.DESCRIPTION
Gets digital signatures from .exe and .dll files from a specified path and sub-folders.
Retreives the certificate thumbprint, certificate name, certificate expiry, certificate validity and file path and outputs the results.
Output includes files that are not signed.
.NOTES
@aaronparker
aaronparker / New-SecureSharedFolder.cmd
Created July 26, 2017 10:27
Create Secure Shared Folders
@ECHO OFF
REM Creating secure shared folders
REM Sample articles:
REM https://support.microsoft.com/en-us/help/274443/how-to-dynamically-create-security-enhanced-redirected-folders-by-using-folder-redirection-in-windows-2000-and-in-windows-server-2003
REM https://technet.microsoft.com/en-us/library/jj649078(v=ws.11).aspx
REM Create and share folders with permissions for FSLogix Profile Containers or Office 365 Containers
md e:\FSLogixContainers
net share FSLogixContainers=e:\FSLogixContainers /GRANT:Users,CHANGE /GRANT:Administrators,FULL /CACHE:None /REMARK:"FSLogix Containers"
icacls e:\FSLogixContainers /inheritance:d
$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic -AllowRedirection
Import-PSSession $Session
Set-OrganizationConfig -OAuth2ClientProfileEnabled $true
@aaronparker
aaronparker / Expand-GzipArchive.ps1
Last active April 10, 2021 13:36
Expand a Gzip file with PowerShell
Function Expand-GzipArchive {
[CmdletBinding(SupportsShouldProcess = $False)]
param (
[Parameter(Mandatory = $True, Position = 0)]
[ValidateNotNullOrEmpty()]
[ValidateScript( { If (Test-Path -Path $_ -PathType "Leaf") { $True } Else { Throw "Cannot find path $_." } })]
[System.String] $Path,
[Parameter(Mandatory = $False, Position = 1)]
[ValidateNotNullOrEmpty()]