This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-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)] |
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-WPFClock { | |
## Generates a clock displaying the current system time | |
## Requires the Arction WPF Gauges, a free download from https://www.arction.com/free-gauges/ | |
## Set the location of the Arction Gauges dll on line 26 | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory=$false,Position=0)] |
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-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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-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()] |
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-SingleSeriesSplineChart { | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
$Title, | |
[Parameter(Mandatory=$true)] | |
$Data, | |
[Parameter(Mandatory=$true)] | |
$AxisX, |
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
# Demo script to display a custom 'toast' notification | |
# Load required assemblies | |
Add-Type -AssemblyName PresentationFramework, System.Windows.Forms | |
# User-populated variables | |
$WindowHeight = 140 | |
$WindowWidth = 480 | |
$Title = "New Blog Post by SMSAgent!" | |
$Text = "Trevor Jones has posted a new blog: Create a custom toast notification with WPF and PowerShell. Click here to read." |
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
################################################################################### | |
## Script to send an html-formatted email report containing data from SQL Server ## | |
## ## | |
## Author: Trevor Jones ## | |
## Version 1.0 (5th Apr 2018) ## | |
################################################################################### | |
# Database info | |
$script:dataSource = 'SQLSERVER\INSTANCE' | |
$script:database = 'DATABASE' |
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
# Script to run SetupDiag to troubleshoot Windows 10 Setup | |
# Download SetupDiag.exe from https://go.microsoft.com/fwlink/?linkid=870142 and place in same directory as this script | |
# Get the CCM Logs location from registry | |
$LogLocation = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\CCM\Logging\@Global" -Name LogDirectory | Select -ExpandProperty LogDirectory | |
#$LogLocation = "$env:SystemRoot\CCM\Logs" | |
# Get the location we're running from (or use $PSScriptRoot) | |
$ScriptPath = Split-Path $MyInvocation.MyCommand.Path -Parent |
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
## Displays a Windows 10 Toast Notification for a ConfigMgr Application deployment | |
## To be used in a compliance item | |
## References | |
# Options for audio: https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/element-audio#attributes-and-elements | |
# Toast content schema: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/toast-schema | |
# Datetime format for deadline: Ref: https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx | |
# Required parameters | |
$Title = "Enterprise Vault Outlook Add-in" |
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
## 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 = @( |