Skip to content

Instantly share code, notes, and snippets.

View dotps1's full-sized avatar

Thomas Malkewitz dotps1

View GitHub Profile
@dotps1
dotps1 / WindowsUpdateAgentReset.ps1
Last active January 5, 2024 08:22
Resets the Windows Update Agent components.
<#
.SYNOPSIS
Resets the requried components of the Windows Update Agent.
.DESCRIPTION
Stops required services.
Removes cached files/folders used by the Windows Update Agent.
Resets the permissions on the bits and wuauserv services.
Registers dlls needed by the bits/Windows Update Agent.
Removes lingering registry entries from SUS if present.
Restarts all the services that where stopped.
\Windows\SOFTWA~1\DATAST~1\DATAST~1.EDB
\Windows\SoftwareDistribution\Datastore\DataStore.edb
\Windows\SOFTWA~1\DATAST~1\Logs\*.jrs
\Windows\SoftwareDistribution\Datastore\Logs\*.jrs
\Windows\SOFTWA~1\DATAST~1\Logs\Edb.chk
\Windows\SoftwareDistribution\Datastore\Logs\Edb.chk
\Windows\SOFTWA~1\DATAST~1\Logs\Tmp.chk
\Windows\SoftwareDistribution\Datastore\Logs\Tmp.chk
\Windows\Security\Database\*.edb
\Windows\Security\Database\*.sdb
@dotps1
dotps1 / Invoke-AppveyorBuild.ps1
Last active June 21, 2016 20:28
Appveyor Build
#requires -Modules Configuration, Pester, PSScriptAnalyzer
try {
Set-Location -Path $env:APPVEYOR_BUILD_FOLDER -ErrorAction Stop
$timestamp = Get-Date -uformat "%Y%m%d-%H%M%S"
$resultsFile = "Results_${timestamp}.xml"
Import-Module -Name .\$env:APPVEYOR_PROJECT_NAME -Force -ErrorAction Stop
Invoke-Pester -Path '.\Tests' -OutputFormat NUnitXml -OutputFile ".\$resultsFile" -PassThru -ErrorAction Stop |
<#
.SYNOPSIS
Ensures proper configuration of targeted Registry Key Property Values to prevent the LogMeIn Patch Management feature from interfering with the Windows Update subsystem.
.DESCRIPTION
There is a limitation on the WUAUSERV application that makes it a single user application. During the Patch Cycle of LabTech, if another application (LogMeIn) tries to invoke a call to it,
It will cause the LabTech Patch Cycle to fail. This registry configuration will prevent the LogMeIn service from using the Windows Update subsystem.
.INPUTS
None.
.OUTPUTS
None.
@dotps1
dotps1 / README.md
Created May 16, 2016 14:51
Read me file for PSGist.

PSGist

A PowerShell module to interact with GitHub Gists.

Build status

This is a PowerShell module that uses the GitHub API to interact and manipulate Gist.

PS GitHub:\> Get-Command -Module PSGist | Sort-object -Property Name
<#
.SYNOPSIS
Gets the current status of BitLocker.
.DESCRIPTION
Tests the current status of BitLocker Drive Encryption on an Encryptable Volume. Only returns true if the volume is fully encrypted and the protection status is on.
.INPUTS
System.String.
.OUTPUTS
System.Management.Automation.PSObject
.PARAMETER ComputerName
@dotps1
dotps1 / Register-SophosWebIntelligenceService.ps1
Last active March 16, 2016 14:40
Fix for missing Sophos Web Intelligence Service
# Fix for missing Sophos Web Intelligence Service.
# https://www.sophos.com/en-us/support/knowledgebase/121905.aspx
<# WQL Query for SCCM collection to target computers with Sophos Anti-Virus but missing the Sophos Web Intelligence Service.
SELECT SMS_R_SYSTEM.ResourceID,
SMS_R_SYSTEM.ResourceType,
SMS_R_SYSTEM.Name,
SMS_R_SYSTEM.SMSUniqueIdentifier,
SMS_R_SYSTEM.ResourceDomainORWorkgroup,
SMS_R_SYSTEM.Client
@dotps1
dotps1 / ProtectedAttributeCleanup.ps1
Last active June 20, 2016 18:57
Find users in a domain that have the protected attribute that should not, remove that attribute and re enable inheritance.
#requires -Modules ActiveDirectory
# Gets all currently protected groups and users.
$protectedGroups = Get-ADGroup -LDAPFilter '(adminCount=1)'
$protectedUsers = Get-ADUser -LDAPFilter '(adminCount=1)'
# Gets all the users that are actually members of the current protected groups.
$usersFromProtectedGroups = $protectedGroups | ForEach-Object {
Get-ADGroupMember -Identity $_ | Where-Object {
$_.ObjectClass -eq 'User'
<#
.SYNOPSIS
Displays matching PowerBall numbers from a Csv file.
.DESCRIPTION
Imports a csv file, with each number in it own column, then compares it to the PowerBall Numbers.
Outputs highlighted matching numbers in each row.
.INPUTS
System.String
.OUTPUTS
None.
@dotps1
dotps1 / Get-DNSConfiguration.ps1
Last active January 5, 2024 08:03
Retrieves the DNS Servers from all IPEnabled Network Adapters.
<#
.SYNOPSIS
Retrives DNS Servers from a computer.
.DESCRIPTION
Retrives primary, secondary, tertiery DNS Servers from on online system with Windows Management Instrimentation.
.INPUTS
System.String.
.OUPUTS
System.Management.Automation.PSObject.
.PARAMETER ComputerName