list delegates in mailbox

COuld someone provide me with a powershell sample that will list all delegates for a certain mailbox?
tike55Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Daryl BamforthTechnical ExpertCommented:
Think this is what your looking for ..
https://www.experts-exchange.com/questions/27897485/Listing-Outlook-delegates-via-Powershell-Exchange-2010.html

Assuming it is Exchange your using?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tike55Author Commented:
so....
if the mailbox is named john.doe, where would that be placed in the code?

Foreach ($user in get-mailbox -ResultSize unlimited) {
  get-mailbox $user | Get-CalendarProcessing | select resourcedelegates | % {
    New-Object PSObject -Property @{Username = $user; ResourceDelegates = $_}
    Write-host $User $Delegate}
  }
} | Export-Csv c:\resourcedelegates.csv -NoTypeInformation
0
Daryl BamforthTechnical ExpertCommented:
if that is their username that that would be the $user variable.

So

$user = "john.doe"

Open in new window


If you had a list of users in a file it would be

$user = get-content c:\userlist.txt

Open in new window

0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

tike55Author Commented:
When I run the script and change the export to my desktop I get the following.

At line:6 char:2
+  } | Export-Csv C:\Users\JT\Deskt
+  ~
Unexpected token '}' in expression or statement
At line:6 char:4
+  } | Export-Csv C:\Users\JT\Deskt
+    ~
An empty pipe element is not allowed.
    + CategoryInfo          : ParserError: (:)
    + FullyQualifiedErrorId : UnexpectedToken
0
AlanConsultantCommented:
Hi Tike55,

Try this command:

Get-Mailbox -ResultSize Unlimited | 
  Get-CalendarProcessing | 
  Select Identity -Expand ResourceDelegates | 
  Select @{n="Name"; e={$_.Identity.Name}}, @{n="ResourceDelegates"; e={$_.Name}} |
  Export-CSV C:\Temp\ZZ_ResourceDelegates.csv -NoTypeInformation

Open in new window


Also from the above previous question, but I think this one works, whereas the other one doesn't.  I had a very quick looks, and it seems to have some syntax errors in it.


Alan.
0
tike55Author Commented:
thanks Alan,

if my user logon name in AD is John.Doe, where would I enter that in your script?
0
AlanConsultantCommented:
Hi Tike55,

If you just want that one mailbox, then try this:

Get-Mailbox -Identity "John.Doe" | 
  Get-CalendarProcessing | 
  Select Identity -Expand ResourceDelegates | 
  Select @{n="Name"; e={$_.Identity.Name}}, @{n="ResourceDelegates"; e={$_.Name}} |
  Export-CSV C:\Temp\ZZ_ResourceDelegates.csv -NoTypeInformation

Open in new window



Alan.
0
tike55Author Commented:
the script runs with no errors.  the output csv has nothing in it. 0 bytes

I know the mailbox has several delegates.
0
AlanConsultantCommented:
Hi Tike55,

If you run the script before, it should give you a CSV with all mailboxes and their delegates.

Does that one work for you?

If so, does John.Doe appear in there with the delegates?

Alan.
0
tike55Author Commented:
We have thousands of users, so if I could just get the one that would be great.
0
AlanConsultantCommented:
Yes, but I am trying to determine if the first command is working for you.  If it isn't then the second one won't either, whereas if it is, then we can focus on the parameter.

Please can you run that full report, open it in Excel (say) and have a look (do a search for John.Doe) and see if they are listed there.  If they are, but in some other form than "John.Doe" then substitute that into the second command and re-run that, then post back if it is working.

Thanks,

Alan.
0
AlanConsultantCommented:
Hi Tike55,

How are you going?

Does John.Doe appear in the full report?

Thanks,

Alan.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.