Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
3223 lines (2763 sloc) 285 KB
#_____________________________________________________________________________________________________________________________________________________
#//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\--//--\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ //¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__// [ Secure Digits Plus LLC | Hybrid | Desired State Controller ] \\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯¯ __________________________________________________________ ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯¯ -=-=-=-=-=-=-=[ Dynamically Engineered Digital Security ]-=-=-=-=-=-=--=-= ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ //¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__// Application Development | Virtualization | Network and Hardware Magistration \\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ //¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__// https://www.securedigitsplus.com | Server-Client | Seedling-Spawning Script \\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\___¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ___//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\ [ Provisional Author : Michael C Cook Sr. | "The Buck Stops Here" ] //¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__// ____ ____ ____ ____ ____ ____ ____ ____ ____ \\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\
#\\ [ Install-Hybrid ] @: Installs the base folder and application prerequisites for initializing a Hybrid Desired State Controller Server // \\__//
#//__________________________________________________________________________________________________________________________________________\\__//¯¯\\
#\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\__//¯¯\\__//¯¯\\
Using Namespace System.Security.Principal
Using Namespace System.Security.AccessControl
Using Namespace System.Management.Automation
Using NameSpace System.DirectoryServices
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Wrap-Action # Ties this commandlet into Write-Output for styling strings #¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ #¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdletBinding () ] Param (
[ Parameter ( Position = 0 , Mandatory , ValueFromPipeline = $True ) ][ String ] $Type ,
[ Parameter ( Position = 1 , Mandatory , ValueFromPipeline = $True ) ][ String ] $Info )
$fs = " // " ; $bs = " \\ " ; $x = " " * ( 25 - $Type.Length ) ; $y = " " * ( 80 - $Info.Length )
Echo @( "" ; ( $fs + ( "¯-" * 54 ) + $bs ) ;
"$( $bs + $x + $Type ) : $( $Info + $y + $fs )" ;
( $fs + ( "-_" * 54 ) + $bs ) ; "" )
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Wrap-Title # Ties this commandlet into Write-Output for styling strings #¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ #¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , Mandatory , ValueFromPipeline = $True ) ][ String ] $Title )
$fs = " // " ; $bs = " \\ " ; $th = "[ $Title ]" ; $y = $th.length ; $x = 108 - $y
If ( $x % 4 -ge 2 ) { $x = $x - 2 ; $y = $th.replace( "[" , " [ " ) ; $th = $y }
If ( $x % 2 -ge 1 ) { $x = $x - 1 ; $y = $th.replace( "]" , " ]" ) ; $th = $y ; $z = 0 }
If ( $z = 1 ) { $z = " -" } Else { $z = "- " } $y = $z * ( $x / 4 ) ; $x = "- " * ( $x / 4 )
Echo @( "" ; ( $fs + ( "¯-" * 54 ) + $bs )
"$( $bs + $x + $th + $y + $fs )" )
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Wrap-Array # Ties this commandlet into Write-Output for styling a string array #¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ #¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdletBinding () ] Param (
[ Parameter ( Position = 0 , Mandatory , ValueFromPipeline = $True ) ] [ Array ] $Block )
$fs = " // " ; $bs = " \\ "
Echo @( " " * 112 ; $fs + "¯-" * 54 + $bs )
Echo $Block
Echo @( $fs + "-_" * 54 + $bs ; " " * 112 )
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Wrap-Section #¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ #¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , Mandatory , ValueFromPipeline = $True ) ] [ String ] $Section , [ Switch ] $In , [ Switch ] $Out )
If ( $In ) { $fs = " // " ; $bs = " \\ " } ; If ( $Out ) { $bs = " // " ; $fs = " \\ " }
$z = $Section ; $x = " " * 10 ; $y = " " * ( 98 - $z.Length )
( $fs + " " * 54 + $bs )
Echo "$( $bs + $x + $z + $y + $fs )"
( $fs + " " * 54 + $bs )
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Wrap-Item #¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ #¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , Mandatory , ValueFromPipeline = $True ) ] [ String ] $Type ,
[ Parameter ( Position = 1 , Mandatory , ValueFromPipeline = $True ) ] [ String ] $Info , [ Switch ] $In , [ Switch ] $Out )
If ( $In ) { $fs = " // " ; $bs = " \\ " } ; If ( $Out ) { $bs = " // " ; $fs = " \\ " }
$x = " " * ( 25 - $Type.Length ) ; $y = " " * ( 80 - $Info.Length )
Echo "$( $bs + $x + $Type ) : $( $Info + $y + $fs )"
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Wrap-Space #¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ #¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdLetBinding () ] Param ( [ Switch ] $In , [ Switch ] $Out )
If ( $In ) { $fs = " // " ; $bs = " \\ " } ; If ( $Out ) { $bs = " // " ; $fs = " \\ " }
Echo @( $bs + ( " " * 108 ) + $fs )
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Wrap-Foot #¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ #¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$fs = " // " ; $bs = " \\ " ; Echo @( ( $fs + ( "¯-" * 54 ) + $bs ) ; "" )
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Display-TrueColors # Draws this static string array on the screen ( Will replace with Math at some point ) ¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Array -Block @(
" \\ __________________________________________________________________________________________________________ // " ;
" // /¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__/ // " ;
" // /¯¯\\ //¯¯\ \\ " ;
" \\ \__// [ The beginning of the fight against Technological Tyranny and Cyber Criminal Activities ] \\__/ // " ;
" // /¯¯\\ __________________________________________________________________________________________ //¯¯\ \\ " ;
" \\ \__// \\ ]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ // * * * * * * ]________________________________________________\\ //¯¯\ \\ " ;
" \\ \__// \\ * * * * * ]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ // * * * * * * ]___[ Dynamically Engineered Digital Security ]__\\ //¯¯\ \\ " ;
" \\ \__// \\ * * * * * ]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ // * * * * * * ]________________________________________________\\ //¯¯\ \\ " ;
" \\ \__// \\ * * * * * ]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ // * * * * * * ]__[ Application Development - Virtualization ]__\\ //¯¯\ \\ " ;
" \\ \__// \\ * * * * * ]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ // * * * * * * ]________________________________________________\\ //¯¯\ \\ " ;
" \\ \__// \\ * * * * * ]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ // * * * * * * ]_______[ Network & Hardware Magistration ]______\\ //¯¯\ \\ " ;
" \\ \__// \\ What America Once Stood For ]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ //_____________________________________]________________________________________________\\ //¯¯\ \\ " ;
" \\ \__// \\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ //_________________________________[=]\_/[=]\_/[=]\_/[=]________________________________\\ //¯¯\ \\ " ;
" \\ \__// \\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ //_________________________________[=] H Y B R I D [=]________________________________\\ //¯¯\ \\ " ;
" \\ \__// \\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ //__________________[=]\_/[=]\_/[=]|=| B Y |=|[=]\_/[=]\_/[=]_________________\\ //¯¯\ \\ " ;
" \\ \__// \\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ //__________________[-] S E C U R E - D I G I T S - P L U S - L L C [-]_________________\\ //¯¯\ \\ " ;
" \\ \__// \\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯/¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ //___________[=]\_/[=]\_/[=]\_/[=]\_/[=]\__/[=]\__/[=]\_/[=]\_/[=]\_/[=]\_/[=]__________\\ //¯¯\ \\ " ;
" \\ \__// \\¯¯¯¯¯¯¯¯¯¯¯[=]¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯[=]¯¯¯¯¯¯¯¯¯¯// \\__/ // " ;
" // /¯¯\\ //___________[=] 0 8 / 1 4 / 2 0 1 9 | M I C H A E L C C O O K S R [=]__________\\ //¯¯\ \\ " ;
" \\ \__// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\__/ // " ;
" // /¯¯\\ [ A Heightened Sense Of Security ] //¯¯\ \\ " ;
" \\ \__// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \\__/ // " ;
" // /¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__/ // " )
Sleep -S 2
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Display-Foot # Same as the above, just using this string array below at the end of the script ¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Array -Block @(
" // /¯¯\\__//¯¯\\__//¯¯\\ __________________________________________________________ //¯¯\\__//¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__//¯¯\\__// Secure Digits Plus LLC | Hybrid | Desired State Controller \\__//¯¯\\__//¯¯\\__/ // " ;
" // /¯¯\\__//¯¯\\__//¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯\\__//¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__//¯¯ -=-=-=-=-=-=-=[ Dynamically Engineered Digital Security ]-=-=-=-=-=-=--=-= ¯¯\\__//¯¯\\__/ // " ;
" // /¯¯\\__//¯¯\\ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ //¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__// Application Development | Virtualization | Network and Hardware Magistration \\__//¯¯\\__/ // " ;
" // /¯¯\\__//¯¯\\ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ //¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__// https://www.securedigitsplus.com | Server-Client | Seedling-Spawning Script \\__//¯¯\\__/ // " ;
" // /¯¯\\__//¯¯\\__ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ //¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__//¯¯\\__ You've just deployed a heightened sense of security __//¯¯\\__//¯¯\\__/ // " ;
" // /¯¯\\__//¯¯\\__//¯¯\\__________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\ \\ " ;
" \\ \__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__/ // " )
Sleep -S 2
}
# ____ ____________________________
#//¯¯\\__________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Convert-XAMLToWindow # Overloads a block of XAML strings to convert into interactive content dynamically ¯¯¯\\__//¯¯\\__//__\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Param ( [ Parameter ( Mandatory ) ] [ String ] $XAML ,
[ String [] ] $NamedElement = $Null ,
[ Switch ] $PassThru )
@( "Framework" , "Core" | % { "Presentation$_" } ) + "WindowsBase" | % { Add-Type -AssemblyName $_ }
$Reader = [ XML.XMLReader ]::Create([ IO.StringReader ] $XAML )
$Output = [ Windows.Markup.XAMLReader ]::Load( $Reader )
$NamedElement | % { $Output | Add-Member -MemberType NoteProperty -Name $_ -Value $Output.FindName( $_ ) -Force }
If ( $PassThru ) { $Output }
Else { $Null = $GUI.Dispatcher.InvokeAsync{ $Output = $GUI.ShowDialog() ;
SV -Name Output -Value $Output -Scope 1 }.Wait() ; $Output } }
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Show-WPFWindow # Displays the previously overloaded XAML string ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Param ( [ Parameter ( Mandatory ) ] [ Windows.Window ] $GUI )
$Output = $Null ; $Null = $GUI.Dispatcher.InvokeAsync{ $Output = $GUI.ShowDialog()
SV -Name Output -Value $Output -Scope 1 }.Wait() ; $Output
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Export-Ini # Extensively modified version found on TechNet ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdLetBinding () ] Param (
[ Parameter ( Mandatory = $True , Position = 0 ) ][ String ] $Path ,
[ ValidateNotNullOrEmpty () ][ ValidatePattern ( '^([a-zA-Z]\:)?.+\.ini$' ) ]
[ Parameter ( Mandatory = $True , Position = 1 ) ][ String ] $Name ,
[ ValidateNotNullOrEmpty () ]
[ Parameter ( Mandatory = $True , Position = 2 , ValueFromPipeline = $True ) ][ Hashtable ] $Value ,
[ ValidateSet ( "Unicode" , "UTF7" , "UTF8" , "UTF32" , "ASCII" , "BigEndianUnicode" , "Default" , "OEM" ) ]
[ Parameter ( Mandatory = $True , Position = 3 ) ][ String ] $Encoding = "Unicode" ,
[ Switch ] $Force , [ Switch ] $Append , [ Switch ] $UTF8NoBOM )
Begin
{
( $P , $E , $F , $O , $HT ) = ( $Path , $Encoding , "$Path\$Name" , $Value , "Hashtable" )
If ( ! ( $O ) ) { Wrap-Action "Exception" "[!] Value is Null" ; Break }
If ( ! ( Test-Path $P ) ) { Wrap-Action "Exception" "[!] Invalid Path" ; Break }
If ( ( Test-Path $F ) -and ( ! $Force ) )
{
If ( $Append ) { $OF = @( GC $F ) }
If ( ! $Append ) { Wrap-Action "Exception" "[!] File exists @: Use -Force or -Append" ; Break }
}
Else { $OF = @( ) }
}
Process
{
Wrap-Action "Processing" "[~] Output"
ForEach ( $i in $O.Keys )
{
If ( $( $O[$i].GetType().Name ) -ne $HT ) { $OF += "$i=$( $O[$i] )" } Else { $OF += "[$i]" }
ForEach ( $j in $( $O[$i].Keys | Sort ) )
{
If ( $j -Match "^Comment[\d]+" ) { $OF += "$( $O[$i][$j] )" } Else { $OF += "$j=$( $O[$i][$j] )" }
}
SC -Path $F -Value @( $OF ) -Encoding $E
}
GI $F
Wrap-Action "Completed" "[+] File Exported Successfully"
Write-Host -F Cyan "$( $MyInvocation.MyCommand.Name ): $F"
}
End
{
If ( $UTF8NoBom )
{ [ System.IO.File ]::WriteAllLines( ( $F ) , ( GC $F ) , ( New-Object System.Text.UTF8Encoding $False ) ) }
}
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Add-ACL # Changes permissions of application pool/VHost ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdletBinding () ] Param ( [ String ] $Path , [ FileSystemAccessRule ] $ACL )
( Get-ACL -Path $Path ) | % { $_.AddAccessRule( $ACL ) ; Set-ACL -Path $Path -AclObject $_ }
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function New-ACLObject # Generates an ACL and edits its permissions ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
[ CmdletBinding () ] Param ( [ String ] $SAM ,
[ FileSystemRights ] $Rights ,
[ AccessControlType ] $Access = 'Allow' ,
[ InheritanceFlags ] $Inherit = 'None' ,
[ PropagationFlags ] $Propagate = 'None' )
New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule( $SAM , $Rights , $Inherit , $Propagate , $Access )
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Collect-Graphics # Collects the background and banner for XAML ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Author = "Secure Digits Plus LLC"
$GFX = @{
Author = $Author
Title = "[ $Author | Hybrid ] DSC"
Path = "$Env:Temp\$Author"
Banner = "banner.png"
Background = "background.jpg"
Secure = "https://securedigitsplus.com" }
$GFX | % {
If ( ( Test-Path $_.Path ) -ne $True )
{
NI $_.Path -ItemType Directory -Force -VB
[ Net.ServicePointManager ]::SecurityProtocol = [ Net.SecurityProtocolType ]::TLS12
$Site = "$( $GFX.Secure )/img" | % { "$_/$( $GFX.Banner )" , "$_/$( $GFX.Background )" }
$Image = $_.Banner , $_.Background
$Out = @( 0..1 | % { "$( $GFX.Path )\$( $Image[$_] )" } )
Foreach ( $i in 0..1 ) { IWR -URI "$( $Site[$i] )" -OutFile "$( $Out[$i] )" }
}
}
( $GFX.Banner , $GFX.Background ) = ( $GFX.Banner , $GFX.Background ) | % { "$( $GFX.Path )\$_" }
Return $GFX
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Collect-Registry # Collects installed applications from the registry ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Return "" , "\WOW6432Node" | % { gp "HKLM:\SOFTWARE$_\Microsoft\Windows\CurrentVersion\Uninstall\*" }
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Collect-DSCRoot # Collects Hybrid DSC Installation Path ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"HKLM:\Software\Policies\Secure Digits Plus LLC" | % {
If ( ( Test-Path $_ ) -ne $True ) { Return 1 }
Else { Return @{ Root = $_ ; Tree = ( gp $_ ).'Hybrid-DSC' } }
}
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Install-DSCRoot # Provisions base folder for Hybrid-DSC to source files \\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{ # ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$GFX = @( Collect-Graphics )
$Title = "$( $GFX.Title ) Root"
[ System.Windows.MessageBox ]::Show( "This folder may be reused for multiple deployment shares" ,
"Specify a Hybrid-DSC Root folder." )
$XAML = @"
<Window
xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
Title = "$Title"
Width = "640"
Height = "450"
WindowStartupLocation = "CenterScreen"
Topmost = "True"
HorizontalAlignment = "Center"
ResizeMode = "NoResize" >
<StackPanel>
<StackPanel.Background>
<ImageBrush ImageSource = "$( $GFX.Background )"
Stretch = "UniformToFill" />
</StackPanel.Background>
<StackPanel
Height = "250" >
<Image
Width = "600"
Height = "250"
Source = "$( $GFX.Banner )"
HorizontalAlignment = "Center"
Margin = "0,0" />
</StackPanel>
<StackPanel
Height = "120" >
<TextBlock
HorizontalAlignment = "Center"
FontSize = "14"
FontWeight = "Bold"
Foreground = "#FF84FF4A"
FontFamily = "Segoe UI" >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = "5"
Color = "#FF5B5546" />
</TextBlock.Effect>
Enter an installation folder for Hybrid-DSC
</TextBlock>
<TextBox
Name = "Install"
Height = "22"
TextWrapping = "Wrap"
Width = "300"
Margin = "10" />
</StackPanel>
<StackPanel
Orientation = "Horizontal"
FlowDirection = "LeftToRight"
VerticalAlignment = "Bottom"
HorizontalAlignment = "Center"
Height = "40"
Margin = "145,0,145,0" >
<Button
Name = "Start"
Content = "Start"
HorizontalAlignment = "Left"
Height = "20"
Width = "170" />
<Button
Name = "Cancel"
Content = "Cancel"
HorizontalAlignment = "Right"
Height = "20"
Width = "170" />
</StackPanel>
</StackPanel>
</Window>
"@
# ____ ___________________________________________________________________________#/¯¯\\__//¯¯\\__//¯¯\\
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\____[ Converts the XAML into a Window ]_______//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$GUI = Convert-XAMLtoWindow -Xaml $XAML -NamedElement "Install" , "Start" , "Cancel" -PassThru
$GUI.Cancel.Add_Click( { $GUI.DialogResult = $False } )
$GUI.Start.Add_Click( {
"Installation Location" | % { $1 = "You must enter a $_" ; $2 = "$_ Missing" }
If ( $GUI.Install.Text -eq "" ) { [ System.Windows.MessageBox ]::Show( $1 , $2 ) }
Else { $GUI.DialogResult = $True } } )
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___[ Synchronizes WPF with Window Element ]___//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Output = Show-WPFWindow -GUI $GUI
If ( $Output -eq $True )
{
( $Base , $Vendor , $Registry ) = ( $GUI.Install.Text , "Secure Digits Plus LLC" , "HKLM:\SOFTWARE\Policies" )
$BasePath = "$Registry\$Vendor"
$Base | ? { ( Test-Path $_ ) -ne $True } | % {
Wrap-Action "Creating" "[~] Installation Directory"
NI $_ -ItemType Directory
Start $_
If ( $_ -eq $False )
{
Wrap-Action "Exception" "[!] The directory could not be created"
Read-Host "Press Enter to Exit"
Exit
}
Wrap-Action "Created" "[+] Installation Directory"
}
Sleep -M 100
$Base | ? { ( Test-Path $_ ) -eq $True } | % {
$BasePath | ? { ( Test-Path $_ ) -eq $False } | % {
Wrap-Action "Creating" "[~] Registry Entry for Installation path"
NI -Path $Registry -Name $Vendor
If ( $? -ne $True )
{
Wrap-Action "Exception" "[!] Registry Entry Creation Failed" ; Read-Host "Press Enter to Exit" ; Exit }
( "Hybrid-DSC" , $Base ) , ( "Installation Date" , ( Get-Date ) ) | % {
SP -Path $BasePath -Name $_[0] -Value $_[1]
Wrap-Action "Created" "[+] $_"
}
}
}
Collect-Dependencies
"HKLM:\Software\Policies\Secure Digits Plus LLC" | % { Return @{ Root = $_ ; Tree = ( gp $_ ).'Hybrid-DSC' } }
}
Else
{
Wrap-Action "Exception" "[!] The exited or the dialogue failed"
Read-Host "Press Enter to Exit"
Exit
}
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Install-Dependencies # Downloads dependency programs & files ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , ValueFromPipeline = $True ) ][ String ] $ID ,
[ Parameter ( Position = 1 , ValueFromPipeline = $True ) ][ String ] $Path ,
[ Parameter ( Position = 2 , ValueFromPipeline = $True ) ][ String ] $File ,
[ Parameter ( Position = 3 , ValueFromPipeline = $True ) ][ String ] $URL ,
[ Parameter ( Position = 4 , ValueFromPipeline = $True ) ][ String ] $Args )
If ( ( Test-Path $Path ) -ne $True )
{
NI $Path -ItemType Directory -Value $Path
Wrap-Action -Type "Created" -Info "[+] Directory @: $Path" }
IWR -URI $URL -OutFile "$Path\$File"
Wrap-Action "Installing" $ID
Wrap-Action "Processing" "This could take a while."
$Dependency = SAPS -FilePath $File -Args $Args -WorkingDirectory $Path -PassThru
For ( $j = 0 ; $j -le 100 ; $j = ( $j + 1 ) % 100 )
{ Write-Progress -Activity " [ Installing ] $ID" -PercentComplete $j -Status "$( $j )% Complete"
Sleep -M 250
If ( $Dependency.HasExited ) { Write-Progress -Activity "[ Installed ]" -Completed ; Return } }
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Extract-Archive # Downloads dependency programs & files ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
$Reg = @( Collect-Registry )
$7z = "$( ( $Reg | ? { $_.DisplayName -like "*7-zip*" } ).InstallLocation )7z.exe"
Return $7Z
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Load-MDTModule # Loads the module for MDT ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
IPMO ( gci ( gp "HKLM:\Software\Microsoft\Deployment 4" ).Install_Dir -Filter "*Toolkit.psd1" -Recurse ).FullName
If ( $? -eq $True ) { Wrap-Action "Successful" "[+] MDT Module Loaded" }
Else { Wrap-Action "Failed" "[!] MDT Module was not found" }
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Collect-Dependencies # Downloads dependency programs & files ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
Wrap-Action "Querying" "Registry for installed applications"
$Reg = @( Collect-Registry )
$Base = @( Collect-DSCRoot ).Tree
$CPU = $env:PROCESSOR_ARCHITECTURE
$SRV = $env:COMPUTERNAME
$MDTFile = "MicrosoftDeployment`Toolkit_x"
$MDTURL = "https://download.microsoft.com/download/3/3/9/339BE62D-B4B8-4956-B58D-73C4685FC492"
$ADK = "Windows Assessment and Deployment Kit"
$MDT = "Microsoft Deployment Toolkit"
$7zu = "https://www.7-zip.org/a"
If ( $CPU -eq "x86" ) { $MDTFile = "$MDTFile`86.msi" ; $7zip = "7Z1900.exe" }
Else { $MDTFile = "$MDTFile`64.msi" ; $7zip = "7z1900-x64.exe" }
$List = @{
0 = # - [ Windows ADK ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \\#
"Deployment Kit - Windows 10" , # Regex String //#
"10.1.17763.1" , # Minimum Version \\#
"WinADK" , # ID //#
"Windows Assessment and Deployment Kit" , # Title \\#
"$Base\WinADK" , # Target Path //#
"winadk1903.exe" , # Target File \\#
"https://go.microsoft.com/fwlink/?linkid=2086042" , # URL //#
"/quiet /norestart /log $env:temp\win_adk.log /features +" # Silent Arguments \\#
1 = # - [ Windows PE ]- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //#
"Preinstallation" , # Regex String \\#
"10.1.17763.1" , # Minimum Version //#
"WinPE" , # ID \\#
"Windows ADK Preinstallation Environment" , # Title //#
"$Base\WinPE" , # Target Path \\#
"winpe1903.exe" , # Target File //#
"https://go.microsoft.com/fwlink/?linkid=2087112" , # URL \\#
"/quiet /norestart /log $env:temp\win_adk.log /features +" # Silent Arguments //#
2 = # - [ Microsoft Deployment Toolkit ]- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \\#
"Deployment Tool" , # Regex String //#
"6.3.8450.0000" , # Minimum Version \\#
"MDT" , # ID //#
"Microsoft Deployment Toolkit" , # Title \\#
"$Base\MDT" , # Target Path //#
"$MDTFile" , # Target File \\#
"$MDTURL/$MDTFile" , # URL //#
"/quiet /norestart" # Silent Arguments \\#
3 = # - [ 7-Zip ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //#
"7-Zip" , # Regex String \\#
"19.00" , # Minimum Version //#
"7-Zip" , # ID \\#
"7-Zip Archiving Utility" , # Title //#
"$Base\7-Zip" , # Target Path \\#
"$7zip" , # Target File //#
"$7zu/$7zip" , # URL \\#
"/S" } # Silent Arguments //#
ForEach ( $i in 0..3 )
{
$p = $List[$i]
$Item = $Reg | ? { $_.DisplayName -like "*$( $p[0] )*" } | Select DisplayName , DisplayVersion
If ( ( $Item -ne $Null ) -and ( $Item.DisplayVersion -ge $p[1] ) )
{
Wrap-Action "Dependency" "$( $p[2] ) meets minimum requirements"
}
ElseIf ( ( $Item -eq $Null ) -or ( $Item.DisplayVersion -lt $p[1] ) )
{
Wrap-Action "Dependency" "$( $p[2] ) does not meet minimum requirements"
Wrap-Action "Downloading" "$( $p[2] )"
Install-Dependencies -ID $p[3] -Path $p[4] -File $p[5] -URL $p[6] -Args $p[7]
If ( $? -eq $True ) { Wrap-Action "Successful" "[+] $( $p[2] ) Updated" }
Else { Wrap-Action "Exception" "[!] $( $p[2] ) Failed to update"
Read-Host "Press Enter to Exit"
Exit }
}
}
Wrap-Action "Installed" "[+] All Dependencies"
Wrap-Action "Sourcing" "[+] Hybrid-DSC Root Structure"
"Hybrid" , "Libraries" , "Scripts" , "Templates" , "Install" | % { If ( ( Test-Path "$Base\$_" ) -eq $True ) { RI $Base\$_ -Recurse -Force } }
"$Base\Hybrid.7z" | % {
If ( ( Test-Path $_ ) -eq $True ) { RI $_ -Force }
IWR -URI "https://securedigitsplus.com/Hybrid-DSC/Hybrid.7z" -OutFile "$_"
Set-Alias SZ "$( Extract-Archive )"
SZ x $_ -o"$Base"
RI $_ -Force
}
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Collect-DSCShare # Downloads dependency programs & files ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
$Root = @( Collect-DSCRoot ).Root
$Tree = "Hybrid\Desired State Controller"
If ( ( gci $Root ) -eq $Null ) { $Install = 1 }
ElseIf ( ( gci $Root ) -ne $Null )
{
$Trunk = ( gci "$( $Root )\$Tree" ).PSChildName
If ( $Trunk.Count -gt 1 )
{
Wrap-Action "Selection" "[~] Multiple Company/Channels Found"
[ System.Windows.Messagebox ]::Show( "Multiple Provisionaries Found" , "Make Selection" )
0..( $Trunk.Count - 1 ) | % { Echo "[$_] @: $( $Trunk[$_] )" }
$Trunk = $( $Trunk[$( Read-Host "Select [#] Company/Channel" )] )
}
If ( $Trunk.Count -le 0 ) { $Install = 1 }
$Branch = ( gci "$( $Root )\$Tree\$Trunk" ).PSChildName
If ( $Branch.Count -gt 1 )
{
Wrap-Action "Selection" "[~] Multiple Drives Found"
[ System.Windows.Messagebox ]::Show( "Multiple Drives Found" , "Make Selection" )
0..( $Branch.Count - 1 ) | % { Echo "[$_] $( $Branch[$_] )" }
$Branch = $( $Branch[$( Read-Host "Select [#] of SMBShare/PSDrive" )] )
}
If ( $Branch.Count -le 0 ) { RI "$Root\$Tree\$Trunk" ; $Install = 1 }
}
If ( $Install -eq 1 ) { Return 1 }
Else
{
Return gp "$Root\$Tree\$Trunk\$Branch" | % {
$_.R00_Company ; $_.R01_UNCRoot ; $_.R02_Hostname ; $_.R03_DC_User ; $_.R04_DC_Pass ; $_.R05_WWW_Site ;
$_.R06_Phone ; $_.R07_Hours ; $_.R08_Logo ; $_.R09_Background ; $_.R10_Branch ; $_.R11_Domain ;
$_.R12_LM_User ; $_.R13_LM_Pass ; $_.R14_Proxy ; $_.R15_NetBIOS ; $_.R16_DSC_Folder ; $_.R17_PSDrive ;
$_.R18_PSDrive_ID ; $_.R19_BITS_Name ; $_.R20_BITS_Pool ; $_.R21_BITS_Host ; $_.R22_BITS_Root ; $_.R23_BITS_Site }
}
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Install-DSCShare # Provisions a deployment server ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
$GFX = @( Collect-Graphics )
$Named = @( 0..4 | % { "r$_" } ; 0..2 | % { "iis$_" } ; 0..2 | % { "dc$_" } ;
0..3 | % { "p$_" } ; 0..1 | % { "img$_" } ; 0 | % { "n$_" } )
$Title = "$( $GFX.Title ) - Deployment Share / BITS / IIS Setup"
$FirstTags = @( "" , "" , "System Root 'C:\'" ; @( "Secured" | % { "Deploy Folder '$_'" , "SMB Name '$_$'" , "PSDrive '$_`:'" } ) + ,
"Description '[Dev]'" , "" , "" , "BITS / IIS Name 'Hybrid'" , "IIS App Pool 'SecureApp'" , "Virtual Host / Proxy" ,
"" , "" , "NetBIOS Domain" ; @( "Child Admin" | % { "$_ User" , "$_ P/W" } ) )
$FirstOffs = @( "" ; "" ; @( $Named[0..4] ) + "" ; "" ; @( $Named[5..7] ) + "" ; "" ; @( $Named[8..10] ) )
$FirstList = @{ RowDef = @( 0..16 | % {
" <RowDefinition Height = '*' />
"})
TextBlock = @( 2..6 + 9..11 + 14..16 | % {
" <TextBlock
Grid.Row = '$_'
Grid.Column = '0'
Margin = '5'
FontSize = '14'
HorizontalAlignment = 'Center'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
$( $FirstTags[$_] )
</TextBlock>
"})
TextBoxes = @( 2..6 + 9..11 + 14..15 | % {
" <TextBox
Name = '$( $FirstOffs[$_] )'
Grid.Row = '$_'
Grid.Column = '1'
Margin = '5'
Height = '20'
FontSize = '10' />
"}) + @( 16 | % {
" <PasswordBox
Name = '$( $FirstOffs[$_] )'
Grid.Row = '$_'
Grid.Column = '1'
Margin = '5'
Height = '20'
FontSize = '10'
PasswordChar = '*' >
</PasswordBox>
"})}
# ____ _________________________________________________________________________________________________________________
#// \\______________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____[ Second Tab Values ]________\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$SecondTags = @( "" ; "Company Name" ; @( "Website" , "Phone" , "Hours" | % { "Support $_" ; } ) +
""; "Logo [ 120x120.bmp ]" ; "Background" ; "" ; "Branch" )
$SecondOffs = @( "" ; @( $Named[11..14] ) + "" ; @( $Named[15..16] ) + "" ; $( $Named[17] ) )
$SecondList = @{ RowDef = @( 0..10 | % {
" <RowDefinition Height = '32' />
"})
TextBlock = @( 1..4 + 6 , 7 , 9 | % {
" <TextBlock
Grid.Row = '$_'
Grid.Column = '0'
Margin = '5'
FontSize = '14'
HorizontalAlignment = 'Center'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
$( $SecondTags[$_] )
</TextBlock>
"})
TextBoxes = @( 1..4 + 6 , 7 , 9 | % {
" <TextBox
Name = '$( $SecondOffs[$_] )'
Grid.Row = '$_'
Grid.Column = '1'
Height = '20'
FontSize = '10'
Margin = '5' />
"})}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# Dynamic XAML Content Definitions ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$XAMLRoot = @"
<Window
xmlns = 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:x = 'http://schemas.microsoft.com/winfx/2006/xaml'
Title = '[ Secure Digits Plus LLC | Hybrid ] Desired State Controller'
Width = '640'
Height = '850'
WindowStartupLocation = 'CenterScreen'
Topmost = 'True'
HorizontalAlignment = 'Center'
ResizeMode = 'NoResize' >
<StackPanel>
<StackPanel.Background>
<ImageBrush ImageSource = '$( $GFX.Background )'
Stretch = 'UniformToFill' />
</StackPanel.Background>
<StackPanel
Height = '250' >
<Image
Width = '640'
Height = '240'
Source = '$( $GFX.Banner )'
HorizontalAlignment = 'Center'
Margin = '10' />
</StackPanel>
<StackPanel
Height = '515' >
<TabControl
Height = '515'
HorizontalContentAlignment = 'Center'
HorizontalAlignment = 'Center'
VerticalAlignment = 'Center'
Background = '{x:Null}'
BorderBrush = '{x:Null}'
Foreground = '{x:Null}'
Margin = '10,0' >
<TabItem
Header = 'Stage Deployment Server'
HorizontalAlignment = 'Center'
Width = '240'
BorderBrush = '{x:Null}' >
<TabItem.Effect>
<DropShadowEffect/>
</TabItem.Effect>
<Grid
Height = '480'
VerticalAlignment = 'Top' >
<Grid.ColumnDefinitions>
<ColumnDefinition Width = '0.5*' />
<ColumnDefinition Width = '0.5*' />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
$( $FirstList.RowDef )
</Grid.RowDefinitions>
<TextBlock
Grid.Row = '0'
Grid.Column = '0'
Grid.ColumnSpan = '2'
Margin = '5'
HorizontalAlignment = 'Center'
TextAlignment = 'Center'
FontSize = '14'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
# - - - - - [ MDT Base Share Settings ] - - - - - #
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
</TextBlock>
<TextBlock
Grid.Row = '1'
Grid.Column = '0'
Grid.ColumnSpan = '2'
Margin = '5'
HorizontalAlignment = 'Center'
TextAlignment = 'Center'
FontSize = '14'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
These settings will generate a new MDT share
</TextBlock>
$( $FirstList.TextBlock[0..4] )
<RadioButton x:Name = 'Legacy'
Grid.Row = '7'
Grid.Column = '0'
Margin = '5'
Content = 'Disabled'
HorizontalAlignment = 'Center'
VerticalAlignment = 'Center'
Foreground = 'Gray'
IsEnabled = 'False' >
<RadioButton.Effect>
<DropShadowEffect/>
</RadioButton.Effect>
</RadioButton>
<RadioButton x:Name = 'PowerShell'
Grid.Row = '7'
Grid.Column = '1'
Margin = '5'
Content = 'Disabled'
HorizontalAlignment = 'Center'
VerticalAlignment = 'Center'
Foreground = 'Gray'
IsEnabled = 'False' >
<RadioButton.Effect>
<DropShadowEffect/>
</RadioButton.Effect>
</RadioButton>
<!-- # - - - - [ BITS / IIS Config ] - - - - # -->
<TextBlock
Grid.Row = '8'
Grid.Column = '0'
Grid.ColumnSpan = '2'
Margin = '5'
HorizontalAlignment = 'Center'
TextAlignment = 'Center'
FontSize = '14'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
# - - - - - - - - [ BITS / IIS Config ] - - - - - - - - #
</TextBlock>
$( $FirstList.TextBlock[5..7] )
<RadioButton
x:Name = 'IIS_I'
Grid.Row = '12'
Grid.Column = '0'
Margin = '5'
Content = 'Disabled'
HorizontalAlignment = 'Center'
VerticalAlignment = 'Center'
Foreground = 'Gray'
IsEnabled = 'False' >
<RadioButton.Effect>
<DropShadowEffect/>
</RadioButton.Effect>
</RadioButton>
<RadioButton
x:Name = 'IIS_X'
Grid.Row = '12'
Grid.Column = '1'
Margin = '5'
Content = 'Disabled'
HorizontalAlignment = 'Center'
VerticalAlignment = 'Center'
Foreground = 'Gray'
IsEnabled = 'False' >
<RadioButton.Effect>
<DropShadowEffect/>
</RadioButton.Effect>
</RadioButton>
<TextBlock
Grid.Row = '13'
Grid.Column = '0'
Grid.ColumnSpan = '2'
Margin = '5'
HorizontalAlignment = 'Center'
TextAlignment = 'Center'
FontSize = '14'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
# - - [ Network and Source Credentials ] - - #
</TextBlock>
$( $FirstList.TextBlock[8..10] )
$( $FirstList.TextBoxes[0..10] )
</Grid>
</TabItem>
<TabItem
Header = 'Image Info'
HorizontalAlignment = 'Center'
Width = '150'
BorderBrush = '{x:Null}' >
<TabItem.Effect>
<DropShadowEffect/>
</TabItem.Effect>
<Grid
Height = '400'
VerticalAlignment = 'Top' >
<Grid.ColumnDefinitions>
<ColumnDefinition Width = '0.5*' />
<ColumnDefinition Width = '0.5*' />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
$( $SecondList.RowDef )
</Grid.RowDefinitions>
<TextBlock
Grid.Row = '0'
Grid.Column = '0'
Grid.ColumnSpan = '2'
Margin = '5'
HorizontalAlignment = 'Center'
TextAlignment = 'Center'
FontSize = '14'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
# - - [ Company Information ] - - #
</TextBlock>
$( $SecondList.TextBlock[0..3] )
<TextBlock
Grid.Row = '5'
Grid.Column = '0'
Grid.ColumnSpan = '2'
Margin = '5'
HorizontalAlignment = 'Center'
TextAlignment = 'Center'
FontSize = '14'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
# - - [ Custom Graphics ] - - #
</TextBlock>
$( $SecondList.TextBlock[ 4..5 ] )
<TextBlock
Grid.Row = '8'
Grid.Column = '0'
Grid.ColumnSpan = '2'
Margin = '5'
HorizontalAlignment = 'Center'
TextAlignment = 'Center'
FontSize = '14'
FontWeight = 'Bold'
Foreground = '#FF84FF4A'
FontFamily = 'Segoe UI' >
<TextBlock.Effect>
<DropShadowEffect
ShadowDepth = '5'
Color = '#FF5B5546' />
</TextBlock.Effect>
# - - [ Network Definitions ] - - #
</TextBlock>
$( $SecondList.TextBlock[ 6 ] )
$( $SecondList.TextBoxes )
</Grid>
</TabItem>
</TabControl>
</StackPanel>
<StackPanel
Orientation = 'Horizontal'
FlowDirection = 'LeftToRight'
VerticalAlignment = 'Bottom'
HorizontalAlignment = 'Center'
Height = '40'
Margin = '150,0,150,0' >
<Button
Name = 'Start'
Content = 'Start'
HorizontalAlignment = 'Left'
Height = '20'
Width = '170' />
<Button
Name = 'Cancel'
Content = 'Cancel'
HorizontalAlignment = 'Right'
Height = '20'
Width = '170' />
</StackPanel>
</StackPanel>
</Window>
"@
$GUI = Convert-XAMLtoWindow -Xaml $XAMLRoot -NamedElement @( $Named ; "Start" ; "Cancel" ) -PassThru
$GUI.Cancel.Add_Click({ $GUI.DialogResult = $False })
$GUI.Start.Add_Click({
$0 = @( "File System/Drive" ; "Root Folder" ; "Network Share Name" ; "PSDrive Name" ;
"Share Description" ; "Site Name" ; "Application Pool Name" ; "Virtual Directory" ;
"NetBIOS Name" ; "Target/LM Admin User" ; "Target/LM Admin Pass" ; "Company Name" ;
@( "Website" , "Phone" , "Hours" | % { "Support $_" ; } ) + "Logo " ; "Background" ; "Branch" )
$1 = $0 | % { "You must enter a $_" } ; $2 = $0 | % { "$_ Missing" } ;
$MSG = 0..17 | % { "[ System.Windows.MessageBox ]::Show( '$( $1[$_] )' , '$( $2[$_] )' )" }
If ( $GUI.r0.Text -eq "" ) { IEX $MSG[ 0] }
ElseIf ( $GUI.r1.Text -eq "" ) { IEX $MSG[ 1] }
ElseIf ( $GUI.r2.Text -eq "" ) { IEX $MSG[ 2] }
ElseIf ( $GUI.r3.Text -eq "" ) { IEX $MSG[ 3] }
ElseIf ( $GUI.r4.Text -eq "" ) { IEX $MSG[ 4] }
ElseIf ( $GUI.iis0.Text -eq "" ) { IEX $MSG[ 5] }
ElseIf ( $GUI.iis1.Text -eq "" ) { IEX $MSG[ 6] }
ElseIf ( $GUI.iis2.Text -eq "" ) { IEX $MSG[ 7] }
ElseIf ( $GUI.dc0.Text -eq "" ) { IEX $MSG[ 8] }
ElseIf ( $GUI.dc1.Text -eq "" ) { IEX $MSG[ 9] }
ElseIf ( $GUI.dc2.Password -eq "" ) { IEX $MSG[10] }
ElseIf ( $GUI.p0.Text -eq "" ) { IEX $MSG[11] }
ElseIf ( $GUI.p1.Text -eq "" ) { IEX $MSG[12] }
ElseIf ( $GUI.p2.Text -eq "" ) { IEX $MSG[13] }
ElseIf ( $GUI.p3.Text -eq "" ) { IEX $MSG[14] }
ElseIf ( $GUI.img0.Text -eq "" ) { IEX $MSG[15] }
ElseIf ( $GUI.img1.Text -eq "" ) { IEX $MSG[16] }
ElseIf ( $GUI.n0.Text -eq "" ) { IEX $MSG[17] }
Else { $GUI.DialogResult = $True }})
$Output = Show-WPFWindow -GUI $GUI
If ( $Output -eq $True )
{ $SP = $GUI.dc2.SecurePassword
$LMCRED = [ PSCredential ]::New( $GUI.dc1.Text , $SP )
$DOMAIN = Determine-Domain
$DSCShare = [ Ordered ]@{
R00_Company = "$( $GUI.p0.Text )"
R01_UNCRoot = "\\$Env:ComputerName\$( $GUI.r2.Text.TrimEnd( '$' ) )$"
R02_Hostname = "$ENV:ComputerName"
R03_DC_User = "$( $DCCred.Username )"
R04_DC_Pass = "System.Security.SecureString"
R05_WWW_Site = "$( $GUI.p1.Text )"
R06_Phone = "$( $GUI.p2.Text )"
R07_Hours = "$( $GUI.p3.Text )"
R08_Logo = "$( $GUI.img0.Text )"
R09_Background = "$( $GUI.img1.Text )"
R10_Branch = "$( $GUI.n0.Text )"
R11_Domain = "$DOMAIN"
R12_LM_User = "$( $LMCRED.Username )"
R13_LM_Pass = "$( $LMCRED.GetNetworkCredential().Password )"
R14_Proxy = "$( $Env:ComputerName )"
R15_NetBIOS = "$( $Env:UserDomain )"
R16_DSC_Folder = "$( $GUI.r0.Text.TrimEnd( '\' ) )\$( ( $GUI.r1.Text ) )"
R17_PSDrive = "$( $GUI.r3.Text.TrimEnd( ':' ) )"
R18_PSDrive_ID = "$( $GUI.r4.Text )"
R19_BITS_Name = "$( $GUI.iis0.Text )"
R20_BITS_Pool = "$( $GUI.iis1.Text )"
R21_BITS_Host = "$( $GUI.iis2.Text )"
R22_BITS_Root = "$( $GUI.r0.Text.TrimEnd( '\' ) )\inetsrv\$( ( $GUI.iis2.Text ) )"
R23_BITS_Site = "$( $GUI.iis0.Text ).$env:USERDNSDOMAIN" }
echo $DSCShare
Read-Host "Check Variables"
$PName = $DSCShare.R00_Company
$NRoot = $DSCShare.R01_UNCRoot
$URI = $DSCShare.R16_DSC_Folder
$SMB = "$( $GUI.r2.Text.TrimEnd( '$' ) )$"
$PSD = $DSCShare.R17_PSDrive
$TAG = $DSCShare.R18_PSDrive_ID
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\______[ Generate the deployment share ]_______//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Load-MDTModule
$URI | % { If ( ( Test-Path $_ ) -eq $False ) { NI $_ -ItemType Directory } Else { GI $_ } }
If ( ( GSMBS | ? { $_.Path -eq $URI } -EA 0 ) -eq $Null ) { NSMBS -Name $SMB -Path $URI -Description $TAG -FullAccess Administrators }
Else { GSMBS -Name $SMB }
If ( ( GDR | ? { $_.Name -eq $PSD } -EA 0 ) -eq $Null )
{ NDR -Name $PSD -PSProvider MDTProvider -Root $URI -Description $TAG -NetworkPath $NRoot | Add-MDTPersistentDrive }
Else { GDR -Name $PSD }
$Tree = "Secure Digits Plus LLC\Hybrid\Desired State Controller\$PName\$PSD"
$Root = "HKLM:\SOFTWARE\Policies"
$Rec = $Tree.Split( '\' )
0 | % { If ( ( Test-Path "$Root\$( $Rec[ 0] )" ) -ne $True ) { NI -Path $Root -Name $Rec[ 0] } ; $Path = "$Root\$( $Rec[ 0] )" }
1..4 | % { If ( ( Test-Path "$Path\$( $Rec[$_] )" ) -ne $True ) { NI -Path $Path -Name $Rec[$_] } ; $Path = "$Path\$( $Rec[$_] )" }
If ( ( Test-Path $Path ) -eq $True )
{
$Name = @( $DSCShare ).Keys ; $Value = @( $DSCShare ).Values
0..23 | % { SP -Path "$Path" -Name "$( $Name[$_] )" -Value "$( $Value[$_] )" -Force }
}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\____[ Select Legacy MDT or PSD-Remaster ]_____//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Switch ( $host.UI.PromptForChoice( 'PowerShell Deployment' , 'Use Legacy Share or PSD-Remaster ?' ,
[ System.Management.Automation.Host.ChoiceDescription [] ]@( '&Legacy MDT' , '&PSD-Remaster' ) , [ Int ] 1 ) )
{
0
{ Wrap-Action "Selected" "[+] MDT [ Deployment ] Share created" }
1
{ Wrap-Action "Creating" "[+] PowerShell [ Deployment / Development ] Share"
$Base = @( Collect-DSCRoot ).Tree
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___________[ Scripts / Templates ]____________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Obj = $Scripts , $Templates = "Scripts" , "Templates"
$Obj | % { $S , $D = "$Base\$_" , "$URI\$_" ; ( gci $S ).Name | % {
Robocopy $S $D $_ ; Dir "$D\$_" | Unblock-File ; Write-Host -F Cyan "$_ copied successfully" } }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_________________[ Modules ]__________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Modules = "Tools\Modules"
"PSDGather", "PSDDeploymentShare", "PSDUtility", "PSDWizard" | % {
$ModPath = "$URI\$Modules\$_"
If ( ( Test-Path "$ModPath" ) -eq $False )
{ NI "$ModPath" -ItemType Directory ; Wrap-Action "Created" "[+] Directory $_" }
Wrap-Action "Copying" "Module $_ to $ModPath"
Robocopy "$Base\$Scripts" "$ModPath" "$_.psm1"
Dir "$ModPath" | Unblock-File
Write-Host -F Cyan "$_ copied successfully" }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\________________[ SnapIns ]___________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$BDD = "Microsoft.BDD"
Wrap-Action "Copying" "[+] $URI\$Modules"
If ( ( Test-Path "$URI\$Modules\$BDD.PSSnapin" ) -ne $True )
{ NI "$URI\$Modules\$BDD.PSSnapIn" -ItemType Directory ; Wrap-Action "Created" "[+] Directory" }
$PSSnapIn = ( ( "" , ".config" , "-help.xml" | % { ".dll$_" } ) +
( ".Format" , ".Types" | % { "$_.ps1xml" } ) | % { "PSSnapIn$_" } ) +
( "" , ".config" | % { "Core.dll$_" } ) + "ConfigManager.dll" | % {
CP "$MDTDir\Bin\$BDD.$_" "$URI\$Modules\$BDD.PSSnapIn" }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_______________[ Templates ]__________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Copying" "[+] $URI\$Templates"
If ( ( Test-Path "$URI\$Templates" ) -eq $False ) { NI "$URI\$Templates" }
"Groups" , "Medias" , "OperatingSystems" , "Packages" , "SelectionProfiles" , "TaskSequences" ,
"Applications" , "Drivers" , "LinkedDeploymentShares" | % { "$_.xsd" } | % {
CP "$MDTDir\$Templates\$_" "$URI\$Templates"
Wrap-Action "Copying" "[+] $URI\$Templates" }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_______________[ Zero-Touch ]_________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Sending" "[+] ZTIGather.XML to correct folder"
( gci "$MDTDir\Templates\Distribution\Scripts" "*Gather.xml" -EA 0 ) | % {
CP $_.FullName "$URI\$Modules\PSDGather" }
# ____ ___________________________________________________________________________#/¯¯\\__//¯¯\\__//¯¯\\
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____________[ Random Stuff ]_________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Msg = "Logs" , "Dynamics Logs Sub" , "DriverSources" , "DriverPackages" | % { "$_ Folder" }
$Dir = "Logs" , "Logs\Dyn" , "DriverSources" , "DriverPackages"
0..3 | % { Wrap-Action "Creating" "$( $Msg[$_] ) in $URI\$( $Dir[$_] )"
NI -ItemType Directory -Path "$URI\$( $Dir[$_] )" -Force }
}
}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\____________[ Share Permissions ]_____________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Reducing" "[~] Permissions Hardening on $SMB"
"Users" , "Administrators" , "SYSTEM" | % { "$_`:(OI)(CI)(RX)" } | % { $Null = ICACLS $URI /Grant "$_" }
GRSMBA -Name $SMB -AccountName "EVERYONE" -AccessRight Change -Force
RKSMBA -Name $SMB -AccountName "CREATOR OWNER" -Force
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___[ Building Linked Hybrid-DSC Tool Set ]____//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$DR = $URI
$DS = "$DR\$( $DSCShare.R00_Company )" | % { If ( ( Test-Path $_ ) -ne $True ) { NI $_ -ItemType Directory } Else { GI $_ } }
$Base = @( Collect-DSCRoot ).Tree
$Root = ( gci "$Base\Hybrid" ).FullName
Robocopy "$Base\Hybrid" "$DS" /E
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\__[ Create/Detect/Select Tool Subdirectory ]__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Building" "[+] Tools"
( 0 , "Drivers" ) , ( 1 , "DISM++" ) , ( 2 , "VM" ) | % {
"$DS\(1)Tools\($( $_[0] ))$( $_[1] )" | % { If ( ( Test-Path $_ ) -ne $True ) { NI $_ -ItemType Directory } Else { GI $_ } }
}
$Tools = @( gci "$DS\(1)Tools" ).FullName
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_[ Loading DISM++ The Most Powerful Utility ]_//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Set-Alias SZ "$( Extract-Archive )"
$Path = $Tools[1]
$Name = "DISM++"
Wrap-Action "Sourcing" "DISM++ ( The most powerful utility )"
[ System.Windows.Messagebox ]::Show( "This tool is only included as an option to use, should you agree to it's disclaimer.
It has since been replaced by the Windows Image Collection function" , "DISM++ Disclaimer" )
$DISM = @{
URI = "http://cdn.chuyu.me/Dism++10.1.1000.100_2d2bf466baca088c4b35248f5a7316f4e00cac0b.zip"
Outfile = "$Path\$Name.zip"
Hash = "3C5887911ABB2A3C47AC7F2D8B9E375583D1742BEAC57EBC3C64E6315218B6A5" }
$DISM | % { IWR -URI $_.URI -Outfile $_.OutFile
If ( ( Get-FileHash -Path $_.OutFile ).Hash -eq $_.Hash )
{ Wrap-Action "Checksum" "[+] $Name Validated" ; SZ x $_.OutFile -o"$Path" }
Else
{ Wrap-Action "Checksum" "[!] Not Valid, aborting $Name installation" }
RI $_.OutFile -Force
}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\______[ Loading Virtual Machine Tools ]_______//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Path = $Tools[2]
$Name = "VMWare-Tools"
$File = "VMware-tools-10.3.10-12406962"
$VMWare_x86 = @{
URI = "i386" | % {
"https://packages.vmware.com/tools/releases/10.3.10/windows/x86/$File-$_.exe" }
OutFile = "i386" | % { "$Path\$Name-$_.exe" }
Hash = "59A498CC1641A04C10D08709AC6DC6AA95CAFC7B56E6D613D3630E89083F0F4C" }
$VMWare_x64 = @{
URI = "x86_64" | % {
"https://packages.vmware.com/tools/releases/10.3.10/windows/x64/$File-$_.exe" }
OutFile = "x86_64" | % { "$Path\$Name-$_.exe" }
Hash = "65D5CC22D2FAE73F104E985BAA7885A1544ADCEB0774CC302522C03541E5DD82" }
( $VMWare_x86 , $VMWare_x64 ) | % {
Start-BitsTransfer -Source $_.URI -Destination $_.OutFile
If ( ( Get-FileHash -Path $_.OutFile ).Hash -eq $_.Hash )
{ Wrap-Action "Checksum" "[+] $Name x86/x64 Validated" }
Else
{ Wrap-Action "Checksum" "[!] Not Valid, removing file" ; RI $_.OutFile -Force }
}
$Name = "VirtualBox Guest Additions"
$File = "VBoxGuestAdditions_6.0.10.iso"
$Oracle = @{
URI = "https://download.virtualbox.org/virtualbox/6.0.10/$File"
OutFile = "$Path\$File"
Hash = "c8a686f8c7ad9ca8375961ab19815cec6b1f0d2496900a356a38ce86fe8a1325" }
$Oracle | % {
Start-BitsTransfer -Source $_.URI -Destination $_.OutFile
If ( ( Get-FileHash -Path $_.OutFile ).Hash -eq $_.Hash )
{ Wrap-Action "Checksum" "[+] $Name Validated" }
Else
{ Wrap-Action "Checksum" "[!] Not Valid, removing file" ; RI $_.OutFile -Force }
}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\________[ Loading Windows Images ]____________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Windows" "[+] Image Collection"
$Images = @( gci "$DS\(2)Images" ).FullName
$IMGTags = @( "DC2016" ; @( "E" , "H" , "P" | % { "$_`64" , "$_`86" } | % { "10$_" } ) )
$IMGTarget = @(
ForEach ( $i in 0..6 )
{
"$Images\($i)$( $IMGTags[$i] )" | ? {
If ( ( Test-Path $_ ) -ne $True ) { NI $_ -ItemType Directory } Else { GI $_ }
}
}
)
$MountDir = @( $IMGTarget | % { If ( ( Test-Path "$_\_" ) -ne $True ) { NI "$_\_" -ItemType Directory } Else { GI "$_\_" } } )
$IMGTarget | % { Echo $_ }
Wrap-Action "Image" "[+] Container Tree Generated"
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# [ Generate Windows Update Paths ]
$UPDTags = @( "Server" , 64 , 86 )
$UPDTarget = @(
ForEach ( $i in 0..2 )
{
"$Images\Updates\($i)x$( $UPDTags[$i] )" | ? { If ( ( Test-Path $_ ) -ne $True ) { NI $_ -ItemType Directory } Else { GI $_ } }
}
)
$UPDTarget | % { Echo $_ }
Wrap-Action "Windows Update" "[+] Container Tree Generated"
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# [ Clean Source ISO Path ]
$ISOTags = @( "1607" ; 64 , 86 | % { "1903_x$_" } )
$ISOTarget = @(
ForEach ( $i in 0..2 )
{
"$Images\ISO\($i)$( $ISOTags[$i] )" | ? { If ( ( Test-Path $_ ) -ne $True ) { NI $_ -ItemType Directory } Else { GI $_ } }
}
)
$ISOTarget | % { Echo $_ }
Wrap-Action "Clean Windows ISO" "[+] Container Tree Generated"
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# [ Download Clean ISO's from MS Directly ]
Wrap-Action "Initializing" "[~] Clean Windows ISO Retrieval directly from Microsoft"
[ Net.ServicePointManager ]::SecurityProtocol = [ Net.SecurityProtocolType ]::TLS12
IPMO BitsTransfer
$ISO = @( )
# Server Param Splat #
$xServer = @{ Source = "https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO"
Destination = "$( $ISOTarget[0] )\1607.ISO"
Description = "Windows Server ( 1607.ISO ) [ Evaluation Copy ]" }
$ISO += $xServer.Destination
$ClientSRC = "https://software-download.microsoft.com/sg/Win10_1903_V1_English_x64.iso?t=4b013732-a4e6-4a61-b157-cd460c5a2fef&e=1566239938"
# Client x64 Splat #
$x64 = @{ Source = "$ClientSRC&h=95d26323190ad7f86db73a02cdf1d7a9"
Destination = "$( $ISOTarget[1] )\1903x64.iso"
Description = "Windows Client ( 1903_x64.ISO )" }
$ISO += $x64.Destination
# Client x86 Splat #
$x86 = @{ Source = "$ClientSRC&h=eeb7f33eef37f2580cbe06248c868b7d"
Destination = "$( $ISOTarget[2] )\1903x86.iso"
Description = "Windows Client ( 1903_x86.ISO )" }
$ISO += $x86.Destination
ForEach ( $i in $xServer , $x64 , $x86 ) { Start-BitsTransfer @i }
Wrap-Action "Successful" "[+] Clean Windows ISO Retrieval Complete"
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# [ Variables to handle ISO -> WIM Export ]
Wrap-Action "Processing" "ISO -> WIM File Conversion"
$Drive = "$( "CDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray() | ? { $_ -notin ( ( Get-Volume ).DriveLetter | ? { $_ -ne $Null } ) } | Select -First 1 ):"
$SIP = "$Drive\Sources\Install.WIM"
$Dest = 0..6 | % { "$( $IMGTarget[$_] )\$( $IMGTags[$_] ).wim" }
$Tag = "Datacenter" , "Education" , "Home" , "Pro"
$Filter = @( "$( $Tag[0] )" ; 0..1 | % { $Tag[1..4] | % { "Windows 10 $_" } } )
$ID = @( "DC2016" ; @( "E" , "H" , "P" | % { "$_`64" , "$_`86" } | % { "10$_" } ) )
$IP = @( $ISO )[0,1,2]
$MSG = ForEach ( $i in 'Mounting' , 'Mounted' , 'Dismounting' , 'Dismounted' )
{ 0..2 | % { "Wrap-Action '$i' '$( $IP[$_] )'" } }
$M0 , $M1 , $D1 , $D0 = $MSG[0..2] , $MSG[3..5] , $MSG[6..8] , $MSG[9..11]
$Processing = 0..6 | % { "Wrap-Action 'Processing' '$( $Dest[$_] )'" }
$Complete = 0..6 | % { "Wrap-Action 'Successful' '$( $Dest[$_] )'" }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# [ Begin ISO -> WIM Export Process ]
ForEach ( $q in 0..6 )
{
If ( $q -eq 0 ) { $Server = 1 } If ( $q -eq 1 ) { $ClientX64 = 1 } If ( $q -eq 4 ) { $ClientX86 = 1 }
If ( $Server -eq 1 ) { IEX $M0[0] ; Mount-DiskImage -ImagePath $ISO[0] ; IEX $M1[0] }
If ( ( $q -eq 1 ) -and ( $Clientx64 -eq 1 ) ) { IEX $M0[1] ; Mount-DiskImage -ImagePath $ISO[1] ; IEX $M1[1] }
If ( ( $q -eq 4 ) -and ( $Clientx64 -eq 1 ) ) { IEX $M0[2] ; Mount-DiskImage -ImagePath $ISO[2] ; IEX $M1[2] }
If ( $q -eq 0 )
{
$x = 0
$Vice = $Filter[$q]
( Get-WindowsImage -ImagePath "$SIP" | ? { $_.ImageName -like "*$Vice*" } | ? { $_.ImageName -notlike "*Core*" } ) | % {
$Index = $_.ImageIndex ; $Name = $_.ImageName }
}
If ( $q -ne 0 )
{
If ( $q -eq 1 ) { $x = 1 } If ( $q -eq 2 ) { $x = 3 } If ( $q -eq 3 ) { $x = 5 }
If ( $q -eq 4 ) { $x = 2 } If ( $q -eq 5 ) { $x = 4 } If ( $q -eq 6 ) { $x = 6 }
$Vice = $Filter[$q]
( Get-WindowsImage -ImagePath "$SIP" | ? { $_.ImageName -eq "$Vice" } ) | % { $Index = $_.ImageIndex ; $Name = $_.ImageName }
}
$DIP = $Dest[$x]
IEX $Processing[$q] ; DISM /Export-Image /SourceImageFile:"$SIP" /SourceIndex:$Index /DestinationImageFile:$DIP /DestinationName:$Name
IEX $Complete[$q]
If ( $Server -eq 1 ) { IEX $D1[0] ; Dismount-DiskImage -ImagePath $ISO[0] ; IEX $D0[0] ; $Server = 0 }
If ( ( $q -eq 3 ) -and ( $Clientx64 -eq 1 ) ) { IEX $D1[1] ; Dismount-DiskImage -ImagePath $ISO[1] ; IEX $D0[1] ; $Client = 0 }
If ( ( $q -eq 6 ) -and ( $Clientx64 -eq 1 ) ) { IEX $D1[2] ; Dismount-DiskImage -ImagePath $ISO[2] ; IEX $D0[2] ; $Server = 0 }
}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# [ Display Results of WIM Extraction ]
$Filters = @( "ImageName" , "Architecture" , "Version" , "InstallationType" ; @( "Time" | % { "Created$_" , "Modified$_" } ) )
$List = 0..6 | % { Get-WindowsImage -ImagePath $Dest[$_] -Index 1 } | Select $Filters
$Arch = $List | % { If ( $_.Architecture -eq "0" ) { "x86" } Else { "x64" } }
Wrap-Title "Clean Windows Image ( WIM ) Storage List"
ForEach ( $i in 0..6 )
{
Wrap-Section "[ $( $List.ImageName[$i] ) ($( $Arch[$i])) ]" -In
Wrap-Item "[ Platform & Version ]" "$( $List.InstallationType[$i] ) @: v$( $List.Version[$i] )" -In
Wrap-Item " Original Release " "$( $List.CreatedTime[$i] ) " -Out
Wrap-Item " [ Provisioned Date ]" "[ $( $List.ModifiedTime[$i] ) ]" -In
Sleep -M 200
}
Wrap-Space -Out
Wrap-Space -In
Wrap-Foot
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\
# [ Inject Windows Updates into WIM Images ]
$Updates = @( 0 | % { $UPDTarget[0] } ; 1..3 | % { $UPDTarget[1] } ; 4..6 | % { $UPDTarget[2] } )
$WimFile = $Dest[0,1,3,5,2,4,6]
$MountPath = $MountDir[0,1,3,5,2,4,6].FullName
ForEach ( $i in 0..6 )
{
$Wim = $WimFile[$i]
$Type = "1/4 ] Mounting $Wim" , "2/4 ] Applying Windows Updates" , "3/4 ] Cleaning Component Store" , "4/4 ] Unmounting $Wim"
$Echo = 0..3 | % { "Wrap-Action '[ Image : $( $i + 1 )/7 ] [ Step' '$( $Type[$_] )'" }
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
IEX $Echo[0] ; DISM /Mount-WIM /WimFile:$( $WimFile[$i] ) /Index:1 /Mountdir:$( $MountPath[$i] )
IEX $Echo[1] ; DISM /Image:$( $MountPath[$i] ) /LogPath:AddPackage.log /Add-Package /PackagePath:"$( $Updates[$i] )\"
IEX $Echo[2] ; DISM /Image:$( $MountPath[$i] ) /Cleanup-Image /StartComponentCleanup /ResetBase
IEX $Echo[3] ; DISM /Unmount-WIM /MountDir:$( $MountPath[$i] ) /Commit
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
Wrap-Action "Image Complete" "[+] $( $WimFile[$i] ) Updated"
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\_____[ Application Names ]_# Collects Application_Information ________________\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Apps = @( gci $DS -Filter "*Applications" ).FullName
$Path = "chrome" , "silverlight" , "jre" , "libre" , "mwb" , "flash" , "air" , "reader" , "ccleaner" , "klite" , "tv"
0..10 | % { "$Apps\($_)$($Path[$_])" | % { If ( ( Test-Path $_ ) -ne $True ) { NI "$_" -ItemType Directory } Else { GI $_ } } }
# ____ _________________________________________________________________________________________________________________
#// \\______________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____[ Application Names ]________\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$N = @( @( "Google Chrome" , "Microsoft Silverlight" , "Java Runtime Environment" , "Libre Office Fresh" | % {
"$_ (x86)" , "$_ (x64)" } ) ; @( "Malwarebytes" ;
@( "Flash" , "Air" + @( "Reader DC" | % { "$_" ; "$_ MUI" } ) | % { "Adobe $_" } ) +
"CCleaner" , "K-Lite Codec Pack Full" , "Teamviewer 14" ) | % { "$_ (x22)" } )
# ____ _________________________________________________________________________________________________________________
#// \\______________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\____[ Application Versions ]______\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$V = @( 0..1 | % { "76.0.3809.87" } ; 0..1 | % { "5.1.50907.0" } ; 0..1 | % { "8.0.211" } ; 0..1 | % { "6.2.5" } ;
"3.8.3.296511270" ; "32.0.0.223" ; "32.0.0.125" ; "2019.012.20064" ; "2019.012.20035" ; "5.60.7307" ; "15.0.4" ; "14.4.2669" )
# ____ _________________________________________________________________________________________________________________
#// \\______________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\____[ Application URLs ]__________\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$U = @( @( "" , "64" | % {
"https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise$_.msi" } ) +
@( "" , "_x64" | % {
"https://download.microsoft.com/download/F/D/0/FD0B0093-DE8A-4C4E-BDC4-F0C56D72018C/50907.00/Silverlight$_.exe" } ) +
@( 7 , 9 | % {
"https://javadl.oracle.com/webapps/download/AutoDL?BundleId=23872$_`_478a62b7d4e34b78b671c754eaaf38ab" } ) +
@( ( "" , 86 ) , ( "_64" , 64 ) | % {
"https://download.documentfoundation.org/libreoffice/stable/6.2.5/win/x86$( $_[0] )/LibreOffice_6.2.5_Win_x$( $_[1] ).msi" } ) +
"https://downloads.malwarebytes.com/file/mb3/" ,
"https://download.macromedia.com/get/flashplayer/pdc/32.0.0.223/install_flash_player_32_plugin.msi" ,
"http://airdownload.adobe.com/air/win/download/32.0/AdobeAIRInstaller.exe" ,
"http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1901020064/AcroRdrDC1901020064_MUI.exe" ,
"http://ftp.adobe.com/pub/adobe/reader/win/AcrobatDC/1901220035/AcroRdrDCUpd1901220035_MUI.msp" ,
"https://download.ccleaner.com/ccsetup560.exe" ,
"https://files3.codecguide.com/K-Lite_Codec_Pack_1504_Full.exe" ,
"https://download.teamviewer.com/download/version_14x/TeamViewer_Setup.exe" )
# ____ _________________________________________________________________________________________________________________
#// \\______________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___[ Application File Names ]_____\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$F = @( @( "chrome" , "silverlight" , "jre" , "libre" | % { "$_(x86)" , "$_(x64)" } ) ;
@( "mwb" ; @( "flash" , "air" + @( "reader" | % { "$_" ; "$_`mui" } ) ) + "ccleaner" , "klite" , "tv" ) | % { "$_(x22)" } )
$X = @( "msi" , "exe" , "msp" )[0,0,1,1,1,1,0,0,1,1,1,1,2,1,1,1]
$P = @( gci "$( $R[1] )\$( $R[0] )\(5)Applications" ).Fullname
$P = $P[0,0,1,1,3,3,4,4,5,6,7,8,8,9,10,2]
# ____ _________________________________________________________________________________________________________________
#// \\______________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\__[ Application Hash Values ]_____\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\
$S = "28F18228B074991FA9482873898BC9146527B539E08D38A75035CC9D8E6E5E83" , # [ Google Chrome x86 ] //¯¯\\__//¯¯\\__//
"2001F5F7A1BB25268E74045A119302812DB2643B7EF47C5E7A52D65A51FDAC84" , # [ Google Chrome x64 ] \\__//¯¯\\__//¯¯\\
"88e1b76bdf799478a72fa27db0bfe7bc5d02cc7e53675967399300448f0e266f" , # [ Silverlight x86 ] //¯¯\\__//¯¯\\__//
"8d263a6f42a378073b6f057f242a42076f9f4082340153c2e27ecc959c5036aa" , # [ Silverlight x64 ] \\__//¯¯\\__//¯¯\\
"47DE97325B8EA90EA9F93E1595CC7F843DA0C9C6E4C9532ABEA3A194CFB621D9" , # [ Java x86 ] //¯¯\\__//¯¯\\__//
"C18CF8F2776B69DC838440AADFAAE36F50717636F38EEC5F1E4A27A8CB4F20FB" , # [ Java x64 ] \\__//¯¯\\__//¯¯\\
"717fb9e17a3feb8af1662e668b919db86fab343303b78f88c7859003056ee010" , # [ Libre x86 ] //¯¯\\__//¯¯\\__//
"9b01f6f382dbb31367e12cfb0ad4c684546f00edb20054eeac121e7e036a5389" , # [ Libre x64 ] \\__//¯¯\\__//¯¯\\
"EE34F7A2ECD40039738861FD331FF9D9C5320A33D61B62AE71E108B78F999892" , # [ Malwarebytes x22 ] //¯¯\\__//¯¯\\__//
"ee34f7a2ecd40039738861fd331ff9d9c5320a33d61b62ae71e108b78f999892" , # [ Adobe Flash x22 ] \\__//¯¯\\__//¯¯\\
"6718308E10A45176155D0ECC8458BD3606308925B91F26A7D08C148CF52C9DB3" , # [ Adobe Air x22 ] //¯¯\\__//¯¯\\__//
"81953f3cf426cbe9e6702d1af7f727c59514c012d8d90bacfb012079c7da6d23" , # [ Adobe Reader DC x22 ] \\__//¯¯\\__//¯¯\\
"67AAB19943FA63393F15E1354FACCE65BED476D1C2BB5D311DB8450614A33200" , # [ Adobe Reader DC MUI/Update x22 ] //¯¯\\__//¯¯\\__//
"00be05f95e08eb4f181ccde15403e782150a616cb93fd74525c99920f53a2cea" , # [ CCleaner x22 ] \\__//¯¯\\__//¯¯\\
"1F6BDE89E752811FDC04492D0F73216720B625E54966B3E350659BABD9AD7A83" , # [ K-Lite Codec Pack x22 ] //¯¯\\__//¯¯\\__//
"df26627cc29716b65a3ed72f78d59808244f9bc4ad2624657ddbee79d2baa422" # [ Teamviewer 14 x22 ] \\__//¯¯\\__//¯¯\\
#\\__________________________________________________________________________________________________________________________________//¯¯\\__//¯¯\\__//
$Item = @{ }
0..15 | % { $Item[$_] = @{ Name = "$( $N[$_] ) v$( $V[$_] )"
File = "$( $P[$_] )\$( $F[$_] ).$( $X[$_] )"
URL = "$( $U[$_] )"
Sum = "$( $S[$_] )" } }
Export-Ini -Path $Apps -Name "List.ini" -Value $Item -Encoding UTF8 -Force
# ____ _________________________________________________________________________________________________________________
#// \\______________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____[ Application Review ]_______\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Applications" "[~] Make Selection"
Switch( $Host.UI.PromptForChoice( "Application Template Review" , "Review Designated Application Template ?" ,
[ System.Management.Automation.Host.ChoiceDescription [] ]@( '&Yes' , '&No' ) , [ Int ] 0 ) )
{
0 { Wrap-Action "Reviewing" "[~] Application Template"
$j = 0
$Item | % {
" ____ ____ " ,
" //¯¯\\________________________________________________________________________________________________________________________//¯¯\\ " ,
" \\__// \\__// " ,
" ¯¯¯\\___ [ Program # $( If ( $j -lt 10 ) { "$J " } Else { "$J" } ) ] $( "____" * 25 )//¯¯\\" ,
"" ,
" [ $( $_.Name ) ]" ,
"" ,
" Download String : $( $_.URL )" ,
" OutFile : $( $_.File )" ,
" Hash Checksum : $( $_.Sum )" ,
"" | % { Echo $_ }
Sleep -M 200
$j++
}
Read-Host "Press Enter to Continue" }
1 { Wrap-Action "Skipping" "[~] Application Template Review" }
}
# ____ _________________________________________
#// \\______________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____[ Download-Applications ] Downloads Applications like a fricken boss or somethin' ¯\_(ツ)_/¯ _____//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Downloading" "[+] Application Template"
IPMO BITSTransfer
[ Net.ServicePointManager ]::SecurityProtocol = [ Net.SecurityProtocolType ]::TLS12
$Total = [ System.Diagnostics.Stopwatch ]::StartNew()
$Time = @( 0..15 )
0..15 | % {
If ( ( Test-Path $Item[$_].File ) -ne $True )
{
Wrap-Action "Downloading" "$( $Item[$_].Name )"
$Time[$_] = [ System.Diagnostics.Stopwatch ]::StartNew()
$Item[$_] | % { Start-BitsTransfer -Source $_.URL -Destination $_.File -Description $_.Name -EA SilentlyContinue
If ( $? -eq $False ) { IWR -Uri $_.URL -OutFile $_.File } }
$Time[$_].Stop()
If ( ( Test-Path $Item[$_].File ) -ne $True ) { Wrap-Action "Exception" "[!] $( $Item[$_].Name ) Failed" ; $Check = "No" }
Else
{
If ( ( Get-FileHash -Path $Item[$_].File -Algorithm SHA256 ).Hash -eq $Item[$_].Sum ) { $Check = "Yes" }
Else { Wrap-Action "Checksum" "[!] $( $Item[$_].Name ) Failed" ; RI $Item[$_].File -Force -VB ; $Check = "No" }
}
If ( $Check -eq "Yes" )
{
$ITime = $Time[$_].Elapsed
$ILength = ( gp $Item[$_].File ).Length
$ISize = "$( $ILength / 1MB | % { "{0:n1}" -f $_ } )"
$IRate = ( $ILength / ( $ITime | % { ( $_.Minutes * 60 ) + ( $_.Seconds ) } ) / 1MB ) | % { "{0:n1}" -f $_ }
}
If ( $Check -eq "No" )
{
$ITime , $ILength , $ISize , $IRate = 0..3 | % { "N/A" }
}
Wrap-Title "Item #$( $_ + 1 ) Download Statistics"
Wrap-Section "[ $( $Item[$_].Name ) ]" -In
Wrap-Item "Time" "$ITime" -In
Wrap-Item "Size" "$ISize MB" -Out
Wrap-Item "Rate" "$IRate MB/S" -In
Wrap-Item "Hash" "Passed? ( $Check )" -Out
Wrap-Space -In
Wrap-Foot
}
}
$Total | % { $_.Stop() ; $T = $_.Elapsed }
$Size = @( gci $Apps -Recurse -File | Select Length | % { $_.Length } | Measure -Sum ).Sum
$Rate = ( ( $Size / 1MB ) / ( ( $T.Minutes * 60 ) + ( $T.Seconds ) ) | % { "{0:n3}" -f $_ } )
Wrap-Action "Downloads Complete" "[+] Time: $( $T ) / Size: $( $Size/1GB | % { "{0:n3}" -f $_ } ) GB / AVG-Rate @: $Rate MB/S ]"
# ____ _________________________________________
#// \\______________________________________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_______[ Deploy and automatically configure a BITS/IIS Website for this MDT share ]___________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "BITS/IIS" "[~] Make Selection"
Switch( $Host.UI.PromptForChoice( "Deploy BITS/IIS Website" , "Deploy BITS Auto-Configuration / Website ?" ,
[ System.Management.Automation.Host.ChoiceDescription [] ]@( '&Yes' , '&No' ) , [ Int ] 0 ) )
{
0 { Wrap-Action "Initializing" "[~] Deployment Server Website"
$SD , $Sys32 , $SRV = $ENV:SystemDrive , "$ENV:SystemRoot\System32" , $ENV:ComputerName
$R = @( $DSCShare ).Values
$Root = "$SD\inetpub\$( $R[19] )"
$Full = "IIS:\Sites\$( $R[19] )\$( $R[21] )"
$IS = [ Ordered ]@{
System = [ Ordered ]@{
Drive = $ENV:SystemDrive
Name = $ENV:ComputerName }
Site = [ Ordered ]@{
Name = $R[19]
Pool = $R[20]
VHost = $R[21]
Root = $Root
AppData = "$Root\AppData"
PSPath = $Full }
Config = [ Ordered ]@{
AppHost = "Machine/Webroot/AppHost"
WebServer = "system.webServer"
SecAuth = "security/authentication"
AutoStart = "ServerAutoStart"
Static = "StaticContent" }
Format = [ Ordered ]@{
Date = ( Get-Date -UFormat "%m-%d-%Y" )
Log = "$Home\Desktop\ACL" }
}
$IIS = @( $IS | % { $_.System , $_.Site , $_.Config , $_.Format } ).Values
$IIS[5,6] | % { If ( ( Test-Path $_ ) -eq $True ) { RI $_ -Recurse } ; NI $_ -ItemType Directory }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\________________[ Services ]__________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$Web = @( "Web-Server" ; # Installs the base Web Server functions ... ( $SE = Self Explanatory )
"DSC-Service" ; # Installs the Desired State Configuration Service
"FS-SMBBW" ; # Updates the file system to allow for Samba Bandwidth to be differentially allocated
"ManagementOData" ; # Creates an ASP.NET Web Service end point that exposes your management data ( Raw Doggin' it )
"WindowsPowerShellWebAccess" ; # Allows for access to PS API over the web. Falls under $SE
"WebDAV-Redirector" ; # Allows for Web Server to use reverse/forward proxies, useful for security AND trolling people
@( "BITS" | % { "$_" ; # Background Intelligent Transfer Service - Sends/Receives files without being annoying
"$_-IIS-Ext" ; # Extension for BITS to be used in Internet Information Services
"RSAT-$_-Server" } ) ; # Allows for the remote administration of BITS, but in a less cool way than RDP
@( "Net" | % { "$_-Framework-45-ASPNET" ; # It's what you need to run any ASP.Net webpage or application in IIS
"$_-WCF-HTTP-Activation45" } ) ; # It's the Windows Communication Foundation's way of trying to remain relevant ( Like Netscape )
@( @( "App-Dev" ; # Application Development Module for IIS/Web
"AppInit" ; # Initializes any WPF/C#/ASP applications for instance, MVC, or what have you.
"Asp-Net45" ; # Another Module for ASP
"Basic-Auth" ; # Allows for authentication that could be considered 'Basic'
"Common-Http" ; # A bunch of functions that the 'machine/operating system' converts into 'stuff you see'
"Custom-Logging" ; # Allows for customized logging of whatever happens on your web server
"DAV-Publishing" ; # Publishes WebDAV modules to use/distribute to other machines/systems
"Default-Doc" ; # Falls under $SE
"Digest-Auth" ; # More advanced than Basic authentication ? But still pretty fricken basic...
"Dir-Browsing" ; # Allows any authenticated user to browse the contents of the web directory
"Filtering" ; # Mime Types and things of that nature
"Health" ; # If you don't understand how $SE this is..? Go outside. Stop trying to program or read scripts.
@( "HTTP" | % { "$_-Errors" ; # Falls under the above entry
"$_-Logging" ; # Also falls under that same entry
"$_-Redirect" ; # Works with WebDAV to keep people on the outside guessing what the hell is happening ( Like 404/403 )
"$_-Tracing" } ) ; # Like tracert but for 'tracking the IP addresses attempting to access the site'
"Includes" ; # It allows static content to be more dynamic, without messing up the content
@( "ISAPI" | % { "$_-Ext" ; # APPCMD.EXE ... and WebConfig, basically.
"$_-Filter" } ) ; # Allows Turtle Power or VBScript to look through the content of WebConfig data. Similar to XML.
"Log-Libraries" ; # Pretty $SE if you ask me
"Metabase" ; # Like a database, but for business or server side analytics... It's like CEIP for IIS.
"Mgmt-Console" ; # Also rather $SE
"Net-Ext45" ; # Yet another extension for ASP.Net 4.5 to work with in IIS. Probably for turning C # into 'pseudo html'
"Performance" ; # $SE continued
"Request-Monitor" ; # An analytical logbook that specifically logs SSI requests, pretty sure anyway
"Security" ; # What every website should use, but, may not unless you've studied how to use it
"Stat-Compression" ; # Takes statistics and zips em up. Like a fricken boss or somethin' . . .
"Static-Content" ; # Works with Web-Includes
"Url-Auth" ; # Similar to when you log into Gmail
"WebServer" ; # The service that is nearly an exact replica of Apache
"Windows-Auth" ) | % { "Web-$_" } ) ; # Allows the WebSite to use NTLM/Kerberos authentication ( Most Secure )
@( "WAS" | % { "$_" ; # Series of services that takes HTTP and says "You don't need HTTP. You can use whatever we tell
"$_-Process-Model" ; # you to use, cause that's what Windows Process Activation Services means, it's just turning
"$_-Config-APIs" } ) ) # HTML into XML and vice versa. Like $Magic = "David" | % { "$_ Blaine" ; "$_ Copperfield" }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___________[ Install Features ]_______________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Checking" "[~] Windows Features"
Get-WindowsFeature | ? { $_.Name -in $Web } | Select Name , InstallState | ? { $_.InstallState -ne "Installed" } | % {
Wrap-Action "Missing Feature" "[~] Installing $( $_.Name )"
Install-WindowsFeature -Name $_.Name }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___________[ Generate Website ]_______________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Loading" "[~] WebAdministration Module"
IPMO WebAdministration
Get-Website -Name "Default Web Site" -EA 0 | ? { $_.Name -ne $Null -and $_.State -eq 'Started' } | % {
Stop-Website | SP IIS:\Sites\$( $_.Name ) ServerAutoStart False }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___________[ Enable Services ]________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
"MRxDAV" , "WebClient" | % { Get-Service -Name $_ -EA 0 } | % { If ( $_.Status -ne "Running" )
{ Set-Service -StartupType Automatic -EA 4 -Status Running -Name $_ ; Wrap-Action $_.Name "[+] Service is now Active / Running" }
Else { Wrap-Action $_.Name "[+] Service was already Active" } }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\____________[ Create SitePool ]_______________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
If ( ( Get-IISAppPool -Name $IIS[3] ) -ne $Null )
{ Wrap-Action "Removing" "[!] Prior Application Pool" ; Remove-WebAppPool -Name $IIS[3] }
New-WebAppPool -Name $IIS[3] -Force
Wrap-Action "Configuring" "[~] Application Pool Settings"
$SP = ( "Enable32BitAppOnWin64" , "True" ) , ( "ManagedRuntimeVersion" , "v4.0" ) , ( "ManagedPipelineMode" , "Integrated" )
$SP | % { SP -Path "IIS:\AppPools\$( $IIS[3] )" -Name $_[0] -Value $_[1] }
Restart-WebAppPool -Name $IIS[3]
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\____________[ Start-Website ]_________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
If ( ( Get-WebSite -Name $IIS[2] ) -ne $Null ) { Wrap-Action "Removing" "[!] Prior Website" ; Remove-Website -Name $IIS[2] }
New-Website -Name $IIS[2] -ApplicationPool $IIS[3] -PhysicalPath $IIS[5] -Force
Wrap-Action "Generated" "[+] IIS Web Site $( $IIS[2] )"
Start-Website -Name $IIS[2]
Wrap-Action "Started" "[+] IIS Web Site $( $IIS[2] )"
Set-WebBinding -Name $IIS[2] -HostHeader "" -PropertyName "HostHeader" -Value "$( $R[23] )"
Wrap-Action "HostHeader" "[+] $( $R[23] )"
New-WebVirtualDirectory -Site $IIS[2] -Name $IIS[4] -PhysicalPath $R[16] -Force
Wrap-Action "Virtual Directory" "[+] http://$( $R[23] )"
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___________[ Configure Website ]______________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Configuring" "[~] WebDAV Authoring"
$SP = $IIS[8] , $IIS[2] , "$( $IIS[9] )/webdav/authoring" , "Enabled" , "True"
Set-WebConfigurationProperty -PSPath $SP[0] -Location $SP[1] -Filter $SP[2] -Name $SP[3] -Value $SP[4]
Wrap-Action "Generating" "[~] WebDAV Authoring Rules"
"Set Config '$( $IIS[2] )/$( $IIS[4] )'" , "/Section:$( $IIS[9] )/webdav/authoringRules" ,
"/+[Users='*',Path='*',Access='Read,Source']" , "/Commit:AppHost" -join ' ' | % {
SAPS ( gci "$Sys32\inetsrv" "*appcmd.exe" ).FullName -Args $_ -NoNewWindow -PassThru | Out-Null }
$STC = $IIS[9,12] -join '/' ; $GWCP = ( Get-WebConfigurationProperty -PSPath $Full -Filter $STC -Name "." ).Collection
If ( ! ( $GWCP | ? { $_.fileExtension -eq ".*" } ) )
{ Add-WebConfigurationProperty -PSPath $Full -Filter $STC -Name "." -Value @{ fileExtension = '.*' ; mimeType = 'Text/Plain' }
Wrap-Action "Web Config" "[+] [ fileExtension: '.*' ] / [ mimeType: 'Text/Plain' ]" }
Wrap-Action "Enabling" "[+] Directory Browsing"
$SP = "/$( $IIS[9] )/DirectoryBrowse" , "Enabled" , $Full , $True
Set-WebConfigurationProperty -Filter $SP[0] -Name $SP[1] -PSPath $SP[2] -Value $SP[3]
$Path = @( @( $IIS[9,10] -join "/" ) * 2 ;
@( $IIS[9] , "webdav/authoring" -join '/' ) * 3 ;
@( $IIS[9] , "security/requestFiltering" -join '/' ) * 4 )
$Leaf = @( "anonymous" , "windows" | % { "/$_`Authentication" } ; "Rules" ;
@( "/properties" ) * 2 ; @( "/fileExtensions" ) * 2 ; @( "/verbs" ) * 2 )
$SP = @{
PSPath = @( $IIS[8] ) * 9
Location = @( "$( $IIS[2] )" | % { "$_/" , "$_/$( $IIS[4] )" , "$( $IIS[2] )" } )[1,1,0,1,2,1,0,1,0]
Filter = 0..8 | % { "$( $Path[$_] )$( $Leaf[$_] )" }
Name = @( @( "enabled" ) * 2 ; "defaultMimeType" ; @( "allowInfinitePropfindDepth" ) * 2 ; @( "applyToWebDAV" ) * 4 )
Value = @( "False" ; "True" ; "Text/XML" ; @( "True" ) * 2 ; @( "False" ) * 4 ) }
0..8 | % { $IX = @{ PSPath = $SP.PSPath[$_]
Location = $SP.Location[$_]
Filter = $SP.Filter[$_]
Name = $SP.Name[$_]
Value = $SP.Value[$_] }
Wrap-Title "Setting WebConfiguration #$( $_ + 1 )"
Wrap-Space -Out
Wrap-Item "Location" "$( $IX.Location )" -In
Wrap-Item "Filter" "$( $IX.Filter )" -Out
Wrap-Item "Name" "$( $IX.Name )" -In
Wrap-Item "Value" "$( $IX.Value )" -Out
Wrap-Space -In
Wrap-Foot
Set-WebConfigurationProperty @ix
}
#Wrap-Action "Restarting" "[~] IIS Service"
#IISRESET /Stop
#Wrap-Action "Configuring" "[~] Security Request Filtering for WebDAV"
#$SP = "$( $IIS[9] )/security/requestFiltering" ; $HS = "hiddenSegments" ; $ATWD = "applytoWebDAV"
#( Get-IISConfigSection | ? { $_.SectionPath -like "*$SP*" } | Get-IISConfigElement -ChildElementName $HS ) | % {
#Set-IISConfigAttributeValue -ConfigElement $_ -AttributeName "applytoWebDAV" -AttributeValue $False }
#IISRESET /Start
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_________[ Configure Access Control ]_________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Access Control" "[~] Configuring SAM / Access Control Permissions"
'IIS_IUSRS', 'IUSR', "IIS APPPOOL\$( $IIS[3] )" | % {
$ACL = New-AclObject -SAM $_ -Rights 'ReadAndExecute' -Inherit 'ContainerInherit' , 'ObjectInherit'
Add-Acl -Path $IIS[5] -ACL $ACL }
'IIS_IUSRS', "IIS APPPOOL\$( $IIS[3] )" | % {
$ACL = New-AclObject -SAM $_ -Rights 'Modify' -Inherit 'ContainerInherit' , 'ObjectInherit'
Add-Acl -Path $IIS[6] -ACL $ACL }
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____________[ SSL/TLS Rules ]________________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Configuring" "[~] Registry Settings for [ SSL 2.0 / 3.0 ] & [ TLS 1.0 / 1.1 / 1.2 ]"
$SSLTLS = "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols"
$Types = "Client" , "Server"
$Value = @( @( "0" ) * 8 ; @( "1" ) * 2 )
$Protocols = @( 2..3 | % { "SSL $_.0" } ) + @( 0..2 | % { "TLS 1.$_" } )
$Protocols | % {
$Path = "$SSLTLS\$_" ; If ( ( Test-Path $Path ) -ne $True ) { NI "$SSLTLS" "$_" }
$Types | % { If ( ( Test-Path "$Path\$_" ) -ne $True ) { NI "$Path" "$_" } }
}
$Path = @( $Protocols | % { "$SSLTLS\$_\Client" ; "$SSLTLS\$_\Server" } )
0..( $Path.Count - 1 ) | % {
If ( ( gci $Path ) -eq $Null )
{
SP -Path $Path[$_] -Name "DisabledByDefault" -Type DWORD -Value 0
SP -Path $Path[$_] -Name "Enabled" -Type DWORD -Value $Value[$_]
}
}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\________[ .Net Framework TLS Rules ]__________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Configuring" "[~] .Net Framework [ v2.0.50727 ] & [ v4.0.30319 ] SCHANNEL Policies"
$NetFW = "" , "\WOW6432NODE" | % { "HKLM:\SOFTWARE$_\Microsoft\.NETFramework" }
ForEach ( $i in $NetFW )
{
"v2.0.50727" , "v4.0.30319" | % {
If ( ( Test-Path $i ) -ne $True )
{ NI -Path $i -Name "$_" }
SP -Path $i -Name "SystemDefaultTlsVersions" -Type DWORD -Value 1
}
}
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\________[ Create DNS CName Record ]___________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Pausing" "[~] Website to Add DNS CName Resource Record"
Stop-Website $IIS[2]
$DNS = "$ENV:Computername.$ENV:UserDNSDomain" , $IIS[2] , $ENV:UserDNSDomain
( Get-DNSServerResourceRecord -ZoneName $DNS[2] | ? { $_.HostName -eq $IIS[2] -and $_.RecordType -eq "CNAME" } ) | Select HostName | % {
Remove-DNSServerResourceRecord -ZoneName $DNS[2] -Name $_.HostName -RRType CNAME -Force }
Add-DnsServerResourceRecordCName -HostNameAlias $DNS[0] -Name $DNS[1] -ZoneName $DNS[2]
Wrap-Action "Resuming" "[+] Website $( $IIS[2] )"
Start-Website $IIS[2]
Wrap-Action "Complete" "[+] Your Web Server should now be available to the internet"
start "http://$( $R[23] )"
Wrap-Action "Warning" "[!] You may want to configure SSL Certificates for this server"
Read-Host "Automatic Certificate Chain creation and distribution will be an added feature in the future"
}
1 { Wrap-Action "Skipping" "[~] WebSite Creation" } }
Return @( $DSCShare ).Values
}
Else { Wrap-Action "Exception" "Either the user cancelled or the dialogue failed" }
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Get-Provisionary # Collects Hybrid-DSC Deployment Share Information ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
Return @( Collect-DSCShare )
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Get-WIMName # Retrieves the name of a given Windows Image File ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , ValueFromPipeline = $True ) ][ String ] $IP ,
[ Parameter ( Position = 1 , ValueFromPipeline = $True ) ][ String ] $ID )
( Get-WindowsImage -ImagePath $IP ).ImageName
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Get-WIMBuild # Retrieves the build version number from said WIM ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , ValueFromPipeline = $True ) ][ String ] $IP ,
[ Parameter ( Position = 1 , ValueFromPipeline = $True ) ][ String ] $ID )
( Get-WindowsImage -ImagePath $IP -Index $ID ).Version
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Import-NewOSImage # Imports an WIM/Operating System into MDT ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , ValueFromPipeline = $True ) ][ String ] $IP ,
[ Parameter ( Position = 1 , ValueFromPipeline = $True ) ][ String ] $SF ,
[ Parameter ( Position = 2 , ValueFromPipeline = $True ) ][ String ] $DF )
Import-MDTOperatingSystem -Path $IP -SourceFile $SF -DestinationFolder $DF -Move -VB
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Import-NewTask # Imports a dynamic task sequence ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
[ CmdLetBinding () ] Param (
[ Parameter ( Position = 0 , ValueFromPipeline = $True ) ][ String ] $PSP ,
[ Parameter ( Position = 1 , ValueFromPipeline = $True ) ][ String ] $Name ,
[ Parameter ( Position = 2 , ValueFromPipeline = $True ) ][ String ] $XML ,
[ Parameter ( Position = 3 , ValueFromPipeline = $True ) ][ String ] $Info ,
[ Parameter ( Position = 4 , ValueFromPipeline = $True ) ][ String ] $ID ,
[ Parameter ( Position = 5 , ValueFromPipeline = $True ) ][ String ] $Ver ,
[ Parameter ( Position = 6 , ValueFromPipeline = $True ) ][ String ] $SIP ,
[ Parameter ( Position = 7 , ValueFromPipeline = $True ) ][ String ] $User ,
[ Parameter ( Position = 8 , ValueFromPipeline = $True ) ][ String ] $Pro ,
[ Parameter ( Position = 9 , ValueFromPipeline = $True ) ][ String ] $WWW ,
[ Parameter ( Position = 10 , ValueFromPipeline = $True ) ][ String ] $Pass )
Import-MDTTaskSequence -Path $PSP -Name $Name -Template $XML -Comments $Info -ID $ID -Version $Ver `
-OperatingSystemPath $SIP -FullName $User -OrgName $Pro -HomePage $WWW -AdminPassword $Pass -VB
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Collect-LocalMachine # Turns local machine info into an array ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
Return @( $Env:ComputerName ; $Env:Processor_Architecture ; "$Env:SystemDrive\" ;
@( $Env:SystemRoot | % { "$_" , "$_\System32" } ) ; $Env:ProgramData ; $Env:ProgramFiles )
}
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
Function Provision-Imaging # A version of Image Factory that doesn't suck ¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
{
Wrap-Action "[ Provision-Imaging ]" "[+] Retrieves DSC Info and Recycles Images and Task Sequences"
$R = @( Collect-DSCShare )
$LM = @( Collect-LocalMachine )
$Tree = "Resources" , "Tools" , "Images" , "Profiles" , "Certificates" , "Applications"
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____[ BITS Check & Variable Allocation ]_____//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
If ( $LM[0] -eq $R[2] ) { $DR , $SRV = $R[16] , "[ Yes ]" } Else { $DR , $SRV = $R[1] , "[ No ]" }
$DS = "$DR\$( $R[0] )"
$D , $P = @( )
@( gci $DS -EA 0 ) | % { $D += @( $_.FullName ) ; $P += @( "$( $LM[2] + $R[0] )\$( $_.Name )" ) }
$L = @( 0..5 | % { If ( ( Test-Path $P[$_] ) -ne $True ) { NI $P[$_] -ItemType Directory } Else { GI $P[$_] } } ).FullName
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\___________[ Stage MDT Variables ]____________//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Load-MDTModule
$SC = "Server" , "Client" ; $Drive = ( $R[17] )
$M = @( "MDTProvider" ; $Drive ; "Administrators" ;
@( $SC | % { "$( $Drive ):\Operating Systems\$_" } ) +
@( $SC | % { "$( $Drive ):\Task Sequences\$_" } ) +
"$( $R[16] )" ; "$( $R[1].Split('\')[-1] )" ; "$( $R[1] )" ;
@( "Boot" ; ( $SC | % { "Operating Systems\$_" } ) + "Scripts" ; "Control" ) | % { "$DR\$_" } ; "$( $R[0] ) $( $R[18] )" )
NDR -Name $M[1] -PSProvider $M[0] -Root $M[7] -Description $M[15] -NetworkPath $M[9] -VB | Add-MDTPersistentDrive
# ____ _________________________________________________________________________________________________
#// \\______________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# \\_____[ Echo Provisionary Root Variables ]_____//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//__\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Title "Provisional-Root"
Wrap-Section "[ Domain State Controller @ Source ]" -In
$Type = @( "Provisionary" ; "( DSC ) Share" ; "( DSC ) Controller" ; "Resources" ; "Tools" ; "Images" ; "Profiles" ; "Certificates" ; "Applications" )
$Info = @( $R[0..2] ; $D[0..5] )
0..8 | % { If ( $_ % 2 -ge 1 ) { Wrap-Item $Type[$_] $Info[$_] -Out } Else { Wrap-Item $Type[$_] $Info[$_] -In } }
Sleep -M 250
Wrap-Section "[ Current Machine @ Variables ]" -In
$Type = @( "Server" ; "Hostname" ; "Architecture" ; "System Drive" ; "Windows Root" ; "System32" ; "Program Data" )
$Info = @( $SRV ; $R[2] ; $LM[1..5] )
0..6 | % { If ( $_ % 2 -ge 1 ) { Wrap-Item $Type[$_] $Info[$_] -Out } Else { Wrap-Item $Type[$_] $Info[$_] -In } }
Sleep -M 250
Wrap-Section "[ Provision Index @ Bridge Control ]" -In
$Type = @( "( DSC ) Target" ; @( $Tree[0..5] ) )
$Info = @( $LM[0] ; $L[0..5] )
0..6 | % { If ( $_ % 2 -ge 1 ) { Wrap-Item $Type[$_] $Info[$_] -Out } Else { Wrap-Item $Type[$_] $Info[$_] -In } }
Sleep -M 250
Wrap-Section "[ Company / Provisionary / Support Details ]" -In
$Type = @( "Name" , "Website" , "Phone" , "Hours" , "Logo" , "Background" | % { "Company $_" } )
$Info = @( $R[0] ; $R[5..9] )
0..5 | % { If ( $_ % 2 -ge 1 ) { Wrap-Item $Type[$_] $Info[$_] -Out } Else { Wrap-Item $Type[$_] $Info[$_] -In } }
Wrap-Space -In ; Wrap-Foot ; Read-Host "Validate this information. Press 'Enter' to Continue"
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\_________[ Collects Hybrid-DSC Deployment Share Information ]_____________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Provision" "[~] Images"
$DI = $d[2]
$DT = @( $SC | % { "$DR\Operating Systems\$_" } | % { If ( ( Test-Path $_ ) -ne $True ) { NI $_ -ItemType Directory } Else { GI $_ } } ).FullName
$Date = "$( Get-Date -UFormat "%Y%m%d" )" , "( $( Get-Date -UFormat "%m-%d-%Y" ) MC-SDP )"
$Tag = @( "DC2016" ; @( "E" , "H" , "P" | % { "$_`64" ; "$_`86" } | % { "10$_" } ) )
$NA = "Not Detected"
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\_________[ Collects DISM Imaging Information ]____________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
$WIM = @{
Name = @( @( "Server 2016 Datacenter (x64)" ;
@( "Education" , "Home" , "Professional" | % { "$_ (x64)" ; "$_ (x86)" } | % { "10 $_" } ) ) | % { "Windows $_" } )
Tag = @( "DC2016" ; @( "E" , "H" , "P" | % { "$_`64" ; "$_`86" } | % { "10$_" } ) )
Sign = @( 0..6 | % { "$( $Date[1] ) [ $( $Tag[$_] ) ]" } )
Build = @( 0 | % { "10.0.14393.2273" } ; 1..6 | % { "10.0.18362.239" } )
Major = @( 0 | % { "1607" } ; 1..6 | % { "1903" } )
Minor = @( 0 | % { "(2273)" } ; 1..6 | % { "(239)" } ) }
$Stamp = @( 0..6 | % { "$( $WIM.Build[$_] ) [ $( $WIM.Major[$_] ) ]" } )
$DISM = @( 0..6 )
0..6 | % { $DISM[$_] = $Tag[$_] , $WIM.Name[$_] , $WIM.Sign[$_] , $Stamp[$_] , $R[0] }
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\____________[ Checks/loads backend WIM files ]____________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "DISM" "[+] WIM Store"
$StoreWIM = @( GCI $DI -Filter "*.wim" -Recurse -EA 0 )
If ( $StoreWIM.Count -eq 0 ) { $Store = @{ Name = $NA ; File = $NA ; Tag = $NA ; Path = $NA ; Date = $NA ; Full = $NA ; Build = $NA } }
Else {
$Store = @( ) ;
$Store += $StoreWIM | Select @{ Name = "Name" ; Expression = { Get-WIMName -IP $_.FullName } } ,
@{ Name = "File" ; Expression = { $_.Name } } ,
@{ Name = "Tag" ; Expression = { $_.BaseName } } ,
@{ Name = "Path" ; Expression = { $_.DirectoryName } } ,
@{ Name = "Date" ; Expression = { $_.LastWriteTime } } ,
@{ Name = "Full" ; Expression = { $_.FullName } } ,
@{ Name = "Build" ; Expression = { Get-WIMBuild -IP $_.FullName -ID 1 } } }
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\_________[ Displays backend WIM File Statistics and Information ]_________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Title "Stored-WIM(S)"
ForEach ( $i in $Store )
{ Wrap-Section "[ $( $i.Name ) ]" -In
Wrap-Item "[+] Path " $i.Path -In
Wrap-Item "[+] File " $i.File -Out
Wrap-Item "[+] Date " $i.Date -In
Wrap-Item "[+] Build" $i.Build -Out
Wrap-Space -In
Sleep -M 250 }
Wrap-Foot
Read-Host "Verify list. Press Enter to Continue"
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\_________[ Checks/loads frontend MDT Server WIM files ]___________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "MDT" "[+] Server WIM"
$SWIM = @( GCI $DT[0] -Filter "*.wim" -Recurse -EA 0 )
If ( $SWIM.Count -eq 0 ) { $Server = [ Ordered ]@{ Name = $NA ; File = $NA ; Tag = $NA ; Path = $NA ; Date = $NA ; Full = $NA ; Build = $NA } }
Else {
$Server = @( )
$Server += $SWIM | Select @{ Name = "Name" ; Expression = { "$( $WIM.Name[0] )" } } ,
@{ Name = "File" ; Expression = { $_.Name } } ,
@{ Name = "Tag" ; Expression = { $_.BaseName } } ,
@{ Name = "Path" ; Expression = { $_.DirectoryName } } ,
@{ Name = "Date" ; Expression = { $_.LastWriteTime } } ,
@{ Name = "Full" ; Expression = { $_.FullName } } ,
@{ Name = "Build" ; Expression = { Get-WIMBuild -IP $_.FullName -ID 1 } } }
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\_________[ Checks/loads forward MDT Client WIM files ]____________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "MDT" "[+] Client WIM"
$CWIM = @( GCI $DT[1] -Filter "*.wim" -Recurse -EA 0 )
If ( $CWIM.Count -eq 0 ) { $Client = [ Ordered ]@{ Name = $NA ; File = $NA ; Tag = $NA ; Path = $NA ; Date = $NA ; Full = $NA ; Build = $NA } }
Else {
$Client = @( ) ; $W10 = "Windows 10 Home/Education/Pro (x86/64)"
$Client += $CWIM | Select @{ Name = "Name" ; Expression = { "$W10" } } ,
@{ Name = "File" ; Expression = { $_.Name } } ,
@{ Name = "Tag" ; Expression = { $_.BaseName } } ,
@{ Name = "Path" ; Expression = { $_.DirectoryName } } ,
@{ Name = "Date" ; Expression = { $_.LastWriteTime } } ,
@{ Name = "Full" ; Expression = { $_.FullName } } ,
@{ Name = "Build" ; Expression = { Get-WIMBuild -IP $_.FullName -ID 1 } } }
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\_________[ Displays MDT Server / Client WIM files ]_______________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Title "Current-WIM(S)"
$Server , $Client | % {
Wrap-Section "[ $( $_.Name ) ]" -In
Wrap-Item "[+] Path " $_.Path -In
Wrap-Item "[+] File " $_.File -Out
Wrap-Item "[+] Date " $_.Date -In
Wrap-Item "[+] Build" $_.Build -Out
Wrap-Space -In }
Wrap-Foot
Read-Host "Press Enter to Continue"
# ____ ____________________________________________________________________
#//¯¯\\__________________________________________________________________________//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
#\\__//¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//
# \\____[ Calculates & Concatenates Target WIM File/Format Information ]______//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\__//¯¯\\
# ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Wrap-Action "Transfer / Update" "[+] DISM -> MDT WIM Information"