Month: June 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 […]

Read More..

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 […]

Read More..

Using PowerShell to get Share and NTFS permissions

I am teaching a class this week at Benchmark Learning and had a great student question. “How do I get share permissions AND NTFS permissions” Well, look no further. The Get-SharePermission function was found here: http://social.technet.microsoft.com/Forums/en-ZA/ITCG/thread/64cabd85-7170-4678-96b5-2c516cc3b772 function Get-SharePermission { Param($Server = $env:COMPUTERNAME) $ShareSecurity = Get-WmiObject win32_LogicalShareSecuritySetting -ComputerName $Server foreach($Share in $ShareSecurity) { $sharenames = $Share.Name […]

Read More..