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
<# | |
HTML Server Disk Usage Report Script | |
Kevin Kirkpatrick | |
www.vmotioned.com | |
Created 7/31/2013 | |
This report, as currently written, is meant to create and save the HTML report in a location of your Choosing. | |
If attaching the HTML report is desired, edit the EMail settings attachemtn location variable and go to the | |
bottom of the script and un-comment the attachment options. | |
#> |
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
[cmdletbinding()] | |
param ( | |
[parameter(mandatory = $true)] | |
[string[]]$Servers | |
) | |
$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
<# | |
.SYNOPSIS | |
Returns information about the Processor via WMI. | |
.DESCRIPTION | |
Information about the processor is returned using the Win32_Processor WMI class. | |
You can provide a single computer/server name or supply an array/list. | |
.PARAMETER Computers |
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
[cmdletbinding()] | |
param( | |
[parameter(mandatory=$true)] | |
[int]$NumHyperCores | |
) | |
$Log = "C:\CPUStressTest.ps1.log" | |
$StartDate = Get-Date | |
Write-Output "============= CPU Stress Test Started: $StartDate =============" >> $Log | |
Write-Output "Started By: $env:username" >> $Log |
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-NetStat | |
{ | |
<# | |
.SYNOPSIS | |
This function will get the output of netstat -n and parse the output | |
.DESCRIPTION | |
This function will get the output of netstat -n and parse the output. | |
Credit goes to PowerShell MVP Francois-Xavier Cat, who wrote the orignial function to parse the output of netstat.exe -n. | |
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-WinProductKey { | |
$map="BCDFGHJKMPQRTVWXY2346789" | |
$value = (get-itemproperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion").digitalproductid[0x34..0x42] | |
$ProductKey = "" | |
for ($i = 24; $i -ge 0; $i--) { | |
$r = 0 | |
for ($j = 14; $j -ge 0; $j--) { | |
$r = ($r * 256) -bxor $value[$j] | |
$value[$j] = [math]::Floor([double]($r/24)) | |
$r = $r % 24 |
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
[cmdletbinding(PositionalBinding = $true, | |
DefaultParameterSetName = "Default")] | |
param ( | |
[parameter(mandatory = $false, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true, | |
Position = 0)] | |
[alias('Comp', 'Name', 'DNSHostName')] | |
[string[]]$ComputerName = 'localhost' | |
) |
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
<# | |
.DESCRIPTION | |
Load appropriate PowerCLI PSSnapins. These are based on PowerCLI 5.8 R1. | |
#> | |
[cmdletbinding()] | |
param() | |
PROCESS { | |
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
<# | |
A more complete function can be found in my PowerCLI 'prod' repo at: | |
https://github.com/vMotioned/PowerCLI/blob/master/Get-VMToolsBuildToVersionMapping.ps1 | |
#> | |
Invoke-RestMethod -Method Get -Uri 'http://packages.vmware.com/tools/versions' |
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
(Get-WMIObject -ComputerName $computer -Class win32_UserProfile -Filter "SID = $SID").delete() |
OlderNewer