• Status: Solved
  • Priority: Medium
  • Security: Private
  • Views: 41
  • Last Modified:

list delegates in mailbox

COuld someone provide me with a powershell sample that will list all delegates for a certain mailbox?
0
tike55
Asked:
tike55
  • 5
  • 5
  • 2
2 Solutions
 
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
 
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
Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

  • 5
  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now