Skip to content

Instantly share code, notes, and snippets.

Avatar

Trevor Jones SMSAgentSoftware

View GitHub Profile
@SMSAgentSoftware
SMSAgentSoftware / Export-CMConfigurationItemScripts.ps1
Created Feb 21, 2017
Exports all scripts (discovery and remediation) used in all SCCM Compliance Setting Configuration Items
View Export-CMConfigurationItemScripts.ps1
<#
.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
#>
@SMSAgentSoftware
SMSAgentSoftware / Backup-CMSiteMaintenanceTaskSettings.ps1
Created Apr 6, 2017
Backs up ConfigMgr Site Maintenance Task settings from WMI to json files
View Backup-CMSiteMaintenanceTaskSettings.ps1
## 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)]
@SMSAgentSoftware
SMSAgentSoftware / Download-LatestDellDriverPack.ps1
Created Apr 25, 2017
Downloads the latest driver pack from Dell for any model or models you specify
View Download-LatestDellDriverPack.ps1
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,
ValueFromPipelineByPropertyName=$true,
ValueFromPipeline=$true,
Position=0)]
[String[]]$Model,
[Parameter(Mandatory=$true,
@SMSAgentSoftware
SMSAgentSoftware / Set-W10DefaultWallpaper.ps1
Created Jul 6, 2017
Used to set the default wallpaper images for Windows 10 during MDT-integrated ConfigMgr OS deployment
View Set-W10DefaultWallpaper.ps1
# 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
@SMSAgentSoftware
SMSAgentSoftware / Get-CMClientVersions.ps1
Created Aug 31, 2017
Function that gets the current count and percentage of ConfigMgr Client Versions in the site
View Get-CMClientVersions.ps1
Function Get-CMClientVersions {
# Requires the "New-WPFMessageBox" function available at https://gist.github.com/SMSAgentSoftware/0c0eee98a673b6ac34f5215ea6841beb
# Requires minimum "db_datareader" SQL role in the ConfigMgr database
# Usage: Get-CMClientVersions -SQLServer "SQLServer" -Database "Database"
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$True,Position=0)]
@SMSAgentSoftware
SMSAgentSoftware / Restore-CMSiteMaintenanceTaskSettings.ps1
Last active Nov 21, 2017
Restores ConfigMgr Site Maintenance Task Settings backed up using the 'Backup-CMSiteMaintenanceTaskSettings' script
View Restore-CMSiteMaintenanceTaskSettings.ps1
## 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)]
@SMSAgentSoftware
SMSAgentSoftware / Get-IntuneDataWarehouseData.ps1
Last active Dec 10, 2017
Retrieves data from the Intune Data Warehouse
View Get-IntuneDataWarehouseData.ps1
Function Get-IntuneDataWarehouseData {
# Function to query the Intune Data Warehouse for data
# Requires an access token to be created first via the New-IntuneDataWarehouseAccessToken function
[CmdletBinding()]
Param(
[Parameter()] # this is the custom feed URL for your for your tenant for the InTune Data Warehouse
$WarehouseUrl = "https://fef.msun02.manage.microsoft.com/ReportingService/DataWarehouseFEService?api-version=beta",
[Parameter()]
@SMSAgentSoftware
SMSAgentSoftware / New-IntuneDataWarehouseAccessToken.ps1
Last active Dec 11, 2017
Gets an access token to allow access to the Intune Data Warehouse
View New-IntuneDataWarehouseAccessToken.ps1
Function New-IntuneDataWarehouseAccessToken {
# Function to get an access token for the Intune Data Warehouse
# To be used in conjunction with the function Get-IntuneDataWarehouseData
# Will download NuGet if required to install the latest Active Directory Authentication Library package
[CmdletBinding()]
Param(
[Parameter()]
$NuGetDirectory = "$Env:USERPROFILE\NuGet",
@SMSAgentSoftware
SMSAgentSoftware / New-SingleSeriesSplineChart.ps1
Last active Jun 13, 2018
PowerShell function to create a single-series spline chart from .Net chart controls and display in a WPF window
View New-SingleSeriesSplineChart.ps1
Function New-SingleSeriesSplineChart {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
$Title,
[Parameter(Mandatory=$true)]
$Data,
[Parameter(Mandatory=$true)]
$AxisX,
@SMSAgentSoftware
SMSAgentSoftware / New-InteractiveDataDisplayChart.ps1
Created Jun 20, 2018
Creates a simple interactive bar chart using Microsoft's opensource Interactive Data Display project
View New-InteractiveDataDisplayChart.ps1
## Example of how to use the opensource InteractveDataDisplay module from Microsoft to create a WPF chart in PowerShell
Add-Type -AssemblyName PresentationFramework
Add-Type -AssemblyName System.IO.Compression.FileSystem
# Location to download the required libraries and reference them from
$Source = "C:\Users\tjones\OneDrive\PowerShell\POSH Projects\Interactive Data Display"
#region DownloadDependencies
$URLs = @(