Lessons Learned

My drop-site for interesting snippets and tips. If it's useful to you as well, great!

Browse by Tags

Tagged Content List
  • Blog Post: Enabling and Disabling Users

      All good things must come to an end.  Sometimes, users become ex-users.  Here’s a quick-and-dirty way to check. One notable line here is: [bool] ( ( $_ . UserAccountControl . ToString ( )   -as   [int] )   -band   2 ) ; With AD, the second bit from the right is the...
  • Blog Post: PowerShell for Non-N00bs: [PSObject]::AddNodeProperty - the Missing Link

    We all know PSH can output objects. When the cmdlets or input give it objects to work with, outputting objects is easy. However, when the program is dealing in strings and objects are required, things get long. PS> $psobject = New-Object PSObject PS> Add-Member -MemberType NoteProperty -InputObject...
  • Blog Post: PowerShell for Non-N00bs: [PSObject]::AddNodeProperty - the Missing Link

    We all know PSH can output objects. When the cmdlets or input give it objects to work with, outputting objects is easy. However, when the program is dealing in strings and objects are required, things get long. PS> $psobject = New-Object PSObject PS> Add-Member -MemberType NoteProperty -InputObject...
Page 1 of 1 (3 items)