[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Report on Shared Calendar permissions

Posted on 2013-06-10
6
Medium Priority
?
966 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 43

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 43

Accepted Solution

by:
Adam Brown earned 360 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
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.

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
This video discusses moving either the default database or any database to a new volume.
Starting up a Project
Suggested Courses

656 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