Windows Server 2012 – PowerShell WebAccess

Import-Module ServerManager
Install-WindowsFeature WindowsPowerShellWebAccess
Get-Help *pswa*

#For testing only:
Install-PswaWebApplication -UseTestCertificate
Add-PswaAuthorizationRule * * *

# In reality, buy a certification and configure some security:
# Add-PswaAuthorizationRule -ComputerName SERVER-NAME-001
# Add-PswaAuthorizationRule -UserGroupName SECURITY-GROUP-001
# Add-PswaAuthorizationRule -ConfigurationName WHAT-CMDLETS-POLICY



Exchange – Device Related Cmdlets

Exchange 2010 – Get-ActiveSyncDevice:

Exchange 2013 – Get-MobileDevice:


Get-ActiveSyncDevice is deprecated for Get-MobileDevice.
A Task-Based Guide to Windows PowerShell Cmdlets:

PowerShell – Fun With Loading $Profile

If you run $profile, you will get a path returned similar to the following:

If you have a .ps1 with the file name, you can pre-load or execute scripts upon launching PowerShell.

For example, check out the following. PowerShell can greet you based on the time of day:

Add-Type -AssemblyName System.Speech
$name = [Environment]::UserName
$theTime = (Get-Date).Hour

if ($theTime -le 12)
       [string]$theGreeting = "Good morning "
if (($theTime -ge 12) -and ($theTime -le 18))
     [string] $theGreeting = "Good afternoon "
if (($theTime -ge 19) -and ($theTime -le 24))
      [string]$theGreeting = "Good evening "

$theVoice = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer 
$theVoice.Speak("$theGreeting $name")


Powershell – Disable Windows Firewall

Older netsh advfirewall set allprofiles state off is to be deprecated in favor of PowerShell.

For testing, you can disable all Windows Firewall Profiles with the following PowerShell commands:

Import-Module NetSecurity
Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled False

To re-enable:

Get-NetFirewallProfile | Set-NetFirewallProfile -Enabled True