List Get-MailboxFolderPermission (and export to a file)
-
14 mai 2012 08:14
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.GetMailboxFolderPermissionIt 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 }
Toate mesajele
-
14 mai 2012 09:03
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).- Propus ca răspuns de PGT2008 14 mai 2012 09:03
- Editat de PGT2008 14 mai 2012 09:05 typo
- Marcat ca răspuns de Paddy Maxson 14 mai 2012 09:59
-
14 mai 2012 09:59
Not only does it work now, but I greatly appreciate that you explained it to me!
Thank you.
-
30 iunie 2012 17:39
If with the change this script does not work for me and I get the following error condition, can anybody help its really urgent?
The specified mailbox "JoKeller\inbox" doesn't exist.
+ CategoryInfo : NotSpecified: (0:Int32) [Get-MailboxFolderPermission], ManagementObjectNotFoundException
+ FullyQualifiedErrorId : 61B39A5A,Microsoft.Exchange.Management.StoreTasks.GetMailboxFolderPermission- Propus ca răspuns de leslie hill 13 august 2012 11:36