This file contains hidden or 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 Show-SessionStateDemo | |
{ | |
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
$Server, | |
[Parameter()] | |
$Database, |
This file contains hidden or 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
# This should only be used in a development environment and is for demonstration purposes only | |
# Use at your own risk | |
# This adds an attribute to the user class | |
# Written by Andy Schneider, http://get-powershell.com | |
Function New-OID { | |
$Prefix="1.2.840.113556.1.8000.2554" | |
$GUID=[System.Guid]::NewGuid().ToString() | |
$Parts=@() | |
$Parts+=[UInt64]::Parse($guid.SubString(0,4),"AllowHexSpecifier") |
This file contains hidden or 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 ADuserCompletion { | |
[ArgumentCompleter( | |
Parameter = 'Identity', | |
Command = { Get-CommandWithParameter -Module ActiveDirectory -Noun ADUser -ParameterName Identity }, | |
Description = 'Complete AD Users')] | |
param($commandName,$parameterName,$wordToComplete,$commandAst,$fakeBoundParameter) | |
if ($wordToComplete -eq "") {$filter = "(ObjectClass=User)"} | |
else {$filter = "(&(ObjectClass=User)(ANR=$wordToComplete))"} | |
Get-ADuser -LDAPFilter $filter | sort SamAccountname | |