Skip to content

Instantly share code, notes, and snippets.

Manuel Henke ducke

Block or report user

Report or block ducke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ducke
ducke / Invoke-SCCMRunScript.ps1
Created Sep 16, 2019 — forked from Robert-LTH/Invoke-SCCMRunScript.ps1
Simple script to use the new sccm feature called "Run Script". The builtin Invoke-CMScript does not accept parameters.
View Invoke-SCCMRunScript.ps1
function Invoke-SCCMRunScript {
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$SiteServer,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]$Namespace,
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
@ducke
ducke / ConfigMgrTPArm.json
Created Nov 14, 2018
ARM Template ConfigMgr Technical Preview
View ConfigMgrTPArm.json
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"newVMName": {
"type": "string",
"defaultValue": "ConfigMgrTP"
},
"labName": {
"type": "string",
@ducke
ducke / PowerShellv4_DynamicKeyword.md
Created Sep 24, 2018 — forked from altrive/PowerShellv4_DynamicKeyword.md
Test code of PowerShell v4 Dynamic Keyword
View PowerShellv4_DynamicKeyword.md

Define DynamicKeyword

Define DynamicKeyword 'ExecTest'

Note: Don't copy&paste from following code. PowerShell SyntaxHighlighter remove some lines. Instead, use RAW view.

#Requires -Version 4.0
Set-StrictMode -Version Latest
View Get-SCCMApplicationDeps-Graph_v001.ps1
##############################################
############## Script Info ###################
##############################################
## Created By : Dan Cook 2017 ########
##############################################
<#
Version Info :
0.1 - 25/05/2017 - Creates a graphvis diagram and accompanying DOT code file
for an SCCM application dependency tree, by querying the
@ducke
ducke / New-WPFMessageBox
Created Aug 25, 2017 — forked from SMSAgentSoftware/New-WPFMessageBox
PowerShell function to display a customizable WPF message box / window
View New-WPFMessageBox
Function New-WPFMessageBox {
# For examples for use, see my blog:
# https://smsagent.wordpress.com/2017/08/24/a-customisable-wpf-messagebox-for-powershell/
# Define Parameters
[CmdletBinding()]
Param
(
# The popup Content
@ducke
ducke / Import-CsvToMongo.ps1
Created Aug 16, 2017 — forked from Kieranties/Import-CsvToMongo.ps1
A quick and dirty way of getting data from a csv into MongoDB. Knocked together for #NHTG13
View Import-CsvToMongo.ps1
<#
.NOTES
You'll need the excellent C# driver: http://docs.mongodb.org/ecosystem/drivers/csharp/
#>
Add-Type -Path "c:\mongodb\bin\MongoDB.Bson.dll"
Add-Type -Path "c:\mongodb\bin\MongoDB.Driver.dll"
Function Import-CsvToMongo{
param($path, $dbUrl, $collection, $matchCol) #matchCol is used as a lookup to check if entry is to be added or updated
@ducke
ducke / Hyper-V-VMMS.csv
Last active Apr 2, 2017
Hyper-V VMConnect Error
View Hyper-V-VMMS.csv
Level Date and Time Source Event ID Task Category Message
Error 02.04.2017 22:15:00 Microsoft-Windows-Hyper-V-VMMS 1102 None VmmsVirtualMachineSnapshot::GetReplicaType: ReadUnsignedInteger failed for snapshot 58BF2CB6-85AC-4952-8786-9CFA9B27B980! HRESULT = 0x80070002
Error 02.04.2017 22:15:00 Microsoft-Windows-Hyper-V-VMMS 1102 None VmmsVirtualMachineSnapshot::GetReplicaType: ReadUnsignedInteger failed for snapshot 58BF2CB6-85AC-4952-8786-9CFA9B27B980! HRESULT = 0x80070002
Warning 02.04.2017 22:15:00 Microsoft-Windows-Hyper-V-VMMS 1101 None VmmsRealizedVirtualMachine::GetBackupSnapshot: ReadString failed for F47D8618-3DB4-46DE-A1BE-99EB4BA3A6E3! HRESULT = 0x80070002
Warning 02.04.2017 22:15:00 Microsoft-Windows-Hyper-V-VMMS 1101 None VmmsRealizedVirtualMachine::GetBackupSnapshot: ReadString failed for F47D8618-3DB4-46DE-A1BE-99EB4BA3A6E3! HRESULT = 0x80070002
Warning 02.04.2017 22:15:00 Microsoft-Windows-Hyper-V-VMMS 1101 None VmmsRealizedVirtualMachine::GetBackupSnapshot: ReadString failed for D678395B-A
View some code for creating multiple enhanced detection methods
Function Load-ConfigMgrAssemblies {
Param(
$AdminConsoleDirectory = ($env:SMS_ADMIN_UI_PATH | Split-Path -Parent)
)
#Add-Type -Path "C:\Program Files (x86)\Microsoft Configuration Manager\AdminConsole\bin\DcmObjectModel.dll"
$filesToLoad = "Microsoft.ConfigurationManagement.ApplicationManagement.dll","AdminUI.WqlQueryEngine.dll", "AdminUI.DcmObjectWrapper.dll","DcmObjectModel.dll","AdminUI.AppManFoundation.dll","AdminUI.WqlQueryEngine.dll","Microsoft.ConfigurationManagement.ApplicationManagement.Extender.dll","Microsoft.ConfigurationManagement.ManagementProvider.dll","Microsoft.ConfigurationManagement.ApplicationManagement.MsiInstaller.dll"
Set-Location $AdminConsoleDirectory
[System.IO.Directory]::SetCurrentDirectory($AdminConsoleDirectory)
View gist:c8435399922f5de2d393e52ed1bb68d5
DesktopAppConverter.exe -Setup -BaseImage "C:\Users\mhenke\Downloads\BaseImage-14393.wim"
DesktopAppConverter.exe -Installer C:\dev\7-Zip.16.0.4\7z1604-x64.msi -PackageName "MyApp" -Publisher "CN=7zip" -Version "16.0.4.0" -MakeAppx -Destination "c:\dev" -verbose
& "C:\Program Files (x86)\Windows Kits\10\bin\x64\makecert.exe" -r -h 0 -n "CN=7zip" -eku 1.3.6.1.5.5.7.3.3 -pe -sv myapp.pvk myapp.cer
& "C:\Program Files (x86)\Windows Kits\10\bin\x64\pvk2pfx.exe" -pvk .\myapp.pvk -spc .\myapp.cer -pfx .\myapp.pfx
& "C:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe" sign -f .\myapp.pfx -fd SHA256 -v C:\dev\MyApp\MyApp.appx
#Import Cert in Store
@ducke
ducke / README.md
Created Nov 12, 2015 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet
View README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

You can’t perform that action at this time.