Solved

Report on Shared Calendar permissions

Posted on 2013-06-10
6
899 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 41

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 41

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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
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…

688 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