Skip to content

Instantly share code, notes, and snippets.

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 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-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 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-UserByAlias {
<#
.Synopsis
Get users by alias (samAccountName)
.Description
Using ADSI, get users based on samAccountName.
.Example
function Get-FileHashFull
{
<#
.Synopsis
Recursive hash of files in a given path.
.Description
Recursive hash of files in given path, if specified with '-recurse'.
.Example
Get-FileHashFull -PathToHash c:\users\public\desktop -Recurse
function Get-VTFileReport
{
<#
.Synopsis
Get report from VT for given hash
.Description
Get report from VT for given hash
.Example
> Get-VTFileReport -ResourceHash ca67998f344b7a697cbf815e740a6272 -VTApiKey $myKey
function Remove-ConstrainedLanguageMode {
<#
.Synopsis
Set language mode for a powershell session to 'full'.
.Description
Set language mode for a powershell session to 'full'. Leverages 'InstallUtil'
and the Microsoft.Diagnostics.Runtime.dll resouces to adjust in memory values.
.Example
# Event data after netlogon semaphoreAcquires >=1 added...
Event filter with query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance Isa "Win32_PerfFormattedData_Counters_Netlogon" AND TargetInstance.Name="_Total" AND TargetInstance.SemphoreAcquires >=1" could not be reactivated in namespace "//./root/CIMV2" because of error 0x80041002. Events cannot be delivered through this filter until the problem is corrected.
@jschell
jschell / get-dateTime.ps1
Created September 23, 2015 23:55
ISO8601 dateTime
function get-dateTime
{
<#
.Synopsis
Returns ISO8601 date time format representation of current time.
.Description
At minimum, returns string with date as YYYY, mm, dd and time as HH, MM (24 hour time). Parameters allow for seconds and timezone of current locale to be returned.
.Parameter Format