What's your favored Powershell command or manuscript for system management?
This is even more of a strategy than a certain cmdlet or function, yet my favored PS point is object building and construction :
$foo=""|select bar, baz, gronk|ft
bar baz gronk ----- ----- ------
which comes in handy for transforming disorganized information right into a set of things for more handling.
In enhancement to Get - Member, I would certainly need to claim Add - Member and also New - Object which offer you the capacity to make use of the Extensible Type System.
Having the ability to add participants to any kind of object any time permits you to get the specific details you require with the capacity to arrange it, team it, cut it, dice it, export it, or whatever you intend to perform with it.
I did simply a tiny method that i included in my Profile. See http://blog.keystroke.ch/2007/08/30/diskusage-in-powershell/.
is my prefered command.
I such as having a manuscript for locating ADVERTISEMENT customers:
$strFilter = "(&(objectCategory=User)(sAMAccountName=[USERNAME]))"; $objSearcher = New-Object System.DirectoryServices.DirectorySearcher; $objSearcher.SearchRoot = "LDAP://dc=[AD_Location]"; $objSearcher.Filter = $strFilter; $objSearcher.SearchScope = "Subtree"; $objSearcher.FindALL()