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
$API = New-Object -ComObject "MOM.ScriptAPI" -ErrorAction Stop | |
$PropertyBag = $API.CreatePropertyBag() | |
$Profiles = @{'Admin' = 0; 'User' = 0} | |
$Profiles.Admin = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}' -Name IsInstalled).IsInstalled | |
$Profiles.User = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}' -Name IsInstalled).IsInstalled | |
if ($Profiles.Values -contains 0) | |
{ | |
$PropertyBag.AddValue('State', 1) |
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 Build-CustomWIMImage | |
{ | |
[CmdletBinding(SupportsShouldProcess)] | |
Param( | |
[parameter(Mandatory=$true, Position=1)][ValidateScript({ Test-Path $_ })][string]$ImagePath, | |
[parameter()][ValidateScript({ Test-Path $_ })][string]$UpdatesPath, | |
[parameter()][ValidateNotNullOrEmpty()][string[]]$RemoveAppxPackages = { | |
'Microsoft.3DBuilder', | |
'Microsoft.BingFinance', | |
'Microsoft.BingNews', |
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-ComputerADSite() | |
{ | |
<# | |
.Synopsis | |
Get the computers current AD site from the computer Netlogon information. | |
.Example | |
Get-ComputerADSite | |
.Notes |
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
#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 |
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
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 |
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
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 |
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
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 |
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
# Requires -RunAsAdministrator | |
[CmdletBinding( | |
SupportsShouldProcess = $True, | |
ConfirmImpact = 'High' | |
)] | |
Param( | |
[parameter( | |
Mandatory = $true | |
)] | |
[ValidateScript({ |
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
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 = @{ |
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 TestMsolConnection { | |
<# | |
.Synopsis | |
A function that tests the Microsoft Online connection. | |
.Description | |
A function that tests the Microsoft Online connection. | |
.Example | |
TestMsolConnection |