Skip to content

Instantly share code, notes, and snippets.

Dave Green davegreen

Block or report user

Report or block davegreen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davegreen
davegreen / OSDComputerName.ps1
Last active Apr 12, 2019
Altered script from http://www.scconfigmgr.com/2013/10/02/prompt-for-computer-name-during-osd-with-powershell/ to improve computer name validation - Originally by Nickolaj
View OSDComputerName.ps1
Function Load-Form
{
$Form.Controls.Add($TBComputerName)
$Form.Controls.Add($GBComputerName)
$Form.Controls.Add($ButtonOK)
$Form.Add_Shown({$Form.Activate()})
[void] $Form.ShowDialog()
}
Function Set-OSDComputerName
@davegreen
davegreen / Connect-Services.ps1
Last active Apr 12, 2018
Functions for connecting to and importing PowerShell sessions for Lync, Exchange (online and on-premise).
View Connect-Services.ps1
Function Test-MsolConnection {
<#
.Synopsis
A function that tests the Microsoft Online connection.
.Example
Test-MsolConnection
Tests to see if the Microsoft Online connection is available.
@davegreen
davegreen / Connect-ExchangeOnline.ps1
Last active Apr 12, 2018
Function for connecting to an Exchange Online session. Useful in a PowerShell profile script.
View Connect-ExchangeOnline.ps1
function Connect-ExchangeOnline {
<#
.Synopsis
A function that connects to the Exchange online system.
.Parameter Credential
A credential object with rights to connect to the Exchange server. This parameter is mandatory.
.Parameter AllowClobber
Boolean value of whether the imported session will clobber existing commands. Defaults to True.
View TestMsolConnection.ps1
Function TestMsolConnection {
<#
.Synopsis
A function that tests the Microsoft Online connection.
.Description
A function that tests the Microsoft Online connection.
.Example
TestMsolConnection
View MsolArgumentCompleters.ps1
Register-ArgumentCompleter -CommandName Set-MsolUser -ParameterName UsageLocation -ScriptBlock {
Param(
$commandName, #The command calling this argument completer.
$parameterName, #The parameter currently active for the argument completer.
$currentContent, #The current data in the prompt for the parameter specified above.
$commandAst, #The full AST for the current command.
$fakeBoundParameters #A hashtable of the current parameters on the prompt.
)
$UsageLocations = @{
View Load-USMTCurrentUser.ps1
# Requires -RunAsAdministrator
[CmdletBinding(
SupportsShouldProcess = $True,
ConfirmImpact = 'High'
)]
Param(
[parameter(
Mandatory = $true
)]
[ValidateScript({
@davegreen
davegreen / UpdateBIOS.cmd
Created Sep 8, 2016
For use with HP machines for deploying updated UEFI firmware using HPqflash.
View UpdateBIOS.cmd
PUSHD %~dp0
SET _upd=hpqFlash.exe
SET bios=%1
IF /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" (
SET _upd=hpqFlash64.exe
)
"%_upd%" -pBIOSPW.bin -f%bios% -s
@davegreen
davegreen / UpdateUEFI.cmd
Created Sep 8, 2016
For use with HP machines for deploying updated UEFI firmware.
View UpdateUEFI.cmd
PUSHD %~dp0
SET _upd=HPBIOSUPDREC.exe
SET bios=%1
IF /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" (
SET _upd=HPBIOSUPDREC64.exe
)
"%_upd%" -pBIOSPW.bin -f%bios% -s -r
@davegreen
davegreen / ConfigureUEFI.cmd
Last active Sep 8, 2016
For use with HP machines for deploying UEFI/BIOS configurations.
View ConfigureUEFI.cmd
PUSHD %~dp0
SET _bcu=BiosConfigUtility.exe
SET config=%1
IF /I "%PROCESSOR_ARCHITECTURE%" EQU "AMD64" (
SET _bcu=BiosConfigUtility64.exe
)
"%_bcu%" /nspwdfile:"%~dp0BIOSPW.bin" /set:"%~dp0%config%" /l
View Get-UnmatchedDhcpServerv4Reservation.ps1
#Requires -Module DHCPServer
Function Get-UnmatchedDhcpServerv4Reservation {
<#
.Synopsis
A function gets DHCP IPv4 reservations from a single scope stretched over two DHCP servers.
.Description
A function gets DHCP IPv4 reservations from a single scope stretched over two DHCP servers
You can’t perform that action at this time.