'Powershell' Category

  • Out-GridView özelliği ile komutlarınıza görsellik katın!

    January 25, 2011

    PowerShell 2.0 sürümü ile birlikte hayatımıza birçok yeni cmdlet katıldı.Bu makalemizde yine 2.0 ile birlikte gelen Out-GridView özelliğini inceleyeceğiz. Out-GridView sayesinde PowerShell tarafından üretilen çıktılar size tablara ayrılmış bir pencere içerisinde sunulmaktadır.Bu pencere dahilinde filtreler oluşturabilir, powershell komut satırı dışında çıktılarınızı görsel olarak çok daha verimli şekilde görüntüleyebilirsiniz. Not: Out-GridView cmdlet PowerShell 2.0 kurulumu ile more »

  • PowerShell pencerelerinizi renklendirin!

    January 24, 2011

    Powershell ile çalışırken eğer klasik mavi arka plan sizin için sıkıntı yaratıyorsa varolan renk düzeni ile istediğiniz gibi oynayabilirsiniz. Bunun için gerekli olan komut aşağıdaki gibi; $host.UI.RawUI.BackgroundColor = “DarkRed” $Host.UI.RawUI.ForegroundColor = “White” Renklerle oynamak bu kadar basit.Peki biraz daha takla atsak? Mesela powershell’I açan kullanıcının ismine göre arka plan renklerim belirlensin. Bunun için önceki yazılarda more »

  • PowerShell ile Uptime sürelerinin alınması

    January 24, 2011

    Aşağıdaki basit script ile yapınızdaki tüm remote makineler için uptime sürelerini alabilirsiniz. Tek yapmanız gereken karşınıza çıkan prompt ekranında pc ismini girmek. $computer = Read-Host “Type Remote Computer Name to check uptime” $upTime = [Management.ManagementDateTimeConverter]::ToDateTime((gwmi win32_operatingsystem -computer $computer).lastbootuptime) write-host $computer “-> Bu pc” $upTime “tarihinden itibaren hizmet vermektedir..” Download

  • PowerShell Script to export mailboxes with state and description attribute

    January 20, 2011

    As you know, standard Get-Mailbox cmdlet don’t have stateorprovince and description properties.Just check with Get-Mailbox | Get-Member Well then, what is the best way to get these properties within one single script? In the script below, all users which has mailboxes, are exported with Organizational Unit, Display Name, State or Province, Description and Primary SMTP more »

  • Is PowerShell Object Oriented ?

    January 11, 2011

    Definitely yes. Just see

  • PowerShell Execution policy

    January 11, 2011

    In PowerShell , there is a built-in security mechanism to prevent unrestricted script executions. You can set this option by group policy or with Set-ExecutionPolicy cmdlet as an Administrator. There are five different settings for the execution policy Restricted. This is the default setting, and Windows PowerShell does not execute scripts, except for a few more »

  • PowerShell Security Features

    January 11, 2011

    PowerShell offers you three basic security features : .Ps1 extension can not be run by double-clicking.And this extension is not registered with Microsoft Windows as an executable file type Prevent you from command hijacking.I mean if you call a script as “Script.ps1” it will not executed even it is located in the current directory. There more »

  • PowerShell Profiles

    January 11, 2011

    Why PowerShell Profiles? Each time you open a new PowerShell window, all you loaded modules, created aliases, defined functions and all other configurations will be lost. You start from scratch each time you open an new window. With a profile script you have the ability to store modules, custom aliases etc.The only difference about profile more »

  • List disabled mailboxes and export to CSV

    January 10, 2011

    Get-Mailbox | where { $_.ExchangeUserAccountControl -eq “Accountdisabled” -and $_.recipienttypedetails -eq “usermailbox”  } | select name | Export-Csv c:\disableduserswithmailboxes.csv

  • PowerShell–Group-Object

    January 10, 2011

    You may want to group similar outputs for some cmdlets.The Group-Object cmdlet examines a object property and creates a new group for each property. Get-Service | Group-Object status As you see above, two different groups were created by group-object cmdlet as Stopped and Running. Group-Object is less useful if each property have unique names. I more »

  • PowerShell – Sorting Objects

    January 10, 2011

    In PowerShell, when you run a cmdlet, script determines the order of output objects itself.I mean if execute a script which retrieves list of processes;   PowerShell displays processes in alphabetical order by name column.This is a default behavior for get-process cmdlet in PowerShell.Another cmdlets have another order types. If you want to change this more »

  • PowerShell script to check hardware for remote computers

    January 9, 2011

    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 »

  • How to create PowerShell custom tables

    January 8, 2011

    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 »

  • PowerShell Script to Check User SIDs

    January 7, 2011

    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

  • PowerShell Script to check updates for all domain controller computers

    January 7, 2011

    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 »

  • Export Domain Computers with Powershell

    January 7, 2011

    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 »

  • How to create array with PowerShell

    January 6, 2011

    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 »

  • PowerShell Script to Clean Up Empty SCCM Collections

    December 30, 2010

    Trever Sullivan wrote an excellent script to query your empty SCCM collections and prompts you to delete it. It’s useful to delete bunch of old , empty collections. Here is the script. ############################################### # # Author: Trevor Sullivan # Date: 12/6/10 # Purpose: Delete empty ConfigMgr collections # Blog: http://trevorsullivan.net # ############################################### # Your ConfigMgr more »

  • Create Test Users On Exchange 2010

    December 30, 2010

    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 ?

  • Remove Mailbox for Disabled User Objects

    December 15, 2010

    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 }

  • Powershell Script to Remove Mail Addresses

    December 15, 2010

    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 »

  • A powershell script that sends email about sent and received message counts on Exchange 2010

    December 15, 2010

    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 »

  • Exchange 2010 üzerinde Mailbox Size ların Powershell ile alınması ve mail ile gönderilmesi

    November 9, 2010

    Exchange 2010 yapısına geçirdiğimiz bir müşterimizden şöyle bir talep geldi. Yapıda varolan tüm Mailbox veritabanlarındaki varolan mailboxların totalitemsize,kota,varolan sizeları gibi bilgileri belirli periyodlarla edinebilirmiyim? Burada tabiki powershell komutlarını kullanarak bazı taklalar atmamız mümkün.Hatta artık Exchange 2010 ile ilgili gelen taleplerin neredeyse tamamına aklımda powershell komutları olduğu müddetçe “œmümkündür” cevabını veriyorum. Burada yapmamız gereken Get-MailboxStatistics cmdlet more »

  • Powershell üzerinden mail gönderimi için Receive Connector oluşturulması

    April 1, 2010

    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 »

 
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org