O-Xchange Notes from the Field!

Wednesday, November 5, 2014

When removing Mobile Devices from Exchange Mailboxes, you get the error message: DeviceId cannot contain hyphens.

Scenario:  When you attempt to remove a mobile device from a users mailbox, you receive the error below.

Error:  An unexpected error has occurred and a Watson dump is being generated: DeviceId cannot contain hyphens.  


Resolution: Remove the mobile device object via ADSI Edit.

1. Open ADSI Edit.
2. Under the Default Naming Context, navigate to the user object of the mailbox that has the mobile device.
3. Expand that user object, and click on the CN=ExchangeActiveSyncDevices.
4. Delete the Mobile Device for this user.

Tuesday, November 4, 2014

Time your Powershell Commands

Task:  You want to measure your Powershell commands so you can time your commands for efficiency. In the example below, I want to time how fast my results are returned for finding all Mailboxes in our organization.

Resolution:   Select from #Start to #End and copy and paste it all into PowerShell. Make sure you paste it all at once.  It will execute the start and end time variables and then subtract it.  It will then display the $total in these various units of measure; TotalMilliseconds, TotalSeconds, TotalMinutes, TotalHours, TotalDays, and Ticks.


#Start
$Start = Get-Date
Get-Mailbox -resultsize unlimited
$End = Get-Date
$total = $End-$Start
$total
#End

Outlook Error: "The Delegates settings were not saved correctly. Cannot activate send-on-behalf-of list. You do not have sufficient permission to perform this operation on this object."

Scenario:  You receive the following error in Outlook when trying to Add/Modify Delegates within Outlook:

Error:  The Delegates settings were not saved correctly. Cannot activate send-on-behalf-of list. You do not have sufficient permission to perform this operation on this object.

Resolution: Add the IgnoreSOBError with a value of 1 in the registry.

    1. Click Start, and then click Run.
    2. If you are prompted for an administrator password or for confirmation, type the password or click Continue.
  1. Locate and then click the following registry subkey:

    HKEY_CURRENT_USER\Software\Microsoft\Office\x.0\Outlook\Preferences
    If you use policies, click the following subkey:

    HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\x.0\Outlook\Preferences

    Note: x.0
    in the above registry key represents your Outlook version. Please use one of the following values.

    Outlook 2013: 15.0
    Outlook 2010: 14.0
    Outlook 2007: 12.0
    Outlook 2003: 11.0
  2. After you select the subkey that is specified in step 3, click New on the Edit menu, and then click DWORD Value.
  3. Type IgnoreSOBError, and then press Enter.
  4. Right-click IgnoreSOBError, and then click Modify.
  5. In the Value data box, type 1, and then click OK.
  6. On the File menu, click Exit to exit Registry Editor.

Retrieve all mailboxes assigned to a specific ActiveSyncMailboxPolicy

Task: Retrieve all mailboxes assigned to a specific ActiveSyncMailboxPolicy.  The ActiveSyncMailboxPolicy we are searching for is labeled "VIP".

Run the following:

Get-CASMailbox -ResultSize unlimited | Where ActiveSyncMailboxPolicy -like "VIP" | Select SamAccountName, DisplayName,ActivesyncMailboxPolicy,ServerName | Export-csv C:\VIP_EASPolicy.csv