I wrote another simple PowerShell script which uses wmi queries to get information about remote computers’ memory, network, system and processor datas. Interface is very simple. It prompts you to type remote computer name.Please be aware about credential and firewall issues. Then you are choosing system, memory, processor or disk sections. As I mentioned before, more »
You can display standard PowerShell output information or create custom tables. I mean, if you execute get-wmiobject command for Win32_PysicalMemory class; That’s the default design of output.But with select-object or format-table parameters you can filter for specific columns. Format-table filters for only speed and manufacturer columns. But what if you want to create your own more »
That’s a very simple script.I wrote this script for myself because in my Active Directory migration projects, SID is a important matter especially for cross forest migrations. With this GUI just select your domain on drop down menu and type username. Download
With the following script that I just wrote, you can select a domain computer and check for the specific update package . It creates a csv file on c: folder which includes all domain computers.So you must run this script with evaluated permissions. Also you must have required permission to connect other domain computers. Download more »
If you want to export all domain computers to a csv file , it’s very humble with powershell. Let’s see step by step. $strFilter = "(&(objectCategory=Computer))" First of all, you will attach computer filter for $strFilter variable. $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher Connect to Active Directory Searcher. $objSearcher.SearchRoot = $objDomain more »
It’s so easy with powershell to create dynamic or static arrays. For example; $MyArray = 5, 6, 7 Just separate the items with commas.Another simple example; $MyArray = “first”, “second”, “third” If you want to add another item to the array just use; $MyArray = $MyArray + “fourth” To assign a range to the array; more »
Want to create a group of test users in your lab? Use this command: 1..100 | ForEach { Net User "User$_" MyPassword=01 /ADD /Domain; Enable-Mailbox "User$_" } Now let’s comment about how to remove these 100 users with powershell ?
Following script will look for disabled users with mailboxes and will remove mailbox attributes on these objects. Get-Mailbox | where { $_.ExchangeUserAccountControl -eq "Accountdisabled" -and $_.recipienttypedetails -eq "usermailbox" } | select name | Export-Csv c:\disableduserswithmailboxes.csv Import-CSV C:\disableduserswithmailboxes.csv | ForEach-Object { remove-mailbox -identity $_."Name" -Confirm:$false }
If you have migrated to Exchange 2007 or Exchange 2010 from legacy versions, and changed shared smtp namespaces, then unused mail address attributes will remain on migrated user objects. Following script will read users.txt and look for specific text in mail addresses , and then will remove finally. Get-Content C:\users.txt |Get-Mailbox | foreach{ for more »
One of my customer ask me that is there any way to obtain sent and received message counts on Exchange 2010 for specific timelines.With following script, you can get all transport servers on your organization, read sent and received message counts for last 24 hour period , save this to the local disk, and email more »
Organizasyonun ihtiyaçları doğrultusunda bazen bir script yardımı ile belirli conditionlarda Exchange üzerinden mail gönderilmesi isteniyor.Daha önceden olduğu gibi bunun için relay izinlenirimizi oluşturup mail atımını gerçekleştirebiliyoruz.Bu mail atımını gerçekleştirebilecek çok hoş powershell scriptlerini internet üzerinden bulabiliyorsunuz.Bende yakın zamanda kullandığım için birkaçını paylaşacağım. Yalnız powershell scripti ile mail gönderimi gerçekleştirmek için bir HUB Transport sunucuda nasıl more »
Geçtğimiz günlerde Exchange Server 2010 için Rollup1 paketi yayınlandı.İçerisinde birçok güncelleme bulunuyor. Bu paketi sisteminize geçtikten sonra versiyon kontrolü yapmak isteyebilirsiniz.Bunun için BIN klasörü altındaki exsetup.exe dosyasının versiyonunu kontrol etmelisiniz.Aşağıdaki komutlar işinizi görücektir. GCM exsetup |%{$_.Fileversioninfo} Aynı zamanda aşağıdaki sayfalardan version number bilgilerini alabilirsiniz. Link1 Link2
Powershell’i kurdunuz yada exchange 2007 için exchange management shell üzerinde varolan bir .ps1 dosyasını çalıştırdığımızda; File cannot be loaded because the execution of scripts is disabled on this system error in PowerShell hatası alabiliriz.Bunun sebebi aslında defaultta gelen güvenlik ayarları.Varolan güvenlik ayarları scriptin çalıştırılmasına izin vermiyor demektir.Yani teknik olarak Execution Policy durumu.Temelde varolan execution policyler more »
Aşamaları takip etmeniz zor.Verdiği hataları yada eksik önyüklemeleri seçmeniz uğraştırıyor.Ama yinede bilmenizde fayda var.Sunucu üzerine exchange 2007 kurulumunu komut satırından yada powershell içerisinden gerçekleştirebilirsiniz.Aşina olduğumuz komut satırından gerçekleştirmek için Exchange 2007 dvd dizinine inerek; Setup.Com “/r:M,HT,C” “/on:Messaging” komutunu koşturun. Aynı işlemi powershell üzerinde gerçekleştirmek içinde; ./Setup.Com “/r:M,HT,C” “/on:Messaging” komutu işinizi görücektir. Fakat gerçekten verdiği hataları more »
Exchange 2007 üzerinde NDR(non-delivery reports) özelliğide oldukça geliştrilmiş.3haneden oluşan 5.1.1 benzeri kodların her biri bir anlam ifade ediyor ve sorunu çözmemize olanak sağlıyor. Örneğin ilk sayı olan 5 genel olarak hata tipini belirtiyor.Buradaki 5 hatanın kalıcı olduğunu ve mesajın artık karşı tarafa ulaşma şansının olmadığını belirtiyor.Bu değer 4 olsaydı karşıya ulaşma ihitimali hala olabilirdi. İkinci more »
Exchange 2007 Content Agent Log Message Tracker aracı sayesinde Content Filtering Agent üzerinden akan tüm mesajları görüntüleyebilirsiniz. Kodu yazan Glen Scales’e göre;
Bildiğimiz gibi artık powershell ile sunucularımızı ve işlerimizi yönetebiliyoruz.Powershell’in bir diğer marifetide Net.Mail.SmtpClient objesini kullanarak mail gönderebilmesi.Aşağıdaki kodları kullanarak isterseniz bir.ps1 oluşturabilir ve bunu schedule ile istediğiniz zamanlarda çalıştırabilirsiniz.Powershell’de mail gönderimi için $emailFrom = “user@yourdomain.com” $emailTo = “user@yourdomain.com” $subject = “your subject” $body = “your body” $smtpServer = “your smtp server” $smtp = new-object Net.Mail.SmtpClient($smtpServer) more »