Skip to content

Instantly share code, notes, and snippets.

@spencermorin
spencermorin / move-wp-multisite.sql
Created June 28, 2013 20:40
Move Project Nami ( or WordPress ) multisite install to a new domain.
update wp_options set option_value='http://example.com' where option_name = 'siteurl' or option_name = 'home'
update wp_blogs set domain='example.com' where blog_id = '1' or blog_id = '2'
update wp_2_options set option_value='http://example.com/second-blog-path' where option_name='siteurl' or option_name='home'
update wp_site set domain='example.com' where id='1'
update wp_sitemeta set meta_value='http://example.com' where meta_key='siteurl'
@proxb
proxb / Example2Runspace.ps1
Created August 10, 2015 00:58
Example 2 showing synchronized collections
# Create an array of computers to do work against
$Computers = “computer01”,”computer02”,”computer03”,”computer04”,”computer05”
# Create an empty array that we'll use later
$RunspaceCollection = @()
# This is the array we want to ultimately add our information to
$qwinstaResults = [System.Collections.ArrayList]::Synchronized((New-Object System.Collections.ArrayList))
# Create a Runspace Pool with a minimum and maximum number of run spaces. (http://msdn.microsoft.com/en-us/library/windows/desktop/dd324626(v=vs.85).aspx)
<#
.SYNOPSIS
Sets the system fields for a specific list/library item.
.DESCRIPTION
This will set the system fields (created, created by, modified, modified by)
for a specific list/library item.
Provide any or all of those system fields as a parameter and they will be set.
If no modified date is provided, the item keeps its current modified date.
@daviwil
daviwil / VSCodeDeepDive.md
Created April 13, 2017 13:38
The notes from my session "Authoring in VS Code" at the 2017 PowerShell and DevOps Global Summit in Bellevue, WA.

Visual Studio Code Deep Dive

David Wilson - @daviwil Software Engineer, PowerShell Team

Overview

  1. Visual Studio Code overview
  2. Configuring the editor
  3. Extensions
@jdhitsolutions
jdhitsolutions / Test-UpOrDown.ps1
Last active November 13, 2020 18:05
A PowerShell function that uses the web site DownForEveryoneOrJustme.com to test is a web site or domain is up or down
#requires -version 4.0
Function Test-UporDown {
<#
.Synopsis
Test if a web site is down or if it is just you.
.Description
The function uses the web site DownForEveryoneOrJustme.com to test is a web site or domain is up or down, or if the problem is just you. The command will write a custom object to the pipeline. See examples.
@adamdriscoll
adamdriscoll / dashboard.ps1
Created November 29, 2022 09:27
People Picker for PowerShell Universal
function Get-User {
1..100 | ForEach-Object {
[PSCustomObject]@{
UserName = "User$_"
First = "Bill"
Last = $_
Avatar = (Get-ChildItem "$Repository\Avatars" | Get-Random).Name
}
}
}
@PierrickBIT
PierrickBIT / gist:953091bb420277a73a1d7b583e268fe3
Created January 31, 2023 07:36
[MS TEAMS] Copier les fichiers d'une conversation vers une bibliothèque SharePoint 365
# Charger les bibliothèques requises
Install-Module Microsoft.Graph.Teams -Force
Install-Module Microsoft.Graph.SharePoint -Force
# Définir les informations d'identification de l'application
$clientId = "<Application ID>"
$clientSecret = "<Application Secret>"
$tenantId = "<Tenant ID>"
# Obtenir un jeton d'accès
@FriedrichWeinmann
FriedrichWeinmann / DomainCryptographyScan.ps1
Last active May 30, 2023 05:15
Scans an Active Directory domain's and its principal's kerberos encryption configuration.
<#
.SYNOPSIS
Scans an Active Directory domain's and its principal's kerberos encryption configuration.
.DESCRIPTION
Scans an Active Directory domain's and its principal's kerberos encryption configuration.
It will generate all data via LDAP, and analyze the results for possible authentication issues.
It supports three ways to report:
- Print: Write analysis of results to screen
@proxb
proxb / Example1Runspace.ps1
Created August 10, 2015 00:50
Example 1 of returning data back from a runspace
# Create an array of computers to do work against
$Computers = “computer01”,”computer02”,”computer03”,”computer04”,”computer05”
# Create an empty array that we'll use later
$RunspaceCollection = @()
# This is the array we want to ultimately add our information to
[Collections.Arraylist]$qwinstaResults = @()
# Create a Runspace Pool with a minimum and maximum number of run spaces. (http://msdn.microsoft.com/en-us/library/windows/desktop/dd324626(v=vs.85).aspx)
# Convert-ADName.ps1
# Written by Bill Stewart (bstewart@iname.com)
# PowerShell wrapper script for the NameTranslate COM object.
#requires -version 2
<#
.SYNOPSIS
Translates Active Directory names between various formats.