none
Enabling multiple users in Exchange 2013 RRS feed

  • Question

  • OK, found a GUI feature that I now miss.

    I have a script that creates AD users, mail enables them, then Lync enables them.  I ran through a bulk creation this week, creating about 400 accounts/mailboxes/Lync.  Unfortunately, the Exchange server was having a WinRM issue (now addressed) and the mailboxes were not created.  The /ecp does not seem to have a bulk enabling screen - you can only select one at a time.  Additionally, everything I have tried to do get-aduser and filter by email attributes has not worked.

    From about_Active_directory_filter:

        Get all entries without an e-mail attribute:
    
            LDAP Filter Equivalent
            (!(email=*))
    
    
            Get-ADUser -Filter '-not Email -like "*"'
    
            -or-
    
            Get-ADUser -Filter 'Email -notlike "*"'

    However, those both return ALL users, not the non mail enabled ones.

    Two of the users have the same last name (smith) so I tried to just do this:

    get-aduser -Filter 'samaccountname -like "vchand*"' | enable-mailbox

    get-aduser -Filter 'samaccountname -like "*smith"' | enable-mailbox

    which returned:

    The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.

    So I am stumped - short of enabling these individually, is there no easy way to bulk enable?  If it matters, Exchange 2013 on Windows 2012 in this case.


    • Edited by chrislehr Tuesday, March 19, 2013 5:19 PM
    Tuesday, March 19, 2013 5:18 PM

Answers

  • Hi,
    Why not run something like:
    Get-User -RecipientTypeDetails User -OrganizationalUnit "domain.local/Some Ou" | Enable-Mailbox


    Martina Miskovic

    • Marked as answer by chrislehr Tuesday, March 19, 2013 5:57 PM
    Tuesday, March 19, 2013 5:23 PM

All replies

  • Hi,
    Why not run something like:
    Get-User -RecipientTypeDetails User -OrganizationalUnit "domain.local/Some Ou" | Enable-Mailbox


    Martina Miskovic

    • Marked as answer by chrislehr Tuesday, March 19, 2013 5:57 PM
    Tuesday, March 19, 2013 5:23 PM
  • Hi,
    Why not run something like:
    Get-User -RecipientTypeDetails User -OrganizationalUnit "domain.local/Some Ou" | Enable-Mailbox


    Martina Miskovic

    Well, that does work for me, but I needed to move them all into a temp OU to do this and not accidentally enable service accounts and stuff.  I am realizing more now that I loved the GUI's enable mailbox view that only listed non mail enabled accounts...   and am more annoyed that their example of how to use powershell to do it does not work.


    But thank you for this, it got me over the issue, albeit not the way I was hoping for  :)

    Tuesday, March 19, 2013 5:43 PM
  • Hi,
    If you have the information in a CSV-file, you could also run something like this:
    Import-Csv C:\Temp\Users.csv| foreach {Enable-Mailbox -Identity $_.samaccountname -Alias $_.Alias}


    Martina Miskovic

    Tuesday, March 19, 2013 5:53 PM
  • Hi,
    If you have the information in a CSV-file, you could also run something like this:
    Import-Csv C:\Temp\Users.csv| foreach {Enable-Mailbox -Identity $_.samaccountname -Alias $_.Alias}


    Martina Miskovic

    Unfortunately, didn't have them in a CSV since I had a script building the accounts.  But I guess the chief complaint (and something still unresolved) is how to get powershell to list users that are not mail enabled in a pipelinable way to enable-mailbox.  Either way, my immediate need here is resolved, so I am marking you as an answer, but the link in my first post and the quoted example is WRONG  ;)

    Tuesday, March 19, 2013 5:57 PM