Tuesday, 6 May 2014

Set exchange URLs OWA ActiveSync OAB Autodiscover


Change Internal URLs for all Services



$urlpath = Read-Host "Type internal Client Access FQDN starting with http:// or https://"

Set-AutodiscoverVirtualDirectory -Identity * –internalurl “$urlpath/autodiscover/autodiscover.xml”

Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath/autodiscover/autodiscover.xml”

Set-webservicesvirtualdirectory –Identity * –internalurl “$urlpath/ews/exchange.asmx”

Set-oabvirtualdirectory –Identity * –internalurl “$urlpath/oab”

Set-owavirtualdirectory –Identity * –internalurl “$urlpath/owa”

Set-ecpvirtualdirectory –Identity * –internalurl “$urlpath/ecp”

Set-ActiveSyncVirtualDirectory -Identity * -InternalUrl "$urlpath/Microsoft-Server-ActiveSync"



#get commands to  to doublecheck the config
 

get-AutodiscoverVirtualDirectory | ft identity,internalurl

get-ClientAccessServer | ft identity,AutodiscoverServiceInternalUri

get-webservicesvirtualdirectory | ft identity,internalurl

get-oabvirtualdirectory | ft identity,internalurl

get-owavirtualdirectory | ft identity,internalurl

get-ecpvirtualdirectory | ft identity,internalurl

get-ActiveSyncVirtualDirectory | ft identity,internalurl





Change External URLs for all Services


$urlpath2 = Read-Host "Type External Client Access FQDN starting with http:// or https://"

Set-AutodiscoverVirtualDirectory -Identity * –externalurl “$urlpath2/autodiscover/autodiscover.xml”

Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath2/autodiscover/autodiscover.xml”

Set-webservicesvirtualdirectory –Identity * –externalurl “$urlpath2/ews/exchange.asmx”

Set-oabvirtualdirectory –Identity * –externalurl “$urlpath2/oab”

Set-owavirtualdirectory –Identity * –externalurl “$urlpath2/owa”

Set-ecpvirtualdirectory –Identity * –externalurl “$urlpath2/ecp”

Set-ActiveSyncVirtualDirectory -Identity * -ExternalUrl "$urlpath/Microsoft-Server-ActiveSync"



#get commands to  to doublecheck the config

get-AutodiscoverVirtualDirectory | fl identity,internalurl, externalurl

get-ClientAccessServer | fl identity,AutodiscoverServiceInternalUri

get-webservicesvirtualdirectory | fl identity,internalurl,externalurl

get-oabvirtualdirectory | fl identity,internalurl,externalurl

get-owavirtualdirectory | fl identity,internalurl,externalurl

get-ecpvirtualdirectory | fl identity,internalurl,externalurl

get-ActiveSyncVirtualDirectory | fl identity,internalurl,externalurl

Monday, 18 February 2013

Friday, 6 July 2012

Adding few more Exchange Powershell Scripts...

To get the list of mailbox users Statistics:


Get-content C:\Users.txt | Get-MailboxStatistics | select displayname,LastLogonTime, LastLogoffTime,LastLoggedOnUserAccount,database, TotalItemSize> c:\result.txt


TXT file Format:
Test Mail
Test Mail1


You can add some more stings if you need: ItemCount, DisconnectDate, DeletedItemCount


To find Manual quota is defined or not for Bulk users:


Copy below script into txt file and change into .ps1
----------------------------
$CSV = Import-Csv "C:\Powershell\quota.csv"
$csv | Foreach {
$Indentity = $_.Alias
get-mailbox -Identity $_.Alias | Where {$_.UseDatabaseQuotaDefaults -eq $false}
}
--------------------------
CSV Format:
Alias
Test.user1
Test.user2




To get the list of mailbox users Statistics:


Get-content C:\Users.txt | Get-MailboxStatistics | select displayname,LastLogonTime, LastLogoffTime,LastLoggedOnUserAccount,database, TotalItemSize> c:\result.txt


TXT file Format:
Test Mail
Test Mail1


You can add below stings if you need: ItemCount, DisconnectDate, DeletedItemCount




To find Manual quota is defined or not for Bulk users:


Copy below script into txt file and change into .ps1


------------------------------
$CSV = Import-Csv "C:\Powershell\quota.csv"
$csv | Foreach {
$Indentity = $_.Alias
get-mailbox -Identity $_.Alias | Where {$_.UseDatabaseQuotaDefaults -eq $false}
}
-----------------------------


CSV Format:
Alias
Test.User1
Test.user2


Get Database Quota Result for all Mailbox servers:
Get-MailboxDatabase | Select-Object ServerName,Name,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota | Sort-Object Name | Export-Csv d:\DatabaseLimits.csv –NoTypeInformation




Apply Quota for Bulk Database:
Copy below to TXT file and convert into .PS1
----------------
$csv = import-csv "C:\Powershell\DB\DB.csv"
$csv | Foreach {
Set-MailboxDatabase-Identity $_.DB -IssueWarningQuota 900MB-ProhibitSendQuota 1024MB-ProhibitSendReceiveQuota 8192MB
}
---------------
CSV Format:
DB
EXCH01\SG1\MBXStore1
EXCH02\SG2\MBXStore2
EXCH03\SG3\MBXStore3


ActiveSync users list with Policyname and server:


Get-CASMailbox -Filter {ActiveSyncMailboxPolicy -eq $ActiveSyncPolicyName} |ft Displayname, ActiveSyncMailboxPolicy, Servername


Active Sync users search by Policy Name:
Get-CASMailbox | where{$_.activesyncmailboxpolicy -match“Default”} | ft Displayname



Hope this help!!!