Skip to content

Instantly share code, notes, and snippets.

View MrWyss-MSFT's full-sized avatar

Marius Wyss MrWyss-MSFT

View GitHub Profile
@MrWyss-MSFT
MrWyss-MSFT / Get-Win32AppsOrder.ps1
Last active October 4, 2024 14:02
Reads the Apps Policy entries from the IntuneManagementExtension.log(s). Displays the date of the Apps Policy entries. For each policy entry, show the apps in the policy in order. (at least I hope so) 😊
#[scriptblock]::Create((iwr "https://gist.githubusercontent.com/MrWyss-MSFT/c52f0a4567cba24e9ac8a38416a05bac/raw").Content).Invoke()
$Path = "C:\ProgramData\Microsoft\IntuneManagementExtension\Logs\AppWorkload*.log"
$MatchPatter = '<!\[LOG\[Get policies = (.*)\]LOG\]!>'
$lines = Select-String $Path -Pattern $MatchPatter
$Apps = @()
$ln_dig = "D{0}" -f $lines.count.ToString().Length
Foreach ($line in $lines) {
@MrWyss-MSFT
MrWyss-MSFT / Get-WP3Capabilities.ps1
Created October 25, 2023 09:01
Get-WP3Capabilities
($(netsh wlan show drivers) -match "WPA3-*").trimstart() -split "`n" | ForEach-Object { $auth, $cipher = $_ -split ' +'; [PSCustomObject]@{ 'Security Mode' = $auth; 'Encryption Mode' = ($cipher -join ' ') } }
@MrWyss-MSFT
MrWyss-MSFT / Get-CoMgmtWL.ps1
Last active October 20, 2023 07:54
Returns the Co-Management Workloads Names
#[scriptblock]::Create((iwr "https://gist.githubusercontent.com/MrWyss-MSFT/228ed9f3dd2b67077790a3bef98442d5/raw").Content).Invoke()
<#
.SYNOPSIS
Returns the Co-Management Workloads Names
.DESCRIPTION
Reads the Co-Management Workloads from the CCM_System WMI Class and returns the
Workloads as PSCustomObject if they are enabled or not.
#>
@MrWyss-MSFT
MrWyss-MSFT / Check-IntuneEndpointsSchedTask.ps1
Created October 12, 2023 08:17
Check-IntuneEndpointsSchedTask.ps1
#Requires -RunAsAdministrator
$scheduledTaskScript = @'
$PSDefaultParameterValues = @{
"Write-Log:Path" = $env:ALLUSERSPROFILE + "\Microsoft\IntuneManagementExtension\Logs\Log-Network-$(Get-Date -Format yyyy-M-dd).log"
"Write-Log:Component" = "Log-Network"
"Write-Log:Type" = "Info"
"Write-Log:ConsoleOutput" = $True
}
#endregion
@MrWyss-MSFT
MrWyss-MSFT / New-IntuneInvEntry.ps1
Last active October 5, 2023 14:22
Custom Inventory for Intune: Creates fake software inventory entries (Add Remove Programs / Installed Apps) used to create custom inventory items in Intune
Function New-IntuneInvEntry {
<#
.SYNOPSIS
Creates fake software inventory entries (Add Remove Programs / Installed Apps)
used to create custom inventory items in Intune
.DESCRIPTION
Creates fake software inventory entries in HKLM|HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
with the DisplayName, DisplayVersion, Publisher, InstallDate, NoModify, NoRepair, NoRemove. If it should
be hidden in Add/Remove Programs and Installed Apps it will also set the SystemComponent and WindowsInstaller values to 1.
@MrWyss-MSFT
MrWyss-MSFT / Update-CMGAutCert.ps1
Created December 24, 2022 13:06
Used for CertifyTheWeb
[CmdletBinding()]
param (
[Parameter(Position=1)]
$result,
[Parameter(Position=2)]
$Password
)
# Site configuration
@MrWyss-MSFT
MrWyss-MSFT / Get-AutopilotAndESPProgress.ps1
Last active October 4, 2024 14:10
Returns the assigned Autopilot profile and the ESP progress. Useful for troubleshooting.
#iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/MrWyss-MSFT/d511d655f55762233a1d442c24d584f6/raw'))
Function Get-ESPProgress () {
<#
.SYNOPSIS
Reads the ESP Phase status from Registry, returns PSCustomObject
#>
[CmdletBinding()]
param (
[Parameter(Mandatory, HelpMessage = 'Choose ESP Phase')]
@MrWyss-MSFT
MrWyss-MSFT / WMIFilterQueryGeneratorForCoMgmt-ConfigMgr.ps1
Created October 29, 2022 00:45
Generates WQL Queries that can be used as GPO WMI filters for Co-Management Workloads (ConfigMgr Version)
[Flags()] enum CoManagementFlag {
CoManagementConfigured = 1
CompliancePolicies = 3
ResourceAccessPolicies = 5
DeviceConfiguration = 9
WindowsUpdatesPolicies = 17
EndpointProtection = 33
ClientApps = 65
OfficeClickToRunApps = 129
}
@MrWyss-MSFT
MrWyss-MSFT / WMIFilterQueryGeneratorForCoMgmt.ps1
Created October 28, 2022 20:41
Generates WQL Queries that can be used as GPO WMI filters for Co-Management Workloads
[Flags()] enum CoManagementFlag {
CoManagementConfigured = 1
CompliancePolicies = 3
ResourceAccessPolicies = 5
DeviceConfiguration = 9
WindowsUpdatesPolicies = 17
EndpointProtection = 33
ClientApps = 65
OfficeClickToRunApps = 129
}
Function Get-ESPProgress () {
<#
.SYNOPSIS
Reads the ESP Phase status from Registry, returns PSCustomObject
#>
[CmdletBinding()]
param (
[Parameter(Mandatory, HelpMessage = 'Choose ESP Phase')]
[ValidateSet("DevicePreparation", "DeviceSetup", "AccountSetup")]
[String]