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
$HyperVHosts = @('NodeHV1','NodeHV2') | |
$IPAddress = '10.2.3' | |
$SelectObjectFilter = @( | |
@{name = 'VMName'; e={$PSItem.VMName}}, | |
@{name = 'ComputerName';e={$PSItem.ComputerName}}, | |
@{name = 'IPAddress';e={$PSItem.IPAddresses}}, | |
@{name = 'SwitchName';e={$PSItem.SwitchName}}, | |
@{name = 'MacAddress';e={$Psitem.MacAddress}} | |
) |
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-ClusterNodeMemory { | |
<# | |
.Synopsis | |
Get the available memory of each node in a cluster. | |
.DESCRIPTION | |
Get the available memory of each node in a cluster particularly for Hyper-V. | |
.PARAMETER Cluster | |
Provide Cluster Name. Will accept an array of cluter names |
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
____ _ _ | |
| _ \| | __ _ ___| |_ ___ _ __ | |
| |_) | |/ _` / __| __/ _ \ '__| | |
| __/| | (_| \__ \ || __/ | | |
|_| |_|\__,_|___/\__\___|_| | |
v1.1.3 | |
================================================== | |
Author (Mateusz Czerniawski): | |
Name of your module: TestModule1 | |
Version Number (0.0.1): |
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
$PlasterTemplatePath = 'Path to PPoshModule template folder' #Path to where you've downloaded this module | |
$DestinationPath = 'C:\AdminTools\ModuleTest1' #Path to your git repository folder | |
Invoke-Plaster -TemplatePath $PlasterTemplatePath -DestinationPath $DestinationPath |
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-ClusterCSVUsage { | |
<# | |
.SYNOPSIS | |
Retrieves CSV detailed information from Cluster | |
.DESCRIPTION | |
Will connect to cluster using Invoke-Command (to allow use of optional Credential Parameter) and retrieve detailed information on any CSV found | |
.PARAMETER Cluster | |
Cluster Name or array of Cluster Names |
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-PrivilegedGroupChanges { | |
<# | |
.SYNOPSIS | |
Will check for changes in Privileged Groups using Replication Metadata | |
.DESCRIPTION | |
Will return all members of Groups with 'AdminCount=1' that changed within last $Hours. Can target other domains - require ComputerName and Credential parameter then. | |
.PARAMETER ComputerName | |
Domain Controller of another domain. Provide FQDN name |
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-PrivilegedUsers { | |
<# | |
.SYNOPSIS | |
Returns all users belonging to Privileged Groups in Domain | |
.DESCRIPTION | |
Will return all members of Groups with 'AdminCount=1'. Can target other domains - require ComputerName and Credential parameter then. | |
.PARAMETER ComputerName | |
Domain Controller of another domain. Provide FQDN name |
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
$CloudFlareAPIToken = 'YOURTOKENGOESHERE' | |
$CloudFlareEmailAddress = 'YOUREMAIL AKA YOUR LOGIN' | |
$CloudFlareBaseUrl = 'https://api.cloudflare.com/client/v4/zones' | |
$CloudFlareHeaders = @{ | |
'X-Auth-Key' = $CloudFlareAPIToken | |
'X-Auth-Email' = $CloudFlareEmailAddress | |
} |
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-CloudFlareFullZonesConfiguration { | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory = $true, HelpMessage = 'Provide your CloudFlare API token', | |
ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[ValidateNotNullOrEmpty()] | |
[string] | |
$CloudFlareAPIToken, |
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
$ComputerName = 'nbmczerniawski2' | |
$DNComputer = Get-ADComputer $computerName | Select-Object -ExpandProperty DistinguishedName | |
$obj = get-adobject -Filter {objectclass -eq 'msFVE-RecoveryInformation'} -SearchBase $DNComputer -Properties 'msFVE-RecoveryPassword' | Select-Object Name,msFVE-RecoveryPassword | |
[Ordered]@{ | |
ComputerName = $ComputerName | |
RecoveryPassword = $obj.'msFVE-RecoveryPassword' | |
Date = Get-Date -Date ($obj.Name ).Split('{')[0] | |
KeyID = (($obj.Name ).Split('{')[1]).TrimEnd('}') | |
} |