Etiket arşivi: Windows PowerShell

Exchange Server 2010′da maillere Powershell ile otomatik imza ekleme

Exchange Server 2010 ile birlikte gelen yeni özelliklerden bir tanesi de maillere artık otomatik imza eklenebiliyor olması. Active Directory içersinden kullanıcı bilgilerini çekerek, imzalara basmanız, şirket logonuzu yerleştirmeniz mümkün. Transport rule altında bulacağınız imza ekleme kuralını, daha hızlı ve kolay bir şekilde yapabilmeniz için Powershell komutlarını gösteriyorum.

New-TransportRule -Name 'Signatures' -Comments 'Signatures for Inside Organization' -Priority '0' -Enabled $true -FromScope 'InOrganization' 
-ApplyHtmlDisclaimerLocation 'Append' -ApplyHtmlDisclaimerText '</br></br>
<div style="font-size:11pt;  font-family: ''Calibri'',sans-serif;">
<div><img alt="yusufozturk"  src="http://www.yusufozturk.info/logo.png"></br>
</br></div>
%%displayname%%
</br>
MCSE+S
</br></div>' -ApplyHtmlDisclaimerFallbackAction 'Wrap'

İmzalarda isim soyisim çıkması için %%displayname%% kullandım. İmzalarda kullanabileceğiniz kullanıcı bilgilerini diğer postta belirteceğim.

Reassociating a VMHost in a Cluster on SCVMM 2008 R2 with Powershell

You can’t remove or update vmhosts if they are in Cluster on SCVMM 2008 R2. For that reason, you have to update hosts with Powershell. If you are getting “Access Denied” message from your hosts, you can reassociate them with Powershell:

1
2
$Credential = Get-Credential
Get-VMMManagedComputer | where {$_.State -eq "AccessDenied"} | Reassociate-VMMManagedComputer -Credential $Credential

After that, just update vmhost using SCVMM. Host will be ready.

Appending signature to emails on Exchange Server 2010 with Powershell

With a new feature of Exchange Server 2010, now you can append signature or disclaimer messages to emails. You should create a new Transport rule to do this. Also there is an easy way to do this with Powershell:

New-TransportRule -Name 'Signatures' -Comments 'Signatures for Inside Organization' -Priority '0' -Enabled $true -FromScope 'InOrganization' 
-ApplyHtmlDisclaimerLocation 'Append' -ApplyHtmlDisclaimerText '</br></br>
<div style="font-size:11pt;  font-family: ''Calibri'',sans-serif;">
<div><img alt="yusufozturk"  src="http://www.yusufozturk.info/logo.png"></br>
</br></div>
%%displayname%%
</br>
MCSE+S
</br></div>' -ApplyHtmlDisclaimerFallbackAction 'Wrap'

I used %%displayname%% to add my name.

How to enter Exchange Server 2010 Product Key with Powershell?

If you don’t want to use Exchange Management Console, you can use Powershell:

Set-ExchangeServer -Identity '%Name%' -ProductKey '%ProductKey%'

So simple but important command for me 🙂 You need to restart “Information Store” service.

Autodiscover configuration for Hosted Exchange 2010 on Powershell

You need to create an Autodiscover directory in IIS and configure it. What I do with this script is creating that directory and configuring for redirection.

1
2
3
4
5
6
7
8
New-Item "C:\inetpub\Autodiscover_redirect" -type Directory
New-Item "C:\inetpub\Autodiscover_redirect\Autodiscover" -type Directory
New-Item "C:\inetpub\Autodiscover_redirect\Autodiscover\Autodiscover.xml"type File
Import-Module WebAdministration
Remove-WebBinding -Name “Default Web Site” -BindingInformation *:80:
New-ItemProperty IIS:\Sites\”Default Web Site” -name bindings -value @{protocol="http";bindingInformation="*:80:mail.yusufozturk.info"}
New-Item IIS:\Sites\Autodiscover -bindings (@{protocol="http";bindingInformation="*:80:"}) -PhysicalPath “C:\inetpub\Autodiscover_redirect"
Set-WebConfiguration -filter /system.webServer/httpRedirect -value (@{enabled="True"; destination="autodiscover.yusufozturk.info"}) -PSPath IIS:\ -location Autodiscover

You won’t get any SSL error on Outlook after changes.

How to enable Outlook Anywhere on Exchange Server 2010 with Powershell?

An easy way to enable Outlook Anywhere on Microsoft Exchange Server 2010 with Powershell:

Enable-OutlookAnywhere –ExternalHostname ‘mail.yusufozturk.info’ –SSLOffloading $false
-DefaultAuthenticationMethod ‘Basic’

You can set authentication method as Basic or NTLM.