Exchange Managament Shell Commands

      Yorum yok Exchange Managament Shell Commands

User Managament

<!-- allows the OU picker when placing a new mailbox in its designated organizational unit to retrieve all OUs - default value is 500 -->
<add key="GetListDefaultResultSize" value="2000" />
Get-ADUser -Filter * -SearchBase “OU=Exchange Mail Users,OU=ITMAKALE,DC=IT,DC=com” | Set-ADUser -CannotChangePassword:$false -PasswordNeverExpires:$false -ChangePasswordAtLogon:$true

Get-MailboxDatabase -Status | select Name,Databasesize,Availablenewmailboxspace

New-Mailbox -Name "isim soyadi" -UserPrincipalName SCIL1979@itmakale.com.tr -Password (ConvertTo-SecureString -String 'abcd+1234' -AsPlainText -Force) -FirstName isim -LastName soyadi -DisplayName "isim soyadi" -Database UsersMailboxDatabase-1 -OrganizationalUnit "itmakale.com.tr/BANK/Genel Mudurluk" 
Set-ADUser -Identity SCIL1979 -Company ITMAKALE 
Set-ADUser -Identity SCIL1979 -department "Bütçe ve Yasal Raporlama" -desc "Müdür" 
Set-UserPhoto "SCIL1979" -PictureData ([System.IO.File]::ReadAllBytes("C:\upload\SCIL1979.jpg")) 
Get-mailbox -Identity SCIL1979 | Set-mailbox -EmailAddressPolicyEnabled $false Get-mailbox -Identity SCIL1979 | Set-mailbox -EmailAddressPolicyEnabled $true
Get-ADUser -Filter * -SearchBase “OU=Exchange Mail Users,OU=ITMAKALE,DC=bilgim,DC=com” | Set-ADUser -CannotChangePassword:$false -PasswordNeverExpires:$false -ChangePasswordAtLogon:$true
Get-ADUser -Filter * -SearchBase “OU=Exchange Mail Users,OU=ITMAKALE,DC=bilgim,DC=com” | Set-ADUser -CannotChangePassword:$false -PasswordNeverExpires:$false -ChangePasswordAtLogon:$false

GLOBAL ADDRESS LIST CREATE & MANAGAMENT

New-AddressBookPolicy -Name “ITMAKALE Address Policy” -OfflineAddressBook “ITMAKALE-OAB" -AddressLists "ITMAKALE Varlik Adres Defteri"
New-AddressBookPolicy -Name “ITMAKALE Address Policy” -GlobalAddressList "ITMAKALE Varlik Adres Defteri" -OfflineAddressBook “ITMAKALE Address-OAB" -RoomList "ITMAKALE Toplanti Odasi" -AddressLists "ITMAKALE Varlik Adres Defteri"
New-OfflineAddressBook -Name "ITMAKALE Address-OAB" -AddressLists "All ITMAKALE Varlik Adres Defteri" -GlobalWebDistributionEnabled $true
$a = Get-AddressList | Where {$_.Name -Like "*AgencyB*"}; New-OfflineAddressBook -Name "OAB_AgencyB" -Server myserver.contoso.com -AddressLists $a -Schedule "Mon.01:00-Mon.02:00, Wed.01:00-Wed.02:00"
Get-Mailbox -ResultSize Unlimited -Filter { EmailAddresses -like "*@ITMAKALEvarlik.com" -and AddressBookPolicy -eq $null }
Get-Mailbox -ResultSize Unlimited -Filter { EmailAddresses -like "*@ITMAKALEvarlik.com" -and AddressBookPolicy -eq $null } | Set-Mailbox -AddressBookPolicy "ITMAKALE Varlik Address Policy"
New-GlobalAddressList -Name "ITMAKALE Varlik Global Address List" -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (company -eq 'ITMAKALEVARLIK')"
New-AddressList -Name "TEST" -IncludedRecipients MailContacts -ConditionalCompany “Test”
New-GlobalAddressList -Name "ITMAKALE Varlik GAL" -IncludedRecipients AllRecipients -ConditionalCompany ITMAKALEVARLIK
New-GlobalAddressList -Name "ITMAKALE Varlik GAL" -IncludedRecipients MailboxUsers -ConditionalCompany ITMAKALEVARLIK
Set-AddressBookPolicy -Identity "ITMAKALE Varlik Address Policy" -GlobalAddressList 
Update-GlobalAddressList -Identity "ITMAKALE Varlik GAL"
New-AddressBookPolicy -Name "ITMAKALE Varlik Address Policy" -GlobalAddressList "ITMAKALE Varlik GAL" -OfflineAddressBook "ITMAKALE Address-OAB" -RoomList "\ITMAKALE Toplanti Odasi" -AddressLists "\ITMAKALE Varlik Adres Defteri"
New-GlobalAddressList -Name "ITMAKALE Varlik GAL" -IncludedRecipients MailboxUsers -ConditionalCompany ITMAKALEVARLIK
Update-GlobalAddressList -Identity "ITMAKALE Varlik GAL"
New-OfflineAddressBook -Name "ITMAKALE Address-OAB" -AddressLists "All ITMAKALE Varlik Adres Defteri" -GlobalWebDistributionEnabled $true
Get-Mailbox -ResultSize Unlimited -Filter { EmailAddresses -like "*@ITMAKALEvarlik.com" -and AddressBookPolicy -eq $null }
Get-Mailbox -ResultSize Unlimited -Filter { EmailAddresses -like "*@ITMAKALEvarlik.com" -and AddressBookPolicy -eq $null } | Set-Mailbox -AddressBookPolicy "ITMAKALE Varlik Address Policy"
Set-AddressBookPolicy -Identity "ITMAKALE Varlik Address Policy" -GlobalAddressList "ITMAKALE Varlik Global Address List"
Update-GlobalAddressList -Identity "ITMAKALE Varlik Global Address List"
Set-GlobalAddressList -Identity "ITMAKALE Varlik Global Address List"

