When executing System File Checker (SFC), aka. sfc.exe, on a computer known to have missing protected files, e.g., \Windows\System32\quser.exe, the computer returns 'Windows Resource Protection did not find any integrity violations.' when it should have returned 'Windows Resource Protection found integrity violations.'
This file contains hidden or 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 ConvertFrom-ByteArray { | |
[CmdletBinding()] | |
param ( | |
[Alias('appid')] | |
[Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[byte[]] | |
$byteArray | |
) | |
begin {} |
This file contains hidden or 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
$CommandText = @" | |
SELECT | |
[t1].[computer_id] | |
, [t1].[name] | |
, [t1].[serial_num] | |
, [t1].[last_inventory] | |
, [GS] = (SELECT TOP 1 UPPER([hostname]) FROM mmsettings) | |
FROM | |
[computer] [t1] | |
"@ |
This file contains hidden or 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-WindowsTempExtensionSummary { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[string[]] | |
$ComputerName = $env:COMPUTERNAME | |
) | |
begin { | |
$ScriptBlock = { | |
$OutputObject = Get-ChildItem -Path $env:windir\temp -Recurse -File | Group-Object -Property Extension | ForEach-Object { |
This file contains hidden or 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
#region Get-CMInstallPath | |
function Get-CMInstallPath { | |
function Split-CommandLine { | |
[CmdletBinding()] | |
Param | |
( | |
[Parameter(Mandatory = $false, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] | |
[ValidateNotNullOrEmpty()] | |
[string]$CommandLine | |
) |
This file contains hidden or 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 Invoke-ExtractIcon { | |
[CmdletBinding(SupportsShouldProcess)] | |
Param( | |
[Parameter(Position = 0, Mandatory,HelpMessage = "Specify the path to the file.")] | |
[ValidateScript({Test-Path $_})] | |
[string]$Path, | |
[Parameter(HelpMessage = "Specify the folder to save the file.")] | |
[ValidateScript({Test-Path $_})] | |
[string]$Destination = ".", |
This file contains hidden or 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-FileEncoding { | |
<# | |
.SYNOPSIS | |
To get the file encoding of a file | |
.DESCRIPTION | |
To get the file encoding of a file | |
.PARAMETER Path | |
The file that you want to check its encoding. | |
.EXAMPLE | |
Get-FileEncoding -Path .\UTF16-BigEndian.txt |
This file contains hidden or 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 hidden or 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 |
NewerOlder