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 azrdp { | |
<# | |
.Author | |
Trevor Sullivan <pcgeek86@gmail.com> | |
.Description | |
Invoke a RDP session to an Azure Virtual Machine, without having to type the | |
Cloud Service name or Virtual Machine name. | |
.Outputs |
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 | |
The Function uses AD PS PSmodule to hunt for User accounts which have Inheritance disabled | |
.DESCRIPTION | |
In AD if the Users have Inheritance disabled on them then this Function will help you hunt those acounts | |
In addition it will also check if the Users are part of any Protected Group and report them (if any) because of | |
which the Inheritance is disabled. This is expected but sometimes the User might be part of a Group which is nested | |
member of a Protected Group, then this Function will list out all the ProtectedGroups too. | |
The Function needs AD PowerShell Module installed in order to run at the moment. |
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
@echo off | |
cd /D %~dp0 | |
if not exist "%DiagnosticStore%\LogFiles" mkdir "%DiagnosticStore%\LogFiles" | |
%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Unrestricted -File %* >> "%DiagnosticStore%\LogFiles\%~n1.txt" 2>> "%DiagnosticStore%\LogFiles\%~n1.err.txt" |
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
TRY { | |
# search for the Dll | |
Write-Verbose -Message "Creating credential object" | |
$Splathashtable = @{ | |
'Path' = "$env:windir\Microsoft.NET\assembly\"; | |
'Filter' = 'Microsoft.WindowsAzure.ServiceRuntime.dll'; | |
'Include' = '*.dll' | |
} | |
$dllfile = Get-ChildItem @Splathashtable -Recurse | Select-Object -Last 1 # selecting only one object, in case of multiple results |
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
workflow New-TestVM | |
{ | |
param( | |
# Sepcify the Azure Subscription Name | |
[parameter(Mandatory)] | |
[String] | |
$AzureSubscriptionName, | |
# Sepcify the Azure Storage Account Name to be used to store VM VHDs. | |
[parameter(Mandatory)] |
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 Test-PortReachableUsingSourceIP | |
{ | |
[CmdletBinding()] | |
[Alias()] | |
[OutputType([int])] | |
Param | |
( | |
# Specify the remote destination IPAddress. | |
[Parameter(Mandatory=$False, | |
ValueFromPipelineByPropertyName=$true, |
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 PSDeployCompletion | |
{ | |
param( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) | |
$CommandTree = Get-CompletionPrivateData -Key PSDeployCompletionCommandTree | |
if ($null -eq $CommandTree) { | |
$CommandTree = & { | |
New-CommandTree -Completion FromSource -ToolTip 'Source' -Argument | |
New-CommandTree -Completion To -ToolTip 'Destination' -Argument |
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 PSDeployCompletion | |
{ | |
param( $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) | |
$CommandTree = Get-CompletionPrivateData -Key PSDeployCompletionCommandTree | |
if ($null -eq $CommandTree) { | |
$CommandTree = & { | |
New-CommandTree -Completion FromSource -ToolTip 'Source' -Argument | |
New-CommandTree -Completion To -ToolTip 'Destination' -Argument |
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 Test-NetConnectionWithSourceAddress | |
{ | |
[CmdletBinding()] | |
[Alias('PortTestWithSource')] | |
[OutputType([Boolean])] | |
Param | |
( | |
# Specify the remote destination IPAddress. | |
[Parameter(Mandatory=$False, | |
ValueFromPipelineByPropertyName=$true, |
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
@{ | |
AllNodes = @( | |
@{ | |
# common node information hashtable | |
NodeName = '*'; # do not edit | |
SETTeamName = 'S2DSwitch'; # <Edit> name of the SET team | |
DomainDCs = @('testad.Test.lab') # <edit> the DC names (can be a single value) | |
DNSServers = @('testad.Test.lab') # <edit> the DNS names (can be a single value) | |
Domain = 'test.lab' # <edit> the domain name | |
ClusterName = 'r740-mid-s2d-cluster' # <edit> the cluster name, |