List Get-MailboxFolderPermission (and export to a file)
Good Morning!
I'm using the below script from this thread:
http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/d8ffef98-cd5f-4ce9-94cf-47cca32961b1/#7bd9aa52-1afd-490b-898c-dbd7aeca3a22 in Exchange 2010, however it throws the following error:
The specified mailbox "@{Alias=USER}" doesn't exist.
+ CategoryInfo : NotSpecified: (0:Int32)
[Get-MailboxFolderPermission], ManagementObjectNotFoundException
+ FullyQualifiedErrorId :
DDDCC6C6,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission
It seems like instead of just picking the alias, it picks "alias=the alias" so it doesn't work correctly.
Is there a fix for this? I had other notions of maybe using a CSV file with all the mailbox names under a heading called displayName but thinking through it is a bit much for my amateur mind on Monday morning.
Thanks in advance
Paddy
$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
}
May 14th, 2012 4:14am
Try this
$mailbox = "" +$user.alias + "\inbox"
Lets explain why
$user is an object list based on get-mailbox, with only specific attributes
So you had to address which attribute you wanted even dough it had only one included (but that could have been more too).
Free Windows Admin Tool Kit Click here and download it now
May 14th, 2012 5:03am
Not only does it work now, but I greatly appreciate that you explained it to me!
Thank you.
May 14th, 2012 5:59am