Solved

Report on Shared Calendar permissions

Posted on 2013-06-10
6
879 Views
Last Modified: 2016-11-29
I am trying to figure out how can i make this powershell command also include the actual identity of the users calendar

(Get-Mailbox -ResultSize unlimited) | foreach {
      $alias = $_.alias;
      $User = $_.User
    $FolderName = $_.FolderName
    $AccessRights = $_.AccessRights
      Get-MailboxFolderPermission "$($alias):\calendar" | ? { $_.user -like "Default"} | select @{n="Alias";e={$alias}},@{n="User";e={$User}},@{n="FolderName";e={$FolderName}}@{n="AccessRights";Expression={[string]::join(', ', $_.AccessRights)}}
}

The powershell script does get all the needed values expect the actual users mailbox that am trying to see who has what access.

I should get an output as follows the actual Users mailbox (Alias), the FolderName and the access rights the user has for those folder names. I get everything expect Alias as an output.

Thanks
0
Comment
Question by:adokilla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:Adam Brown
ID: 39236256
Alias isn't a variable that is returned by the get-mailboxfolderpermissions cmdlet. Your select is pulling data from that cmdlet only, so Alias won't be an object that is discovered by it, and as a result it won't output anything for Alias. You could replace alias with identity in your select and you'll get some identifying information, but it will probably not be what you want. The real solution would be to create a new PSObject and package variables into it. Like this:

(Get-Mailbox -ResultSize unlimited) | foreach {
      $alias = $_.alias;
      $User = $_.User
#create object
      $output = new-object -typename psobject
#add alias to new object
      $output | Add-Member –MemberType NoteProperty –Name Alias –Value $alias
#get permission info
      $perms = Get-MailboxFolderPermission $alias":\calendar" | ? { $_.user -like "Default"} | select  accessrights,foldername,user
#add permission info to object
      $output | Add-Member -MemberType NoteProperty -Name User -value $perms.user
      $output | Add-Member -MemberType NoteProperty -Name FolderName -value $perms.foldername
      $output | Add-Member -MemberType NoteProperty -Name AccessRights -value $perms.AccessRights
#output the data
      $output | fl}
      

Open in new window

0
 

Author Comment

by:adokilla
ID: 39237784
How do i export this to a csv ? and make it readable as i tried using Export-Csv but its all numbers that gets exported nothing is readable.

Thanks
0
 
LVL 40

Accepted Solution

by:
Adam Brown earned 120 total points
ID: 39239320
replace the fl at the end with
export-csv c:\file.csv -append

Make sure c:\file.csv doesn't exist. If you put the export after fl it will break.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:adokilla
ID: 39296952
Thanks that worked.
0
 

Author Closing Comment

by:adokilla
ID: 39296955
Thanks that worked.
0
 

Expert Comment

by:Rob Wilderman
ID: 41905827
I keep getting this:

Export-Csv : A parameter cannot be found that matches parameter name 'append'.
At C:\users\rwilderman\CalendarPermissionsReport.ps1:15 char:79
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question