Script by Exch PS To Get mailbox for all users and last logon and EmployeeID and EmployeeNumber


  • Hi,

    I want to Export CSV by PS EXCH to get this columns data :

    EmployeeID  ,  EmployeeNumber , mailbox ( EmailAddress )  , lastlogon

    can u provide us the code script to run it in Exch PS


    Wednesday, December 5, 2018 10:34 AM

All replies

  • Read documentation to get-aduser cmdlet .. all u need.

    get-aduser  ......  | select ........ | export-csv ........

    • Proposed as answer by BOfH_666 Wednesday, December 5, 2018 10:51 AM
    Wednesday, December 5, 2018 10:39 AM
  • I tried but can't get it EmployeeID and EmployeeNumber

    Can u please type the correct script plz ..

    Thank you for your cooperation

    Wednesday, December 5, 2018 11:04 AM
  • Wednesday, December 5, 2018 11:09 AM
  • What error did u get.. did you specified Employeenumber in property parameter?

    You didnt post single piece of code - there is nothing we can fix, and no-one (well, mostly no-one) will write you script from scratch. If u need help, you should should also participate on solution and not only ask for everything.  And since this is very basic task (just use my example and try to fill dots), you cant expect anything more ...  

    Wednesday, December 5, 2018 12:03 PM
  • It is interesting how many people who try to use computers today cannot read. Sometimes it is a language issue but most of the time it is just an inability to read or understand technical documentation.

    To be a computer technician of any kind it is absolutely critical that you learn to read the documentation. 

    The help file suggested above explains how to use the CmdLet to get properties.  It is explicit and there are examples.  Please read the documentation again carefully.

    You can make reading easier by using the GUI reader.

    help Get-AdUser -ShowWindow

    Read all of the document as many times as it takes to understand how the CmdLet works.  With practice you will eventually learn how to read PowerShell help.

    To learn all about help type the following

    help help


    Wednesday, December 5, 2018 1:57 PM
  • Hi,

    Thanks for your question.

    Please post your script what you have tried for the solution.

    Also, read the help file can help you solve your issue.

    Best Regards,


    Just do it.

    Thursday, December 6, 2018 8:42 AM
  • Hi,

    Was your issue resolved?

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.

    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.

    If no, please reply and tell us the current situation in order to provide further help.

    Best Regards,


    Just do it.

    Tuesday, December 11, 2018 6:38 AM