Skip to content

Instantly share code, notes, and snippets.

Function Test-IfxTpm
{
<#
.SYNOPSIS
Tests if a Windows system has an enabled Trusted Platform Module (TPM) that is
vulnerable to CVE-2017-15361.
.DESCRIPTION
Tests if a Windows system has an enabled Trusted Platform Module (TPM) that is
vulnerable to CVE-2017-15361. Must be run with administrator privileges against
function ConvertTo-Guid
{
<#
.SYNOPSIS
Create GUID value from string input
.DESCRIPTION
Used to generate unique per string GUIDs, specifically to create matching GUIDs
for DSC node enrollment (based on known values for machine name, used as the string input)
.PARAMETER String
function Get-LastLogonInDomain
{
<#
.SYNOPSIS
Get the value of 'lastlogon' attribute from one or more user accounts
.DESCRIPTION
Collects the highest (most recent) value of 'lastlogon' from one or more domain
controllers. For completeness, this non-indexed, non-replicated attribute must
be checked against all domain controllers in the domain.
function Get-DSSelectiveAuth
{
<#
.Synopsis
Get computer objects with Selective Authentication configured.
.Description
By reading the Discretionary Acl on each computer object for the Allowed to Authenticate (Extended Right) right, a listing of objects granted the right can be built.
.Parameter Domain
function Get-OSLevelDomainController
{
<#
2017-04-27::0.1.0
-initial creation, very quick polling function to get OS Version count from Domain Controllers
#>
[CmdletBinding()]
param
function find-staleDNSDomainRecord
{
<#
2017-05-01::0.1.1
- fixed logic
- check DC addr (vs trying to resolve reverse entry)
- match _whole_ word, not partial set, so that if address are same until last octet - x.x.x.1, x.x.x.11, x.x.x.12 - only the full _exact_ match will be returned
- add try/catch for domain lookup in Begin (no need to check the rest if the name doesn't respond on ADWS)
- changed stale entry value to var set in Begin, no more missed matches after changing the string formatting
- if using 'StaleRecordsOnly' switch, array will be returned with the stale addresses only (rather than PsObject of name and ipAddress)
function Get-DSUserByProperty
{
<#
.SYNOPSIS
Search for users in the directory.
.DESCRIPTION
Using native System.DirectoryServices, searches the directory (default is to use
the global catalog) for entries that match
Function Get-FirmwareType
{
<#
.SYNOPSIS
Get local system boot type, BIOS or UEFI.
.DESCRIPTION
Uses the 'GetFirmwareType' function in kernel32.dll to determine if the local
system is configured for BIOS or UEFI boot type.
function Get-DSResponseTime
{
<#
Create 2017-01-25::0.1.0
Quick tool to view response delays on DCs
#>
[CmdletBinding()]
Param