Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - List AD user with or without an Exchange Mailbox

Reply
 
Old 12-22-2008   #1 (permalink)
Personne


 
 

List AD user with or without an Exchange Mailbox

so far I got this

GET-QADuser | Get-mailbox

I got a red message when the user doesn't have a mailbox associated

I'm also looking to delete a mailbox without deleting the AD user, I
go this command Remove-mailbox, but it does delete the mailbox and the
AD user associated



My System SpecsSystem Spec
Old 12-23-2008   #2 (permalink)
Shay Levy [MVP]


 
 

Re: List AD user with or without an Exchange Mailbox

Hello Personne,

Get-QADUser's Identity is not the same as Get-Mailbox's Identity, you need
to use foreach and set the -errorAction parameter
to silentlyContinue to supress error messages for non mailboxed users


Get-QADUser | foreach { Get-Mailbox $_.name -ErrorAction silentlyContinue }


On the other hand, exchange has a built-in Get-User cmdlet which you can
pipe directly to Get-Mailbox (use -errorAction as above to supress error
messages)

Get-User | Get-Mailbox -errorAction silentlyContinue


---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar


P> so far I got this
P>
P> GET-QADuser | Get-mailbox
P>
P> I got a red message when the user doesn't have a mailbox associated
P>
P> I'm also looking to delete a mailbox without deleting the AD user, I
P> go this command Remove-mailbox, but it does delete the mailbox and
P> the AD user associated
P>


My System SpecsSystem Spec
Old 12-23-2008   #3 (permalink)
Personne


 
 

Re: List AD user with or without an Exchange Mailbox

or
get-user -Filter {Recipienttype -eq "User"}
My System SpecsSystem Spec
Old 12-23-2008   #4 (permalink)
Shay Levy [MVP]


 
 

Re: List AD user with or without an Exchange Mailbox

Hello Personne,

That's much better :-), also set the -ResultSize parameter to 'unlimited'
to get the maximum number of user objects.



---
Shay Levy
Windows PowerShell MVP
http://blogs.microsoft.co.il/blogs/ScriptFanatic
PowerShell Toolbar: http://tinyurl.com/PSToolbar


P> or
P> get-user -Filter {Recipienttype -eq "User"}


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Exchange 07 Shell - Export-Mailbox and Disable-Mailbox cmdLETS PowerShell
AD GUI - Exchange Advanced Tab, Mailbox rights PowerShell
Re: List AD user with or without an Exchange Mailbox PowerShell
Deleting A Folder In A User Mailbox In Exchange 2007 PowerShell
Creating a new mailbox on Exchange 2007 PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46