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
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
<# | |
.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
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
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() } |
NewerOlder