Skip to content

Instantly share code, notes, and snippets.

View mattwoolnough's full-sized avatar

mattwoolnough

View GitHub Profile
@mattwoolnough
mattwoolnough / services.txt
Created July 5, 2020 08:15
Services to be disabled
SYSTEM\CurrentControlSet\Services\AxInstSV
SYSTEM\CurrentControlSet\Services\bthserv
SYSTEM\CurrentControlSet\Services\CDPUserSvc
SYSTEM\CurrentControlSet\Services\PimIndexMaintenanceSvc
SYSTEM\CurrentControlSet\Services\dmwappushservice
SYSTEM\CurrentControlSet\Services\MapsBroker
SYSTEM\CurrentControlSet\Services\lfsvc
SYSTEM\CurrentControlSet\Services\SharedAccess
SYSTEM\CurrentControlSet\Services\lltdsvc
SYSTEM\CurrentControlSet\Services\wlidsvc
$services = gc .\Documents\services.txt
$stream = [System.IO.StreamWriter] ".\Documents\Registry.xml"
$stream.WriteLine('<?xml version="1.0" encoding="utf-8"?>')
$stream.WriteLine('<RegistrySettings clsid="{A3CCFC41-DFDB-43a5-8D26-0FE8B954DA51}">')
$services | ForEach-Object {
$stream.WriteLine('<Registry clsid="{9CD4B2F4-923D-47f5-A062-E897DD1DAD50}" name="Start" status="Start" image="12" changed="' + (get-date).tostring("yyyy-dd-MM hh:mm:ss") + '" uid="{' + (New-Guid).Guid.ToUpper() + '}"><Properties action="U" displayDecimal="1" default="0" hive="HKEY_LOCAL_MACHINE" key="' + $_ + '" name="Start" type="REG_DWORD" value="00000004"/></Registry>' )
}
$stream.WriteLine('</RegistrySettings>')
$stream.close()
@mattwoolnough
mattwoolnough / gist:54a7abcbe0f92930d66743c6265b644d
Created October 17, 2019 18:50
Remove Azure Backup and Vault
$VaultName = "RecoveryVault"
$ClientName = "desktop-mw."
$MyVault = Get-AzRecoveryServicesVault -ResourceGroupName $ResourceGroupName -Name $VaultName
$Cont = Get-AzRecoveryServicesBackupContainer -ContainerType "Windows" -BackupManagementType MARS -FriendlyName $ClientName -VaultId $MyVault.ID
Unregister-AzRecoveryServicesBackupContainer -Container $Cont
Get-AzRecoveryServicesVault -ResourceGroupName $ResourceGroupName -Name $VaultName | Remove-AzRecoveryServicesVault
@mattwoolnough
mattwoolnough / README.md
Created October 14, 2019 01:39 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@mattwoolnough
mattwoolnough / gist:c55fc404356303365ba87320072c378a
Created July 31, 2019 11:03
Get rid of those pesky MacOS files __MACOS and .DS_Store
Get-ChildItem * -Include "__MACOSX ",".DS_Store" -Recurse | Remove-Item -Recurse -Force
Option Explicit
Function LookupCSVResults(lookupValue As Variant, lookupRange As Range, resultsRange As Range) As String
Dim s As String 'Results placeholder
Dim sTmp As String 'Cell value placeholder
Dim sTmpOffset As Range 'Cell value placeholder
Dim r As Long 'Row
@mattwoolnough
mattwoolnough / Install-Chrome.ps1
Created October 29, 2018 04:46
Chrome install one-liner
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path$Installer; Start-Process -FilePath $Path$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path$Installer
Import-Module LithnetMIISAutomation
$SyncRules = Get-MVObject -ObjectType "synchronizationRule"
$FIMMA = "MIM MA"
ForEach ($Rule in $SyncRules)
{
$ConnectorSpaceDN = $Rule.CSMVLinks[0].ConnectorSpaceDN
Get-CSObject -DN $ConnectorSpaceDN -MA $FIMMA | Sync-CSObject -Commit
}
@mattwoolnough
mattwoolnough / Compare-FolderContents.ps1
Last active September 21, 2017 23:50
Compare hashes of files in two directories (recursive)
$SourceDocs = Get-ChildItem -Recurse –Path "\\172.16.97.19\c$\Program Files\Folder to Check\" | foreach {Get-FileHash –Path $_.FullName}
$DestDocs = Get-ChildItem -Recurse –Path "C:\Program Files\Program Files\Folder to Check\" | foreach {Get-FileHash –Path $_.FullName}
(Compare-Object -ReferenceObject $SourceDocs -DifferenceObject $DestDocs -Property hash -PassThru).Path
@mattwoolnough
mattwoolnough / Set-EmployeeNumber.ps1
Created September 21, 2017 11:16
Update the EmployeeNumber based on data in the Metaverse
Import-Module LithnetMIISAutomation
Get-CSObject -MA "Aurion Schedules MA" -DN "OU=ScheduleUsers,DC=IdentityBroker" -IncludeSubTree |
ForEach-Object {
$user = Get-MVObject $_.MvGuid
$givenName = $user.attributes.givenName.Values.ValueString
$sn = $user.attributes.sn.Values.ValueString
$pn = $user.attributes.'unify_Aurion-WamiKey'.Values.ValueString