Solved

Report on Shared Calendar permissions

Posted on 2013-06-10
6
759 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
  • 3
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Adam Brown
Comment Utility
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
Comment Utility
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 38

Accepted Solution

by:
Adam Brown earned 120 total points
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:adokilla
Comment Utility
Thanks that worked.
0
 

Author Closing Comment

by:adokilla
Comment Utility
Thanks that worked.
0
 

Expert Comment

by:Rob Wilderman
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now