locked
Looking for a list disable user along with their disable maillboxes RRS feed

  • Question

  • Dear All,

    I would appreciate if you help me to get the power shell command for below query.

    How do I get the list of disable email and disable account and then wanted to move them a particular, and this script i am looking for a one command. Is that possible?

    I am not sure, do need to run get information from exchange management shell or in AD Server shell?

    Thanks & Regards,

    Saroop


    • Edited by Saroop Monday, August 7, 2017 4:32 AM
    Sunday, August 6, 2017 7:27 PM

Answers

  • Hi Saroop,

    Yes, it's possible.

    Try the following command:

    Search-ADAccount -AccountDisabled -UsersOnly |Foreach-Object{Add-AdGroupMember -Identity GroupName -Members $_}

    Hope this helps,

    Best Regards,


    Niko Cheng
    TechNet Community Support


    Please remember to mark the replies as answers.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Saroop Sunday, August 13, 2017 6:03 AM
    Thursday, August 10, 2017 9:59 AM

All replies

  • I don't know what you're asking because of all that unnecessary HTML in your post.

    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!

    Sunday, August 6, 2017 8:57 PM
  • Hi Saroop,

    If my understanding is correct, you want to get a list of disabled accounts in your AD and their mailboxes had been disabled also, right ?

    Perhaps the following command would help, run it in Exchange management shell:

    Search-ADAccount -AccountDisabled -UsersOnly |Foreach-Object{Get-MailboxStatistics | Where { $_.DisconnectReason -eq "Disabled" }} | ft DisplayName,DisconnectDate

    Hope this helps,

    Best Regards,


    Niko Cheng
    TechNet Community Support


    Please remember to mark the replies as answers.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, August 7, 2017 3:29 AM
  • Hi Niko,

    Thanks for your reply on this query.

    yes, i am looking for disable user accounts & disable email addresses in AD and on the same wanted move all disable accounts and email in a particular group.

    Is that possible?

    Appreciate your help

    Warm Regards,

    Saroop

    Monday, August 7, 2017 4:35 AM
  • Hi Niko,

    Does AD will give me require output regarding Account & Email disable and then wanted to move them a group.

    We are running exchange 2010 in our environment.

    Thanks & Regards,

    Saroop

    Monday, August 7, 2017 6:03 AM
  • Hi Saroop,

    Yes, it's possible.

    Try the following command:

    Search-ADAccount -AccountDisabled -UsersOnly |Foreach-Object{Add-AdGroupMember -Identity GroupName -Members $_}

    Hope this helps,

    Best Regards,


    Niko Cheng
    TechNet Community Support


    Please remember to mark the replies as answers.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Saroop Sunday, August 13, 2017 6:03 AM
    Thursday, August 10, 2017 9:59 AM
  • Hi Niko,

    This is the exactly same command which i am looking for.

    Thanks and Appreciated your help

    Regards,

    Saroop

    Sunday, August 13, 2017 6:04 AM