How list Get-MailboxFolderPermission
Hi, Im trying to create a powershell script that searches all mailboxes and displays the permission on :Inbox If I do this on a single mailbox: # Get-MailboxFolderPermission - identity awestwood:\Inbox | select User, FolderName, AccessRight So the question is how I can get this into a foreach loop that displays all mailboxes in my environment with the above cmdlet strings... Edit: what I want to achieve is something like this but one that works! :) $Mailbox = Get-Mailbox -resultsize unlimited | foreach { $Mailbox (Get-MailboxFolderPermission -identity $alias:\Inbox | select User, FolderName, AccessRight) } ftornell | Personal Blog: http://www.logicspot.NET
June 2nd, 2010 5:15pm

$AllUsers = get-mailbox * | select SamAccountName ForEach ($User in $AllUsers) { $Mailbox = ""+ $User +":\Inbox" get-mailboxfolderpermission -identity $Mailbox | Select User, FolderName, AccessRight | Out-File c:\Inbox_Permissions.txt -append } I choose samaccountname but you can change that in alias or whatever is unique... Greetzz, Timmy
Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2010 5:25pm

This seems to work: get-mailbox |% {get-mailboxfolderpermissoin -identity ($_.alias + ":\Inbox") | select User,Foldername,AccessRight[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
June 2nd, 2010 5:33pm

Hi guys. Speedyt the output file now displays: User FolderName AccessRight ---- ---------- ----------- Default Inbox Jack Bauer Inbox James Bond Inbox dont know why the permissions dont show and I would like to know what box im currently on. like Alex smith User FolderName AccessRight ---- ---------- ----------- Default Inbox Jack Bauer Inbox James Bond Inbox Tracy Jones User FolderName AccessRight ---- ---------- ----------- Default Inbox Jack Bauer Inbox James Bond Inbox ftornell | Personal Blog: http://www.logicspot.NET
Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2010 5:49pm

Hi, Possibly is AccessRight not the correct Object. Do this: get-mailboxfolderpermission -identity User:\Inbox | get-member Check the different objects and find the one for AccessRight Replace AccessRight with the correct name. That should do it... Or post the output from your single mailbox query... I'm out for today but I'll check you're post tomorrow morning. Greetzz, Timmy
June 2nd, 2010 6:02pm

The property name is "AccessRights" - plural.[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
Free Windows Admin Tool Kit Click here and download it now
June 2nd, 2010 6:16pm

This should do it than... thx mjolinor for the property name :-) $AllUsers = get-mailbox * | select Alias ForEach ($User in $AllUsers) { $Mailbox = ""+ $User +":\Inbox" $Text0 = "---" $Text1 = "" $Text2 = "AccessRights For Mailbox: "+ $User +"" $Text3 = "" $Text4 = "---" $Text5 = "" $Text0 | Out-File c:\Inbox_Permissions.txt -append $Text1 | Out-File c:\Inbox_Permissions.txt -append $Text2 | Out-File c:\Inbox_Permissions.txt -append $Text3 | Out-File c:\Inbox_Permissions.txt -append $Text4 | Out-File c:\Inbox_Permissions.txt -append get-mailboxfolderpermission -identity $Mailbox | Select User, FolderName, AccessRights | Out-File c:\Inbox_Permissions.txt -append $Text5 | Out-File c:\Inbox_Permissions.txt -append } This is written without any PS so paste it into an editor to check if its right. I guess it will work :-) Let me know if it fits your needs :-) Greetzz, Timmy
June 2nd, 2010 7:29pm

Hi Speedyt, What worked great! Thx!ftornell | Personal Blog: http://www.logicspot.NET
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2010 9:07am

If I would like to use this list now for example to set the send as permission on a user the command is: Add-ADPermission "Alex Westwood" -User "domain\user" -Extendedrights "Send As" Alex Westwood is displayd as Displayname in the file u help me with but the output of the permission holders are also displayed as DisplayName but when we are to use Powershell it dont accept -user doman\Jack Bauer it wants an alias like domain\jbauer. Is there anyway in your script to also get the alias of the once holding the permision Editor, because they are about to get send as.ftornell | Personal Blog: http://www.logicspot.NET
June 4th, 2010 9:59am

Hi, It's true that the displayname is not accepted in that command. So you better select the mailbox on displayname with get-mailbox cmdlet and than pipe it for the next cmdlet add-adpermission. get-mailbox "Alex Westwood" | Add-ADPermission -ExtendedRights "Send-As" By Piping the get-mailbox info (this is the place where you make the selection) you got all the information for the next cmdlet. This should do it. Good luck, Timmy
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2010 11:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics