Posted in
Exchange Server,
Windows Powershell |
No Comment | 6,244 views | 01/12/2009 02:20
Exchange Server 2010 üzerinde aşağıdaki function ile mail hesabı yaratabilirsiniz.
1
2
3
4
5
6
7
| function Add-MailUser
{
Param ($UserID, $FirstName, $LastName, $CustomerOU)
$ADDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$ADDomainName = $ADDomain.Name
Enable-Mailbox -Identity "$ADDomainName/$CustomerOU/$FirstName $LastName" -Alias "$UserID"
} |
function Add-MailUser
{
Param ($UserID, $FirstName, $LastName, $CustomerOU)
$ADDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
$ADDomainName = $ADDomain.Name
Enable-Mailbox -Identity "$ADDomainName/$CustomerOU/$FirstName $LastName" -Alias "$UserID"
}
Kullanımı:
Add-MailUser –UserID "$UserID" –FirstName "$FirstName" –LastName "$LastName" -CustomerOU "$CustomerOU" |
Add-MailUser –UserID "$UserID" –FirstName "$FirstName" –LastName "$LastName" -CustomerOU "$CustomerOU"
Function dosyası kullanmamızın en büyük faydası, mail hesabını daha hızlı bir şekilde açmak olacaktır.