Skip to content

Instantly share code, notes, and snippets.

function Get-UserByAlias {
<#
.Synopsis
Get users by alias (samAccountName)
.Description
Using ADSI, get users based on samAccountName.
.Example
function Get-LocalMember {
<#
.Synopsis
Find the members of a local computer group.
.Description
Find the members of a local computer group, searching recursively if groups are found from a domain.
.Example
function Get-DSLDAPQueryPolicy {
<#
.Synopsis
Get LDAP query policy for the configuration naming context provided.
.Description
When LDAP query policy is applied, precendence is given to settings applied to a specific domain controller, next to settings applied to a site, finally the global defaults.
.Parameter ConfigNCInput
Specifies the Configuration Naming Context to use. By default, uses the current configuration naming context.
function Test-FSPObjects{
<#
Check a forest to make sure 'Interactive Users' and 'Authenticated Users' are present and in appropriate groups.
2016-12-22::0.1.0
- Initial creation
#>
#Requires -Modules ActiveDirectory
function Get-DSDomainIpAddress
{
<#
.Synopsis
Create list of domain controller IP Addresses (v4, v6) in either text or xml format.
.Description
Created for networking to more easily consume network information of the domain controllers. Updated to use 'System.DirectoryServices' instead of ActiveDirectory module.
.Example
function Get-DSResponseTime
{
<#
Create 2017-01-25::0.1.0
Quick tool to view response delays on DCs
#>
[CmdletBinding()]
Param
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-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 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-OSLevelDomainController
{
<#
2017-04-27::0.1.0
-initial creation, very quick polling function to get OS Version count from Domain Controllers
#>
[CmdletBinding()]
param