Skip to content

Instantly share code, notes, and snippets.

View mdowst's full-sized avatar

Matthew Dowst mdowst

View GitHub Profile
<#
This script contains the code that was presented in the blog post:
SCSM PowerShell: Getting Started with Service Manager PowerShell
For more details on this and other SCSM PowerShell script see the series overview at http://bit.ly/SCSM-PS
#>
#####################################################################################################
# #
# Use to Test AD Credentials
function Test-ADCredential {
[CmdletBinding()]
Param
(
[string]$UserName,
[string]$Password
)
if (!($UserName) -or !($Password)) {
Write-Warning 'Test-ADCredential: Please specify both user name and password'
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
actions:
1:
action: close
description: close indices
options:
delete_aliases: False
timeout_override:
continue_if_exception: True
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
hosts:
- 127.0.0.1
port: 9200
url_prefix:
use_ssl: False
certificate:
client_cert:
@mdowst
mdowst / Search-PSScripts.ps1
Last active November 29, 2018 20:53
A PowerShell function usedto search the text inside PowerShell scripts for a particular string
Function Search-PSScripts{
<#
.SYNOPSIS
Use to search the text inside PowerShell scripts for a particular string
.PARAMETER SearchString
The string to search for inside the script file
.PARAMETER Path
The folder path to search for PowerShell files in. Default to userprofile if not specified.
Function Encode-LogAnalyticsQuery{
<#
.SYNOPSIS
This function is used by the Write-LogAnalyticsURL Function to encode the query string for the URL.
.DESCRIPTION
This function outputs a compressed Base64 string based in the QueryString value passed to it.
.PARAMETER QueryString
The query you want to create a URL for.
Function Out-GridViewCode{
<#
.SYNOPSIS
Sends output to an interactive table in a separate window. With extended support to display Out-GridView as main window when using VS Code
.DESCRIPTION
The Out-GridView cmdlet sends the output from a command to a grid view window where the output is displayed in an interactive table. However, when you use VS Code the window appears in the background. Running this wrapper will bring the window to the front.
Parameters remain the same as the orginal Out-GridView
<#
This script will query all Azure Subscriptions for Windows Virtual Machines and check them for the presence of potential Log4j vulnerabilities.
It checks for Java installations and search all files for Log4j JAR files. This is not a conclusive scan, but is a good way to quickly
identify potentially at risk machines.
To function correctly, the VM requires connectivity (port 443) to Azure public IP addresses.
Updated 12/22/2021 - Now includes ability to scan Arc servers
The account running this script must have read access to the VMs along with
@mdowst
mdowst / RemoveWsusDeadline.ps1
Last active March 14, 2022 14:19
This script can be used to remove all deadlines from approved updates in WSUS
<#
.SYNOPSIS
Use to remove all or past deadlines from WSUS
.PARAMETER WsusServer
Name of the remote machine running WSUS server. Defaults to localhost.
.PARAMETER UseSecureConnection
If set to true, uses SSL instead of HTTP.
@mdowst
mdowst / FindTwitterFriendsOnMastodon.ps1
Last active December 16, 2022 14:13
Find Twitter Friends on Mastodon
<#
Uses BluebirdPS to get all of the people you follow on Twitter.
Then searches their profile for potential Mastodon usernames.
To setup BluebirdPS: https://github.com/thedavecarroll/BluebirdPS
#>
$TwitterFriends = Get-TwitterFriends
# The property fields to search
$properties = 'Name','Description'