This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Out-JSONView { | |
[cmdletbinding()] | |
Param ( | |
[parameter(ValueFromPipeline)] | |
[psobject]$InbutObject, | |
[int]$Depth = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cinst sharepointdesigner2013x64 | |
cinst visualstudio2015community | |
cinst visualstudiocode | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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 = @() |
NewerOlder