Computer Library windows 2008 exchange server power shell security register

Manage Large Conditional Statements with Switches

1. Problem
You want to find an easier or more compact way to represent a large if … elseif … else conditional statement.
2. Solution
Use PowerShell’s switch statement to more easily represent a large if … elseif … else conditional statement.
For example:
        $temperature = 20
 
        switch($temperature)
        {
           { $_ -lt 32 }   { “Below Freezing”; break [...]


Use Run As to Perform Administrative Tasks

Use Run As to protect your administrator workstation from Trojans and other nasties.
If you’re lazy, like I am, you probably use the default administrator account on your desktop workstation for browsing the Web, checking your email, and managing the servers on your company’s network.
Not a good idea.
What if you unknowingly visited a web page that [...]