- Date: 2021-01-04
- Time: 14:18:17
Expand the following summaries for more details:
Environment:
<# | |
.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: |
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" |
function ConvertFrom-Base64EncodedString { | |
[cmdletbinding()] | |
param ( | |
[string]$encodedString | |
) | |
try { | |
$decodedOutput = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($encodedString)) | |
return $decodedOutput | |
} | |
catch { |
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() } |
{"lastUpload":"2020-09-23T13:04:03.524Z","extensionVersion":"v3.4.3"} |
// 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", |
$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')] |
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) |
A few handy detection functions that I use every day |