Category Archive: PowerShell

Jul
25

Powershell ile alınan çıktı değerlerinin KB/MB/GB’a dönüştürülmesi

Powershell ile alınan çıktılar genelde bizim istediğimiz değerle dışında olup bu değerlerin isteğimiz doğrultusunda KB/MB/GB gibi değerlere dönüştürmek isteyebiliriz. Aşağıdaki PS komutlarını kullanarak bu dönüşümü yapabilirsiniz. Varsayılan değer: Get-Mailbox username | Get-MailboxStatistics |ft displayname,totalitemsize MB değeri: Get-Mailbox username | Get-MailboxStatistics |ft displayname,@{name=”totalitemsize(MB)”;Expression={$_.totalitemsize/1MB}}

Oct
21

Domaindeki tüm kullanıcıların listelenmesi – PowerShell

$strFilter = “(&(objectCategory=User))” $objDomain = New-Object System.DirectoryServices.DirectoryEntry $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = $objDomain $objSearcher.PageSize = 10000 $objSearcher.Filter = $strFilter $objSearcher.SearchScope = “Subtree” $objSearcher.SearchRoot = “dc=domain,dc=local” $colProplist = “name” foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i)} $colResults = $objSearcher.FindAll() foreach ($objResult in $colResults) {$objItem = $objResult.Properties; $objItem.name}

May
08

iADSLargeInteger in Powershell getting the RID pool values

I found that there were a few solutions out there on the internet but still didn’t really get me what I was after.  I wanted to find out my total SID count that could be created, and then find the current rid pool high water mark so I could track where were at against that …

Continue reading »