Skip to content

Instantly share code, notes, and snippets.

View paulvill76's full-sized avatar

Pablo Villaronga paulvill76

View GitHub Profile
<#----------------------------------------------------------------------------------------------------
Release Notes:
v1.4:
Author: Jared Poeppelman, Microsoft
First version published on TechNet Script Gallery
----------------------------------------------------------------------------------------------------#>
function Test-Command
{
@RamblingCookieMonster
RamblingCookieMonster / Migrate-ADMTUserCLI.ps1
Last active October 23, 2023 18:06
This is an example function that wraps ADMT.exe, abstracting out migration of Active Directory users into a PowerShell function.
<#
This is a PowerShell function wrapping the ADMT executable to abstract out migrating Active Directory users.
Read all the ADMT docs, and all the code and comments below before considering using this : )
The COM object was covered nicely by Jan Egil Ring:
http://blog.powershell.no/2010/08/04/automate-active-directory-migration-tool-using-windows-powershell/
Unfortunately, the COM object does not support Include files, a critical requirement for us.
@jbratu
jbratu / setupiisforsslperfectforwardsecrecy_v17.ps1
Last active May 13, 2024 05:49
Great powershell script for tightening HTTPS security on IIS and disabling insecure protocols and ciphers. Very useful on core installations.
# Copyright 2019, Alexander Hass
# https://www.hass.de/content/setup-microsoft-windows-or-iis-ssl-perfect-forward-secrecy-and-tls-12
#
# After running this script the computer only supports:
# - TLS 1.2
#
# Version 3.0.1, see CHANGELOG.txt for changes.
Write-Host 'Configuring IIS with SSL/TLS Deployment Best Practices...'
Write-Host '--------------------------------------------------------------------------------'
@msidmvp
msidmvp / gist:7156615d507d49e8c0bafc3c72a50666
Last active May 8, 2019 15:42
Adding AAD members to an AAD group based on CSV file
# Read in a list of user accounts from a CSV
#
# -- Begin sample CSV file --
# Username
# dtrump
# bobama
# gbush
# -- End sample CSV file --
#
$GroupObjectID = (Get-AzureADGroup -SearchString "your_groupname_here").ObjectID
@csharpforevermore
csharpforevermore / whatAppLocksThisFolder.ps1
Created June 2, 2018 13:01
Is this folder in use and which application is locking the folder for me?
IF((Test-Path -Path $FileOrFolderPath) -eq $false) {
Write-Warning "File or directory does not exist."
}
Else {
$LockingProcess = CMD /C "openfiles /query /fo table | find /I ""$FileOrFolderPath"""
Write-Host $LockingProcess
}
function Invoke-NativeCommand {
<#
.SYNOPSIS
Invoke a native command (.exe) as a new process.
.DESCRIPTION
Invoke-NativeCommand executes an arbitrary executable as a new process. Both the standard
and error output streams are redirected.
Error out is written as a single non-terminating error. ErrorAction can be used to raise
@paulvill76
paulvill76 / processResponse.js
Created November 19, 2019 08:49 — forked from mikepfeiffer/processResponse.js
Client side code that processes the response from a demo Azure function
function processResponse(response) {
if (response.status === 200) {
output =
`
<div class="alert alert-success" role="alert">
Hello, ${document.getElementById('name').value}! It's nice to meet you!
</div>
`;
document.getElementById('output').innerHTML = output;
} else {
@paulvill76
paulvill76 / Configure-SecureWinRM.ps1
Created March 11, 2021 14:51 — forked from bender-the-greatest/Configure-SecureWinRM.ps1
Configure WinRM to listen over SSL (port 5986) and use the web certificate generated by a certificate templated called 'WinRM'. Highly recommend reading Synopsis, Description, and Examples.
<#
.SYNOPSIS
Configures a secure WinRM listener over HTTPS to enable
SSL-based WinRM communications. This script has not been
tested on Windows Server 2003R2 or earier, and may not
work on these OSes for a variety of reasons.
If Windows Remote Management is disabled (e.g. service
stopped, GPO Policy, etc.), this script will likely fail.
.DESCRIPTION
@paulvill76
paulvill76 / psremoting.md
Created March 18, 2021 11:10 — forked from akrisiun/psremoting.md
Enable PSRemoting port 5985

#Run winrm quickconfig defaults echo Y | winrm quickconfig

Enter-PSSession -ComputerName 192.168.2.229 –Credential

netstat -nb | findstr /R ":80"

Remote PS port 5985

@SMSAgentSoftware
SMSAgentSoftware / Get-CurrentPatchInfo.ps1
Last active February 23, 2024 20:58
Gets the current software update level of a Windows 10/11 workstation and compares with the latest available updates. Can also list all available updates for the current build.
[CmdletBinding()]
Param(
[switch]$ListAllAvailable,
[switch]$ExcludePreview,
[switch]$ExcludeOutofBand
)
$ProgressPreference = 'SilentlyContinue'
Function Get-MyWindowsVersion {
[CmdletBinding()]