How to get all the account details using Get-MailBox

84,801

If you're new to PowerShell I suggest you look at some of the resources here. Apart from that you probably want to use Get-Member, Select-Object and/or Format-List. Perhaps doing something like:

PS> Get-MailBox | Get-Member

a load of properties and methods will be scrolling by you can select the properties you wish to see using something like

PS> Get-MailBox | Select-Object Alias

To get all available information you could use Format-List with the * glob like so:

PS> Get-MailBox | Format-List *

I don't have acces to an Exchange environment so I can't provide any specific examples I'm afraid.

Share:
84,801
Hiren
Author by

Hiren

Newby As Programmer,Working As .net programmer

Updated on October 09, 2020

Comments

  • Hiren
    Hiren over 3 years

    I know this is silly question but I am new with Powershell cmdlet.

    I want all details of user of a mailbox. I am using Get-MailBox but I just get Alias name and name there, but I want all the details. I can't find any parameter for that even. Is there any way??Thank You

    • Glenn Slaven
      Glenn Slaven over 12 years
      What other details are you wanting?
    • Hiren
      Hiren over 12 years
      I want First Name ,Last Name and almost all the properties.Because we create email address with help of first name and last name so I cant change only email address with different first name and last name.I hope You can understand this .Thank You.
  • Hiren
    Hiren over 12 years
    Thanks For great help,Its working great with Powershell.Now I get all details with that command .Now I am looking for appropriate code in C# .As Format-List is not parameter I am confuse how to code it with C#.
  • Hiren
    Hiren over 12 years
    This Is the solution Command cmdSetMailbox = new Command("Get-MailBox"); cmdSetMailbox.Parameters.Add("Identity", txtName.Text); Command cmd = new Command("Select-Object"); string[] Parameter = new string[] {"Alias","DisplayName"}; cmd.Parameters.Add("Property",Parameter);
  • Adam Winter
    Adam Winter over 2 years
    Out-GridView opened an new powershell window for every object. This could crash your server with RAM usage if the list is long enough.