0

I have a clean up task to do with my Exchange 2003/07 environment. The set-up is as follows:

domain controllers - ( 2003,  2012,  2008)
Domain Function Level is: Windows Server 2003
Server 2003, Exchange 2007 Ent ru15
Co-existence

So some (1000 users) have a linked mailbox in one domain, for the cleanup in ADSI Edit I manually need to check these accounts to ensure msExchRecipientTypeDetails is equal to two, this is the setting for linked mailboxes.

Is it possible to search by get-domainuser for the attribute.

Secondly we have thousands of entries and I can't scroll to them. Does anyone know of a method to search for an object within ADSI if I cannot get a script to work.

JJJJNR
  • 860
  • 4
  • 20
  • 32

1 Answers1

2

To perform a powershell search of all users with the msExchRecipientTypeDetails equal to 2, the following should get you started

Import-module ActiveDirectory get-aduser -filter 'name -like "*" -properties * | where{$_.msExchRecipientTypeDetails -eq 2} | select distinguishedname,msExchRecipientTypedetails | Export-csv LinkedMailboxes.csv

You might want to tweak the filter to narrow your scope based on your environment.
get-help get-aduser -detailed


In regards to showing more entries in ADSIEDIT, you can set the number of items within the filter

  • Adsiedit.msc > right-click "connect to" > eg. Default naming context > OK
  • Left-click to select "Default naming context"
  • View > Filter...
  • Increase the max number of items per container value

Note: It's important to left click to select the "container: Default naming context" or items at that level before your right-click. Otherwise, you get a slightly different set of options that doesn't include view or filters

Lex
  • 564
  • 1
  • 6
  • 16
  • 1
    With a great number of users, it may be helpful to filter `mail -ne $null` (Mail value not empty). There could be other, better values to key off of in your environment. – blaughw Jan 28 '16 at 18:00