简体   繁体   中英

How to get all the account details using Get-MailBox

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

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.

The data you want to store/retrieve might be in Active directory. Exchange is pretty much used for exchange specific functionality

I'm using Server 2012 R2 and use the following code because I'm lazy. Copy the whole command together so ignore the word wrapping on this site. I'm posting this here because I always forget what I did and keep coming here on random searches.

Launch a Powershell Window as administrator on a Domain Controller

Get-ADUser -F * -PR * | Select 
Name,Title,Enabled,LockedOut,OfficePhone,MobilePhone,Fax,office,EmployeeID,Company | Out-GridView

Also here are some random useful Exchange commands so you can compare. To see what information is available for a user, just pull everything. From the Exchange server logged on as a user with permissions..

Launch Exchange Powershell

Get-Mailbox | Format-List *

Gives everything for every user under the sun. Limit it with the following.

Get-Mailbox %useralias% | Format-List *

If the fields you want aren't here, then it is most likely stored in active directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM