Monthly Archives: July 2017

You are browsing the site archives by month.

Powershell – Kullanıcı İsim ve Mailbox Boyutu

Merhaba arkadaşlar,
Yine bir müşterimiz ki child domainleri olan, kullanıcılarının isim, login name, hangi DB’de olduğu, SMTP adresini, hangi OU’da olduğunu ve en son mailbox boyutlarının ne olduğunun talep eden bir isteği oldu.
Mailbox boyutu yani totalitemsize property’si malum Get-Mailboxstatistics komutunda gelmekte.
Haliyle istenilen liste Get-Mailbox ve Get-Mailboxstatistics komutlarıyla alınabilmekte.
Bu komutların birleştirilmesi ve tek bir liste halinde çıtı alınabilmesi ancak aşağıdaki gibi düzenlenen bir script sonrası alınabilir.
Yararlı olması dileğiyle.

$output = @()

$mbxs = Get-mailbox -resultsize unlimited -IgnoreDefaultScope
Foreach ($mbx in $mbxs)
{
$gots=Get-MailboxStatistics -Identity $mbx.distinguishedname
Foreach ($got in $gots)
{
$userObj = New-Object PSObject
$userObj | Add-Member NoteProperty -Name “DisplayName” -Value $mbx.displayname
$userObj | Add-Member NoteProperty -Name “SamAccountName” -Value $mbx.SamAccountName
$userObj | Add-Member NoteProperty -Name “Database” -Value $mbx.Database
$userObj | Add-Member NoteProperty -Name “PrimarySmtpAddress” -Value $mbx.PrimarySmtpAddress
$userObj | Add-Member NoteProperty -Name “HiddenFromAddressListsEnabled” -Value $mbx.HiddenFromAddressListsEnabled
$userObj | Add-Member NoteProperty -Name “OrganizationalUnit” -Value $mbx.OrganizationalUnit
$userObj | Add-Member NoteProperty -Name “TotalItemSize” -Value $got.TotalItemSize
$output+=$userObj
}
}

$output | Export-Csv “C:Scripts\sonuc.csv” -Enconding UTF8 -NoTypeInformation

Time Sync Problems

Howdy Folks,
I had a lot of issues with the Time Sync in few customers environments then i decided to write this post. 
As you know, the time can not be longer than 5 minutes between domain controllers and other devices. If it is difference longer then we have a big issue.
In my situation, The customer’s SAP server’s time difference DC’s time. Then clients can not run the report from the SAP Server . The users got error messages.
I usually check manuel from the official Microsoft site the it helped me many times
You can follow this commands then i hope you will be success.

1-Check the source time server
w32tm /query /status

2-Time resynchronization with another NTP
w32tm /resync
w32rm /resync /rediscover /nowait

3- Force the computer’s time to sync with the DC or specific time server.
net time \\ES.local or 10.x.x.x /set /y

4- Then i also run the folloing comands
net stop w32time
w32tm /unregister
w32tm /register
net start w32time