Skip to content

Instantly share code, notes, and snippets.

View Tiberriver256's full-sized avatar
📚
Still learning

Micah Rairdon Tiberriver256

📚
Still learning
View GitHub Profile
@Tiberriver256
Tiberriver256 / Get-OrgChart.ps1
Created August 21, 2016 03:32
Get-OrgChart
function Get-ADdirectReports
{
PARAM ($SamAccountName)
$AllUsers = @()
$Manager = Get-Aduser -identity $SamAccountName -Properties DistinguishedName,CN,co,city,DisplayName,mail
$DirectReports = Get-ADUser -Filter {Manager -eq $Manager.DistinguishedName} -Properties manager
function Show-HTML ([string]$HTML)
{
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework')
[xml]$XAML = @'
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="PowerShell HTML GUI" WindowStartupLocation="CenterScreen">
<WebBrowser Name="WebBrowser"></WebBrowser>
Function Show-Diff {
param([String[]]$OldString,[String[]]$NewString)
$WebPage = @"
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
Function Out-JSONView {
[cmdletbinding()]
Param (
[parameter(ValueFromPipeline)]
[psobject]$InbutObject,
[int]$Depth = 2
Function Start-PoshWebGUI ($ScriptBlock)
{
# We create a scriptblock that waits for the server to launch and then opens a web browser control
$UserWindow = {
# Wait-ServerLaunch will continually repeatedly attempt to get a response from the URL before continuing
function Wait-ServerLaunch
{
try {
@Tiberriver256
Tiberriver256 / Get-DNSConfiguration.ps1
Created April 19, 2016 13:33 — forked from dotps1/Get-DNSConfiguration.ps1
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
@Tiberriver256
Tiberriver256 / gist:e3664c30c5e6e1db8622
Created March 28, 2016 14:15
SharePoint Development
cinst sharepointdesigner2013x64
cinst visualstudio2015community
cinst visualstudiocode
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Connect-MsolService -credential $UserCredential
$ReportPath = "C:\filename"+ (Get-Date -UFormat %D).Replace("/",".") +".csv"
$Report = @()