Difference between revisions of "Powershell Commands"

From GWAVA Technologies Training
Jump to: navigation, search
Line 30: Line 30:
  
 
===EWS===
 
===EWS===
This script shows the
+
This script shows if Basic Authentication was enabled for EWS.
 +
 
 
<code>
 
<code>
 
Get-WebServicesVirtualDirectory | ft server,basicauthentication
 
Get-WebServicesVirtualDirectory | ft server,basicauthentication
 +
</code>
 +
 +
To enable Basic Authentication you can use this script if you are a Domain or higher admin.
 +
 +
<code>
 +
Set-WebServicesVirtualDirectory -Identity "EWS (Default Web Site)" -BasicAuthentication $true
 +
</code>
 +
 +
===AutoDiscover===
 +
This script shows if Basic Authentication was enabled for AutoDiscover.
 +
 +
<code>
 +
Get-AutoDiscoverVirtualDirectory | ft server,basicauthentication
 +
</code>
 +
 +
To enable Basic Authentication you can use this script if you are a Domain or higher admin.
 +
 +
<code>
 +
Set-AutodiscoverVirtualDirectory -Identity 'autodiscover (Default Web Site)' -BasicAuthentication $true
 +
</code>
 +
 +
==IIS==
 +
To restart IIS from Powershell:
 +
 +
<code>
 +
IISRESET
 
</code>
 
</code>

Revision as of 20:01, 6 October 2015

Useful Powershell commands

Contents

Users and Mailbox Items

A quick overview of users and how many items they have in their mailbox:

Get-Mailbox | Get-MailboxStatistics

For more detail add "| FL" but it would be best to pipe to a file

Get-Mailbox | Get-MailboxStatistics | FL > c:\stats.txt

Queues

An Exchange server can become bogged down if the queues cannot clear. You can see the queue status with:

Get-Queue

If there are thousands of message (e.g. in \Unreachable) and they are not clearing then there is an issue. You can open Exchange Toolbox and in Queue Viewer delete messages. If that is not successful then you need to restart the Microsoft Exchange Edge Transport, Microsoft Exchange Mailbox Transport Delivery and/or SMTP services

Basic Authentication

Retain needs Basic Authentication enabled across the system not just on one CAS.

EWS

This script shows if Basic Authentication was enabled for EWS.

Get-WebServicesVirtualDirectory | ft server,basicauthentication

To enable Basic Authentication you can use this script if you are a Domain or higher admin.

Set-WebServicesVirtualDirectory -Identity "EWS (Default Web Site)" -BasicAuthentication $true

AutoDiscover

This script shows if Basic Authentication was enabled for AutoDiscover.

Get-AutoDiscoverVirtualDirectory | ft server,basicauthentication

To enable Basic Authentication you can use this script if you are a Domain or higher admin.

Set-AutodiscoverVirtualDirectory -Identity 'autodiscover (Default Web Site)' -BasicAuthentication $true

IIS

To restart IIS from Powershell:

IISRESET

Personal tools
Namespaces

Variants
Actions
Home
Exchange
GroupWise
JAVA
Linux
MTK
Retain
GW Monitoring and Reporting (Redline)
GW Disaster Recovery (Reload)
GW Forensics (Reveal)
GWAVA
Secure Messaging Gateway
GW Mailbox Management (Vertigo)
Windows
Other
User Experience
Toolbox
Languages
Toolbox