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
if (!(Get-Module -Name MSAL.PS -ListAvailable -ErrorAction SilentlyContinue)) { | |
Install-Module -Name MSAL.PS -Scope CurrentUser -Force | |
} | |
$clientId = "d1ddf0e4-d672-4dae-b554-9d5bdfd93547" # well known Intune application Id | |
$auth = Get-MsalToken -ClientId $clientId -deviceCode #deviceCode requires interaction and solves MFA challenges | |
$token = @{ Authorization = $auth.CreateAuthorizationHeader() } |
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-TenantIdFromDomain { | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string]$FQDN | |
) | |
try { | |
$uri = "https://login.microsoftonline.com/$($FQDN)/.well-known/openid-configuration" | |
$rest = Invoke-RestMethod -Method Get -UseBasicParsing -Uri $uri | |
if ($rest.authorization_endpoint) { | |
$result = $(($rest.authorization_endpoint | Select-String '\w{8}-\w{4}-\w{4}-\w{4}-\w{12}').Matches.Value) |
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 | |
Logon script for the EUC Environment. | |
.DESCRIPTION | |
Configures the following things: | |
- Map Network Drives if the UNC path is connectable (must be onPrem) | |
.NOTES | |
Author: Ben Reader | |
Company: |
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
try { | |
Write-Host "downloading installer.." | |
$chromeUri = "https://dl.google.com/chrome/install/latest/chrome_installer.exe" | |
$bitsJob = Start-BitsTransfer -Source $chromeUri -Destination "$env:Temp\$(split-path $chromeUri -leaf)" | |
if (Test-Path -Path "$env:Tempchrome_installer.exe") { | |
Write-Host "Installer downloaded successfully..`nInstalling application" | |
$proc = Start-Process -FilePath "$env:Tempchrome_installer.exe" -ArgumentList "/silent /install" -Wait | |
$fileDetectPath = "${env:ProgramFiles(x86)}\Google\Chrome\Application\Chrome.exe" | |
Write-Host "Looking for installation files: $fileDetectPath.." | |
if (Test-Path -Path "$fileDetectPath") { |
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 Connect-iDrac { | |
[CmdletBinding()] | |
param ( | |
[IPAddress]$dracHost, | |
$dracUser | |
) | |
try { | |
$cred = Get-Credential -UserName $dracUser -Message "Please enter iDrac credentials.." -Title "Connect-iDrac" | |
$jrePath = "C:\bin\jre1.7.0_80" #set to your jre binaries root folder. | |
$kvmJar = "$jrePath\avctKVM.jar" |
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
{"lastUpload":"2020-09-23T13:04:03.524Z","extensionVersion":"v3.4.3"} |
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 ConvertFrom-Base64EncodedString { | |
[cmdletbinding()] | |
param ( | |
[string]$encodedString | |
) | |
try { | |
$decodedOutput = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($encodedString)) | |
return $decodedOutput | |
} | |
catch { |
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
// Place this at the bottom of the "schemes" array in your profiles.json for the win. | |
{ | |
"background": "#2d2a2e", | |
"black": "#2d2a2e", | |
"blue": "#FC9867", | |
"brightBlack": "#727072", | |
"brightBlue": "#FC9867", | |
"brightCyan": "#78DCE8", | |
"brightGreen": "#a9dc76", | |
"brightPurple": "#AB9DF2", |
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
$script:tick = [char]0x221a | |
$hashPath = "$env:SystemDrive\hwhash.csv" | |
function Install-PreReq { | |
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string[]]$reqs, | |
[Parameter(Mandatory = $false)] | |
[ValidateSet('Module', 'Script')] |
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
A few handy detection functions that I use every day |
OlderNewer