A small collection specialised scripts for Active Directory.
Includes:
- Compare-ADMemberOf
- Get-ADSystemInfo
- Get-GroupMemberTree
- Get-LdapObject
- Get-MemberOfTree
- Test-LdapSslConnection
| using module ActiveDirectory | |
| using namespace System.Reflection | |
| function Convert-ADFilter { | |
| <# | |
| .SYNOPSIS | |
| Converts PowerShell-style filters used by the AD module into LDAP filters. | |
| .DESCRIPTION | |
| Convert-ADFilter uses the QueryParser from the AD module to convert PowerShell-style filters into LDAP |
| using namespace System.Collections.Generic; using namespace System.Linq | |
| function Get-FileEncoding { | |
| <# | |
| .SYNOPSIS | |
| Attempt to determine a file type based on a BOM or file header. | |
| .DESCRIPTION | |
| This script attempts to determine file types based on a byte sequence at the beginning of the file. | |
| If an identifiable byte sequence is not present the file type cannot be determined using this method. |
| $Path = 'c:\temp\test.long' | |
| $content = [Byte[]]::new(50MB) | |
| [Array]::Copy( | |
| [Byte[]][Char[]]'Hello world', | |
| 0, | |
| $content, | |
| 10, | |
| 11 | |
| ) |
| function Test-RpcPort { | |
| <# | |
| .SYNOPSIS | |
| Enumerates and tests connectivity to the RPC ports on the target server. | |
| .DESCRIPTION | |
| Enumerates and tests connectivity to the RPC ports on the target server. | |
| Rebuilt from https://gallery.technet.microsoft.com/Test-RPC-Testing-RPC-4396fcda | |
| #> |
| <# | |
| Prerequisites: PowerShell v5.1 and above (verified; may also work in earlier versions) | |
| License: MIT | |
| Author: Michael Klement <[email protected]> | |
| DOWNLOAD and DEFINITION OF THE FUNCTION: | |
| irm https://gist.github.com/mklement0/9e1f13978620b09ab2d15da5535d1b27/raw/Time-Command.ps1 | iex |
A small collection specialised scripts for Active Directory.
Includes:
| #requires -version 5 | |
| <# | |
| .SYNOPSIS | |
| High Performance Powershell Module Installation | |
| .DESCRIPTION | |
| This is a proof of concept for using the Powershell Gallery OData API and HTTPClient to parallel install packages | |
| It is also a demonstration of using async tasks in powershell appropriately. Who says powershell can't be fast? | |
| This drastically reduces the bandwidth/load against Powershell Gallery by only requesting the required data | |
| It also handles dependencies (via Nuget), checks for existing packages, and caches already downloaded packages |