This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Exports all scripts (discovery and remediation) used in all SCCM Compliance Setting Configuration Items | |
.DESCRIPTION | |
This script connects to the SCCM database to retrieve all Compliance Setting Configuration Items. It then processes each item looking for | |
discovery and remediation scripts for the current (latest) version. It will export any script found into a directory structure. | |
.NOTES | |
Requirements - 'db_datareader' permission to the SCCM SQL database with the account running this script. | |
Parameters - set the parameters below as required | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SQLQuery | |
{ | |
# Properties | |
[string]$SQLServer | |
[string]$Database | |
[string]$Query | |
[string]$QueryFile | |
[string]$Path | |
[int]$ConnectionTimeout = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Saves ConfigMgr Site Maintenance Task settings from WMI to json files ## | |
## Should be run on the Primary Site Server ## | |
## Should be run as administrator ## | |
[cmdletbinding()] | |
Param( | |
[Parameter(Position=0,Mandatory=$True)] | |
[ValidateNotNullorEmpty()] | |
[string]$SiteCode, | |
[Parameter(Position=1,Mandatory=$True)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Restores ConfigMgr Site Maintenance Task settings from json files (backed up using the 'Backup-CMSiteMaintenanceTaskSettings' script ## | |
## Should be run on the Primary Site Server ## | |
## Should be run as administrator ## | |
[cmdletbinding()] | |
Param( | |
[Parameter(Position=0,Mandatory=$True)] | |
[ValidateNotNullorEmpty()] | |
[string]$SiteCode, | |
[Parameter(Position=1,Mandatory=$True)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$true, | |
ValueFromPipelineByPropertyName=$true, | |
ValueFromPipeline=$true, | |
Position=0)] | |
[String[]]$Model, | |
[Parameter(Mandatory=$true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$false, | |
ValueFromPipelineByPropertyName=$true, | |
ValueFromPipeline=$true | |
)] | |
[string[]]$ComputerName = $env:COMPUTERNAME | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get-PatchStatus.ps1 | |
# Gets the status of software update/s on remote system/s | |
# | |
# The is the SINGLE-THREADED version | |
# | |
# Author: Trevor Jones | |
# May-2017 | |
[CmdletBinding()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get-PatchStatus.ps1 | |
# Gets the status of software update/s on remote system/s | |
# | |
# The is the MULTI-THREADED version | |
# | |
# IMPORTANT: Requires my [BackgroundJob] custom class, available here: http://smsagent.wordpress.com/posh-5-custom-classes/background-job/ | |
# | |
# Author: Trevor Jones | |
# May-2017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the TS variables | |
$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment | |
$ScriptRoot = $tsenv.Value("ScriptRoot") | |
$OSDTargetSystemRoot = $tsenv.Value("OSDTargetSystemRoot") | |
# Rename default wallpaper | |
Rename-Item $OSDTargetSystemRoot\Web\Wallpaper\Windows\img0.jpg img1.jpg -Force | |
# Copy new default wallpaper | |
Copy-Item $ScriptRoot\img0.jpg $OSDTargetSystemRoot\Web\Wallpaper\Windows -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function New-WPFMessageBox { | |
# For examples for use, see my blog: | |
# https://smsagent.wordpress.com/2017/08/24/a-customisable-wpf-messagebox-for-powershell/ | |
# CHANGES | |
# 2017-09-11 - Added some required assemblies in the dynamic parameters to avoid errors when run from the PS console host. | |
# Define Parameters | |
[CmdletBinding()] |
OlderNewer