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
Set-Location -Path "$(Get-PSDrive -PSProvider 'CMSite'):" | |
$CMSoftwareUpdateAutoDeploymentRules = Get-CMSoftwareUpdateAutoDeploymentRule -Fast | |
$CMSoftwareUpdateAutoDeploymentRuleDeployments = Get-CMSoftwareUpdateAutoDeploymentRuleDeployment | |
$CMSoftwareUpdateAutoDeploymentRuleDeployments | ForEach-Object { | |
$CMSoftwareUpdateAutoDeploymentRuleDeployment = $_ | |
$CMSoftwareUpdateAutoDeploymentRule = $CMSoftwareUpdateAutoDeploymentRules | Where-Object AutoDeploymentID -eq $CMSoftwareUpdateAutoDeploymentRuleDeployment.RuleID | |
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 | |
Repairs the "The package data in WMI is not consistent to PkgLib" errors after ConfigMgr2012R2 upgrade | |
.DESCRIPTION | |
This script repairs the "The package data in WMI is not consistent to PkgLib" errors after ConfigMgr2012R2 upgrade by | |
searching for packages that appear to be in de Content Library according to WMI but are not there and do not exist anymore | |
This cleanup will run against all distribution points and when invalid WMI instances are found, they will be removed. | |
Detailed description of this issue: http://blogs.technet.com/b/configmgrteam/archive/2012/05/07/troubleshooting-content-mismatch-warnings-on-a-distribution-point-in-system-center-2012-configuration-manager.aspx?wa=wsignin1.0 | |
Script is to be used at own risk | |
.EXAMPLE |
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-Owner { | |
[CmdletBinding()] | |
PARAM( | |
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[ValidateScript({ | |
$Item = $_ | Get-Item | |
(Test-Path -Path $Item) -eq $true -and $Item.GetType().FullName -in @('System.IO.FileInfo', 'System.IO.DirectoryInfo') | |
})] | |
$Path | |
) |
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
index=uscc_is_workstation_windows SourceName="Microsoft-Windows-DistributedCOM" EventCode=10028 | |
| rex field=Message "computer (?<HostName>.*) using" | |
| rex field=Message "PID.*\((?<ProcessPath>.*)\)" | |
| rex field=Message "CLSID.*\{(?<CLSID>.*)\}" | |
| eval Component=case( | |
CLSID = "8BC3F05E-D86B-11D0-A075-00C04FB68820", "Windows Management and Instrumentation", | |
CLSID = "3C3A70A7-A468-49B9-8ADA-28E11FCCAD5D", "RAServer", | |
1 = 1, CLSID | |
) | |
```| regex Message="ab950015400007U|a01d753600000DQ|a0307881900001M"``` |
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
# Download and Install latest Production ring OneDriveSetup.exe installer for Windows | |
function Get-DownloadFileName { | |
[CmdletBinding()] | |
param( | |
[Uri] | |
$Uri | |
) | |
$Response = $null | |
# $ErrorActionPreference = 'SilentlyContinue' | |
if (!$Response) { |
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-SplunkDownload { | |
[CmdletBinding()] | |
param( | |
[string[]]$Product | |
, | |
[string[]]$XProduct | |
, | |
[string[]]$Architecture | |
, | |
[string[]]$XArchitecture |
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-WsusSynchronizationHistory { | |
[CmdletBinding()] | |
param() | |
begin { | |
$IUpdateServer = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer() | |
$ISubscription = $IUpdateServer.GetSubscription() | |
$SynchronizationHistoryCollection = $ISubscription.GetSynchronizationHistory() | |
} | |
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
$CMContentUpdateServicesPackageInfo = Get-CMContentUpdateServicesPackageInfo | |
$CMContentUpdateServicesPackageInfo | Where-Object { $_.IsSuperseded -eq $true -and $_.IsDeployed -eq $false } | Select-Object -Property Path, FileName, FolderSizeFriendly, DateRevised |
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 Resolve-ContentIdToPackage { | |
[CmdletBinding()] | |
param( | |
[Alias('UID')] | |
[string[]]$ContentUniqueId | |
) | |
begin { | |
$SiteCode = (Get-CimInstance -ClassName SMS_Authority -Namespace root\ccm).Name.Split(':')[1] | |
$PreLocation = Get-Location |
NewerOlder