Skip to content

Instantly share code, notes, and snippets.

View contactbrenton's full-sized avatar
Found on Linkedin "Brenton Johnson"

Brenton Johnson contactbrenton

Found on Linkedin "Brenton Johnson"
  • Uptake Digital
  • Australia
View GitHub Profile
$Report = @()
$i = 0
$Accounts = (Get-MsolUser -All | ? {$_.StrongAuthenticationMethods -ne $Null} | Sort DisplayName)
ForEach ($Account in $Accounts) {
Write-Host "Processing" $Account.DisplayName
$i++
$Methods = $Account | Select -ExpandProperty StrongAuthenticationMethods
$MFA = $Account | Select -ExpandProperty StrongAuthenticationUserDetails
$State = $Account | Select -ExpandProperty StrongAuthenticationRequirements
$Methods | ForEach { If ($_.IsDefault -eq $True) {$Method = $_.MethodType}}
@contactbrenton
contactbrenton / update-all-modules-ps.ps1
Last active February 1, 2020 11:36
Automatically Updating Modules
Get-InstalledModule | Update-Module
@contactbrenton
contactbrenton / TWINUI.ps1
Created April 1, 2020 11:36
fixes Twinui problem on Windows 10
Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
get-mailbox | Select DisplayName,UserPrincipalName,HasPicture | Export-Csv C:\photostatus.csv -nti
REG DELETE HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /va /f
$ApplicationId = 'YourApplicationID'
$ApplicationSecret = 'YourApplicationSecret' | Convertto-SecureString -AsPlainText -Force
$TenantID = 'YourTenantID'
$ExchangeRefreshToken = 'YourExchangeToken'
$RefreshToken = 'YourRefreshToken'
$UPN = "UPN-Used-To-Generate-Token"
##############################
$credential = New-Object System.Management.Automation.PSCredential($ApplicationId, $ApplicationSecret)
$aadGraphToken = New-PartnerAccessToken -ApplicationId $ApplicationId -Credential $credential -RefreshToken $refreshToken -Scopes 'https://graph.windows.net/.default' -ServicePrincipal -Tenant $tenantID
@contactbrenton
contactbrenton / get-hardwarehash-to-folder.ps1
Last active September 12, 2020 10:21
Used to copy device hardware hash to a folder on the harddisk.
md c:\HWID
Set-Location c:\HWID
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force
Install-Script -Name Get-WindowsAutopilotInfo -Force
$env:Path += ";C:\Program Files\WindowsPowerShell\Scripts"
Get-WindowsAutopilotInfo.ps1 -OutputFile AutopilotHWID.csv
<#
.Description
Clears Teams Cache.
.Source
https://commsverse.blog/2018/09/28/clear-the-microsoft-teams-client-cache/
#>
$challenge = Read-Host "Are you sure you want to delete Teams Cache (Y/N)?"
$challenge = $challenge.ToUpper()
@contactbrenton
contactbrenton / Monitor-Serials.ps1
Last active November 20, 2023 03:13
This script gathers information about connected monitors and allows the user to assign asset tags.
<#
.DESCRIPTION
This script gathers information about connected monitors and allows the user to assign asset tags. This can be used with a USB or network drive.
The script retrieves details of each monitor connected to the system, such as the manufacturer, name, serial number, week of manufacture, and year of manufacture. It prompts the user to input an asset tag number for each monitor. The collected data, including the asset tags, are then appended to a CSV file.
.PARAMETERS
The script uses hardcoded CSV file path which can be adjusted as needed.
.EXAMPLE
.\Monitor-Serials.ps1
<#
.SYNOPSIS
This script configures the PowerShell environment for removing Visual C++ Redistributables.
It installs the NuGet package provider and the VcRedist module, and then removes specific versions of Visual C++ Redistributables.
.DESCRIPTION
The script sets the execution policy to Bypass for the current process, installs NuGet and VcRedist modules, and uninstalls specific versions of Visual C++ Redistributables (2005, 2008, 2010, 2012). It ends by listing all installed Visual C++ Redistributables.
.NOTES
Requires administrative permissions