Day: June 29, 2011

PowerShell–AD Module

Searching AD for a specific attribute using the get-aduser function from the ActiveDirectory PowerShell module. First the ActiveDirectory module needs to be loaded.  You can check to see if the module is available by typing: Get-Module -listavailable If you don’t see the ActiveDirectory module you will need to download the RSAT.  To load the module […]

PowerShell–Get ACL with a readable path

When you want to run the Get-Acl cmdlet against a directory, the path property in the results is a bit messy.  Example: Get-Childitem C:\Labs -recurse | Get-Acl | Format List Path, Owner, Access We can clean up the Path property by using a custom label with a substring Get-Childitem C:\Labs -recurse | Get-Acl | Format […]

Powershell–Comparing processes

This week I am teaching a PowerShell v2.0 class at Benchmark Learning.  During the class I usually show the following demo. # Get the current running processes $Baseline = Get-Process # Create some new processes Calc Notepad # Capture the current running processes $Now = Get-Process # Compare the two variables Compare-Object $Baseline $Now The […]