
Get mailbox folder statistics from Exchange Online / Office 365
This short and simple example shows how to connect to Exchange Online services to get mailbox folder statistics from Exchange Online / Office 365 via PowerShell. Hope it helps.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# Sample PS to connect Exchange Online and to get mailbox and inbox folder item count. # Osman Shener # Get Credentials for Office 365 $Creds = Get-Credential # Connect to Office 365 services Import-Module MSOnline Connect-MsolService –Credential $Creds # Create session to Exchange Online $EOSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $Creds -Authentication Basic -AllowRedirection Import-PSSession $EOSession -DisableNameChecking # The mailbox owner $TheUser = "Osman Shener" # Get total item count in the mailbox (all items) $TotalItemsCount = Get-MailboxStatistics -Identity $TheUser # Get total item count in the Inbox folder $InboxItemsCount = Get-MailboxFolderStatistics -Identity $TheUser -FolderScope Inbox # Print the results $TheUser + " has " + $TotalItemsCount.ItemCount + " items in the mailbox, " + $InboxItemsCount.ItemsInFolder + " of them are in the Inbox folder." |
Notes: For Office 365 operated by 21Vianet, use the ConnectionUri value: https://partner.outlook.cn/PowerShell For Office 365 Germany, use the ConnectionUri value: Be sure to disconnect the remote PowerShell session when you’re […]

How to add or remove extensionAttribute of an AD User object
I would like to share some simple PowerShell commands, to show how to add or remove extensionAttribute of an AD User object Import AD Module First [PS] C:\>import-module ActiveDirectory To get current value [PS] C:\>Get-ADUser -Identity firstuser -Properties extensionAttribute12 DistinguishedName : CN=First User,OU=TempTest,DC=infralib,DC=com Enabled : False GivenName : First Name : First User ObjectClass : user […]

Configuring Impersonation role for a specific AD group in Dynamics CRM Exchange Server Side Sync
You need to be careful if you need to setup server-side synchronisation between Dynamics CRM and Exchange Server as you are going to use Application Impersonation role and it has really too much permissions on mailboxes. The user has this role should be handled like any other Exchange administrator role. And I strongly recommend you […]

PowerShell – AD Kullanıcılarını ve Password Expiry tarihlerini listelemek
Aşağıdaki PowerShell scripti ile AD’de ki kullanıcıları Password Expiry Date bilgileri ile listeleyebilirsiniz.
1 |
Get-ADUser -filter {(Enabled -eq $True) -and (PasswordNeverExpires -eq $False)} -Properties DisplayName, msDS-UserPasswordExpiryTimeComputed | Where-Object {$_.DisplayName -ne $null} | Select DisplayName,@{Name="ExpiryDate";Expression={([datetime]::fromfiletime($_."msDS-UserPasswordExpiryTimeComputed"))}} |
Komut msDS-UserPasswordExpiryTimeComputed attribute bilgisinden faydalanmaktadır. Bu attribute ün AD LDS’de bulunmadığını belirtmek isterim. Windows Server 2008 operating system, Windows Server 2008 R2 operating system, Windows Server 2012 operating system, and Windows Server 2012 R2 operating system de kullanılabilir.
1 2 3 4 5 6 7 8 9 10 11 12 |
cn: ms-DS-User-Password-Expiry-Time-Computed ldapDisplayName: msDS-UserPasswordExpiryTimeComputed attributeId: 1.2.840.113556.1.4.1996 attributeSyntax: 2.5.5.16 omSyntax: 65 isSingleValued: TRUE schemaIdGuid: add5cf10-7b09-4449-9ae6-2534148f8a72 systemOnly: FALSE searchFlags: 0 attributeSecurityGuid: 4c164200-20c0-11d0-a768-00aa006e0529 systemFlags: FLAG_SCHEMA_BASE_OBJECT | FLAG_ATTR_IS_CONSTRUCTED schemaFlagsEx: FLAG_ATTR_IS_CRITICAL |