Get-Mailbox -ResultSize Unlimited -Filter { EmailAddresses -like "*@ITMAKALEvarlik.com" -and AddressBookPolicy -eq $null }
Get-Mailbox -ResultSize Unlimited -Filter { RecipientType -eq 'UserMailbox' -and Company -eq 'ITMAKALEVARLIK' }
Get-Mailbox -ResultSize Unlimited -Filter { RecipientType -eq 'ITMAKALEVARLIK' }
Get-Mailbox -ResultSize Unlimited -Filter { RecipientType -eq 'UserMailbox' }
Get-MailBox | where {$_.ResourceType -eq "Room"}

get-mailbox|where {$_.recipientTypeDetails -eq "roomMailbox"}
get-mailbox | where {$_.recipientTypeDetails -eq "roomMailbox"}
Get-Mailbox -ResultSize Unlimited
New-GlobalAddressList -Name "ITMAKALE Varlik Global Address List" -RecipientFilter "(RecipientType -eq 'UserMailbox') -and (ConditionalCompany -eq 'ITMAKALEVARLIK')"

New-GlobalAddressList -Name "ITMAKALE Varlik GAL" -IncludedRecipients AllRecipients -ConditionalCompany ITMAKALEVARLIK
New-GlobalAddressList -Name "ITMAKALE Varlik GAL" -IncludedRecipients MailboxUsers -ConditionalCompany ITMAKALEVARLIK
New-OfflineAddressBook -Name "ITMAKALE Address-OAB" -AddressLists "All ITMAKALE Varlik Adres Defteri" -GlobalWebDistributionEnabled $true

REMOVE SMTP Script

# Get all mailboxes
$mailboxes = get-mailbox;

# Loop through each mailbox
foreach ($mailbox in $mailboxes) {

$emailaddresses = $mailbox.emailaddresses;

#Loop through each SMTP address found on each mailbox
for ($i=0; $i -lt $emailaddresses.count; $i++) {

# Change the domain name below to what you want to remove
if ($emailaddresses[$i].smtpaddress -like "*bilgi.com*") {

# Remove the unwanted email address
$badaddress = $emailaddresses[$i];
$emailaddresses = $emailaddresses - $badaddress;
$mailbox | set-mailbox -emailaddresses $emailaddresses;

}

}

}

PowerShell Script to Configure Exchange Server Client Access URLs

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.