Archive

Posts Tagged ‘exchange’

Exchange tips: Out of Office on users


To check information about Out Of Office for mailbox users we can run an powershell “one liner” and get useful information.

The PS, Get-MailboxAutoReplyConfiguration “username” will show you this useful information:

  • AutoReplyState (Disabled/Enabled)
  • Start date (date and time)
  • End date (date and time)
  • External Message (in HTML format)
  • Internal Message (in HTML format)

OOO_ps

With this command you can easily change the message as wel!

Get-MailboxAutoReplyConfiguration julras | Set-MailboxAutoReplyConfiguration -ExternalMessage “Hi, I`m testing OOO” -InternalMessage “Hi, I`m testing OOO” -Autoreplystate Enabled

As you can see in my PS command i here GET the results of “julras” user and pipe it throug an SET command to change the External and internal message and then Enable the Out of Office for the user.

Change primary email address in Office 365


Start powershell as administrator

Run the following commands:
$LiveCred = Get-Credential
(Enter your Office 365 administrator credentials)
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

Find all aliases for one account:
get-mailbox | select -expand emailaddresses alias
Alternativt:
get-mailbox name@domain.com | select -expand emailaddresses alias

Add email alias to an Account:
Set-Mailbox name@domain.com -EmailAddresses SMTP:newprimaryaddress@domain.com,anotheraddress@domain.com,yet.another.address@domain.com

NOTE: the first address after “SMTP:” will be the primary e-mail address. All aliases will be replaced. If you have 100 aliases and only type in one in this command, you will lose 99 aliases!

Set passwords to never expire in office 365


First, Enable .net 3.5 on your system.

Then, Download and Install Microsoft Online Services Sign-In Assistant

Microsoft Online Services Sign-In Assistant 64-bit (BETA) – <a title=”Microsoft Online Services Sign-In Assistant 64-bit (BETA) – http://www.microsoft.com/en-my/download/details.aspx?id=39267

Then Download and install Microsoft Online Services Module for Windows PowerShell

Microsoft Online Services Module for Windows PowerShell 64-bit – http://g.microsoftonline.com/0BX10EN/423

Restart computer and start “Microsoft Online Services Module for Windows PowerShell”

Type the command:  Connect-MsolService

And in the dialog enter the credentials of your Office 365 administrator

To control if a password for a single user expires
Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires

To change the password policy to never expire for a single user
Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true

To change the password policy to never expire for all users at once
Type the command: Get-MsolUser | Set-MsolUser -PasswordNeverExpires $True

To control that the modifications have been applied
Type the command “Get-MsolUser | fl”

And if you need to apply password policy to users

To change the password policy to expire for a single user
Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $false

To change the password policy to expire for all users at once
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $false

List users and size of mailbox in Exchange 2007 and 2010 with Powershell


Get-Mailbox | Get-MailboxStatistics | select-object DisplayName, {$_.TotalItemSize.Value.ToMB()}

Find emails with Powershell commandlets

December 19, 2011 Leave a comment

Get-MessageTrackingLog -start “12/18/2011 08:00” -Sender user@domain.com | Format-List sender, Recipients, timestamp, MessageSubject

Get-MessageTrackingLog -MessageSubject Testsubject

%d bloggers like this: