PowerShell Scripting Active Directory BasicsIntroduction to PowerShell Scripting - Active Directory
˚
Answer for: Example 4: Adding a Foreach LoopPre-requisites
# PowerShell Answer! Learning PointsNote 1: By adding a filter, you can fine tune the output. This should result in a lower total as displayed by: Note 2: Observe the dollar sign in front of $Null. $Null is a special PowerShell variable. Omit the dollar and it does not work. Note 3: Going back to basics, PowerShell uses minus eq and not an equals sign. -eq would be correct. My point is that the negative, not equal, is -ne (and not -neq).
˚
Summary of PowerShell and Active DirectoryIt was with much relief that I discovered that PowerShell supplied a mechanism to query Active Directory. The secret is starting with new-object, then choosing the specific Com objects, DirectoryServices.DirectoryEntry and DirectoryServices.DirectorySearcher. See more Microsoft PowerShell tutorials:• PowerShell Home • Com • Shell Application • Active Directory • QAD Snap-in • Get-Member Please write in if you see errors of any kind. Please report any factual mistakes, grammatical errors or broken links, I will be happy to not only to correct the fault, but also to give you credit.
*
|
||||||