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-CimInstance -ClassName Win32_LogicalDisk -ComputerName localhost -Filter 'DriveType = 3' -Property DeviceID,Size,FreeSpace | | |
Select-Object -Property @{Name="Drive";Expression={$_.DeviceID}}, | |
@{Name="Size(GB)";Expression={"{0:N2}" -f ($_.Size/1GB)}}, | |
@{Name="FreeSpace(MB)";Expression={"{0:N2}" -f ($_.FreeSpace/1MB)}} | | |
ConvertTo-Html -Property Drive,'Size(GB)','FreeSpace(MB)' ` | |
-Head "<title>Disk Free Space Report</title><h2>Local Fixed Disk Report</h2>" ` | |
-PostContent "<hr>",(Get-Date) | | |
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 Ping-SYHost ([string] $hostName) { | |
<# | |
.SYNOPSIS | |
Tests server availability by using PING command. | |
.DESCRIPTION | |
This script will ping a host and return TRUE/FALSE. Use this function to determine if the host is reachable. | |
.EXAMPLE | |
Ping-SYHost -hostName "CHAGRES01" |
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 | |
This will export info on 20 randomly selected AD users to an html | |
file located on the desktop of the user running it. | |
It will provide the username, department, title, last logon time, | |
last password change and account enabled / lockout status sorted by user. | |
***Notes*** | |
It will import the AD module in order to use Get-ADUser. |
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
#Requires -Version 3.0 -Module ActiveDirectory | |
<# | |
.SYNOPSIS | |
Create a report of randomly selected Active Directory users to be provided to auditors. | |
.DESCRIPTION | |
Randomly sample all Active Directory user accounts and create an html report of the | |
following properties: SamAccountName, Department, Title, LastLogonDate, PasswordLastSet, Enabled, LockedOut | |
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 | |
Gets the Unique IP Information from a directory of *.log files. | |
.DESCRIPTION | |
This script was written for the Event 5 Beginners Track in the 2013 Scripting Games. | |
It will look through IIS logs in a directory and all sub directories and pull out a | |
list of unique ip's. | |
.PARAMETER PathToLogs | |
Path to the Log files (Example C:\Temp\LogFiles\) | |
.EXAMPLE |
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 | |
Gets client IP collection from IIS logs | |
.DESCRIPTION | |
Extracts the Client IP addresses from IIS logs, and returns the unique addresses | |
found. Optionally, it will include counts of how many times each address appeared | |
in the logs, by enabling the -Count switch. If -Count is enabled you can return either | |
a collection of PS objects having ClientIP and Count properties, or a hash table of the | |
ip addresses and counts by using the -AsHash switch. | |
.PARAMETER Path |
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
# Requires -Version 3.0 | |
<# | |
.SYNOPSIS | |
This script is used to perform basic configuration tasks on one or many Server 2012 core installations. | |
.DESCRIPTION | |
New-CoreVMConfig is a script that will import a list of MAC addresses located at C:\Mac.txt by default and then query the DHCP server using the DhcpServer module | |
introduced in PowerShell 3.0 and Server 2012 to determine its associated dynamically assigned IP address. When these results have been gathered we will process | |
each IP address one at a time, joining the machine to the domain. During the join operation we will also be renaming the machine to SERVER(count) as well as | |
restarting the machine after the join is completed. This operation will force the join and will not propmt the user for confirmation as defined by the event 6 |
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 Join-Computer { | |
<# | |
.SYNOPSIS | |
Adds server core machines to the domain from MAC address. | |
.DESCRIPTION | |
Takes a list of mac address and queries DHCP server for IP address. | |
Machines are then renamed and joined to the domain. | |
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-CMMissingUpdate { | |
param ( | |
$computer = "localhost" | |
) | |
Get-WmiObject -Query "SELECT * FROM CCM_SoftwareUpdate" -Namespace "ROOT\ccm\ClientSDK" -ComputerName $computer | |
} |
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
#requires -version 3 | |
Function Get-CommandGridView { | |
[cmdletbinding()] | |
Param([string]$Module, | |
[ValidateRange(1,20)] | |
[int]$MaxHelpWindowCount = 5 | |
) |
OlderNewer