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 you want to get a list to use in a script | |
# by wrapping in a script block you don't pollute the current namespace | |
$CommonParameters = { | |
function Get-CommonParameters { | |
[CmdletBinding( SupportsShouldProcess=$true )] | |
param() | |
return $MyInvocation.MyCommand.Parameters.Keys | |
} | |
Get-CommonParameters | |
}.Invoke() |
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 | |
Highlights output from a previous command | |
#> | |
[CmdletBinding()] | |
param( | |
[Parameter( Mandatory, ValueFromPipeline )] | |
[string[]] | |
$InputObject, | |
[string[]] |
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 | |
Converts top level Users and Computers containers into OUs allowing you to attach policy | |
.PARAMETER Server | |
Domain controller to use for all operations, defaults to PDC Emulator | |
.PARAMETER Credential | |
Domain Admin level credential to use for operations, defaults to current user | |
#> | |
[CmdletBinding()] | |
param( |
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
REM This batch file allows you to launch any program as the current user. Placing | |
REM this file in your System32 directory or adding it to your path will allow you | |
REM to easily launch applications. | |
REM Usage: RunAsInvoker.cmd [Application] | |
REM Example: RunAsInvoker.cmd mmc.exe | |
REM Example: RunAsInvoker.cmd certmgr.msc | |
@ECHO OFF | |
set __COMPAT_LAYER=RUNASINVOKER | |
start "" %* |
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
@ECHO OFF | |
SETLOCAL | |
FOR /F "tokens=4-5 delims=. " %%i IN ('ver') DO SET VERSION=%%i.%%j | |
IF "%VERSION%" == "10.0" GOTO :NOUPDATE | |
IF "%VERSION%" == "6.3" GOTO :NOUPDATE | |
IF "%VERSION%" == "6.2" GOTO :NOUPDATE | |
IF "%VERSION%" == "6.1" GOTO :UPDATETry | |
ENDLOCAL | |
:NOUPDATE |
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 | |
Return the server certificate a server is using on a specified port | |
.PARAMETER ComputerName | |
The remote computer to query | |
.PARAMETER Port | |
The remote TCP port to query | |
.PARAMETER SubjectNameIdentifier | |
The Subject Name Identifier to send to the server, defaults to the computer name | |
.PARAMETER SkipCertificateCheck |
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
Set-PSUAuthenticationMethod -Type "Form" -ScriptBlock { | |
param( | |
[PSCredential]$Credential | |
) | |
Add-Type -AssemblyName System.DirectoryServices.AccountManagement | |
# is this a UPN? | |
if ( $Credential.UserName.IndexOf('@') -gt -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
@ECHO OFF | |
SETLOCAL ENABLEDELAYEDEXPANSION | |
GOTO :RUN | |
:UNINSTALL | |
ECHO ------------------------------------------------------- | |
ECHO UNISTALL 32-Bit java matching "%~1" | |
ECHO ------------------------------------------------------- |
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
@ECHO OFF | |
REM If you ever need to re-install ScreenConnect on a client machine using | |
REM automation like Tanium or Automate and PowerShell is BROKEN on the | |
REM machine... never fear, this script will help you get it done. | |
REM | |
REM Note that this script expects to be able to be packaged with wget see: | |
REM https://eternallybored.org/misc/wget/ | |
REM If wget is not present it will fallback to bitsadmin, however on Windows 7 | |
REM bitsadmin is missing the /dynamic switch and downloads will fail. |
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
param($VM) | |
# VMware Guest UUIDs are big edian, MDT expects middle edian | |
# here we reverse the byte order of the first three sections of the guid and then cast back to a guid | |
[guid][byte[]]([guid]$VM.ExtensionData.Config.Uuid).ToByteArray()[3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15,16,17] |
NewerOlder