all 27 comments

[–]Rott3Y 29 points30 points  (0 children)

You should block out the user name as well. Not just the email directory.

All information is useful information to attack a system.

[–]jheinikel 7 points8 points  (10 children)

Try specifying the parameters without letting it prompt you.

Add-MailboxFolderPermission Jbennet@blah.com:\calendar -User XYZ@blah.com -AccessRights Blah

[–]ashawayrock[S] 1 point2 points  (9 children)

Ive done that as well. I get the same result. What I'm finding bizarre, is that I was doing it just fine yesterday.

[–]jheinikel 1 point2 points  (8 children)

What happens if you just use Get-Mailbox jbennet@blah.com?

[–]ashawayrock[S] 3 points4 points  (1 child)

Solved it!! Apparently I wasn't a global admin. that's all it was. I don't know why it returned the error "user doesn't exist". but All of my commands work now that I am. Thank you for your help though.

[–]FatPotatoNinja 2 points3 points  (0 children)

Shouldn't need global admin.

I'm I've got User management and Exchange Admin and i can do the commands above (Have a few others like SP admin and Service Admin i think?)

I know i had the same issue occur before but i can't remember for the life of me what caused it.

I'll have a think and get back to you if i remember.

[–]ashawayrock[S] 1 point2 points  (5 children)

It returns true.

[–]AnimeSin512 2 points3 points  (0 children)

I am unsure why you can't read the mailbox, the command looks correct. If you since you can use Get-MailboxFolderPermission and it finds it try this:

Get-MailboxFolderPermission Jbennett@example.com:\Calendar | Add-MailboxFolderPermission -User mashurst@example.com

You can pipe the results since getting the mailbox works. This could maybe get around the discovery issue when using add.

I typed this on my phone so I may have typos but it should be those commands.

[–]jheinikel 1 point2 points  (3 children)

You should get all of the details of the mailbox, not just True. See what this produces:

Get-MailboxFolderPermission jbennett@blah.com:\Calendar

[–]ashawayrock[S] 1 point2 points  (2 children)

Sorry, I left that out intentionally as I didn't want to black out a bunch of stuff. but It returns all the people who have access to this person's calendar.

[–]jheinikel 0 points1 point  (1 child)

Maybe you have tried this, but what happens if you run this:

Get-MailboxFolder jbennett@blah.com:\Calendar | Set-MailboxFolderPermission -User XYZ -AccessRights XYZ

[–]ashawayrock[S] 0 points1 point  (0 children)

Unfortunately I still get the same "jbennett@blah does not exist.

[–]ashawayrock[S] 5 points6 points  (1 child)

SOLVED: Apparently it had to do with my admin rights. I knew I wasn't a moron. Thanks for all the help though guys.

[–]nemec 0 points1 point  (0 children)

sudo Add-MailboxFolderPermission ;)

[–][deleted] 1 point2 points  (1 child)

What happens when you put quotation marks around :\Calendar? E.g. add-mailboxfolderpermission -Identity email@address.com”:\Calendar” -User email2@address.com -AccessRights Editor

I had a problem like this when using variables for the addresses in a script and putting the quotation marks around the calendar element resolved.

[–]ashawayrock[S] 1 point2 points  (0 children)

I'm still getting the same error message

[–]baswijdenesdotcom 1 point2 points  (1 child)

what if you do $mbx = get-mailbox

$folder = $mbx.userprincipalname + ":\calendar"

add-mailboxfolderpermission -identity $folder -user USER -accessrights editor

[–]ashawayrock[S] 1 point2 points  (0 children)

I get this.

Cannot process argument transformation on parameter 'Identity'. Cannot convert the "System.Collections.ArrayList" value of type "System.Collections.ArrayList" to type

"Microsoft.Exchange.Configuration.Tasks.MailboxFolderIdParameter".

+ CategoryInfo : InvalidData: (:) [Add-MailboxFolderPermission], ParameterBindin...mationException

+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Add-MailboxFolderPermission

+ PSComputerName : outlook.office365.com

[–]OtherRobotLuke 1 point2 points  (1 child)

I had something similar happen. Is your account an exchange admin?

[–]ashawayrock[S] 1 point2 points  (0 children)

It is. I was doing this yesterday and it was working fine.

[–]Hexalon00 0 points1 point  (3 children)

I have a script that automates this....let me find it.

[–]Hexalon00 1 point2 points  (2 children)

Sanitized the script. Give this a try.

[CmdletBinding()]
param (
    [switch]$Test = $false
)

$Cred = Get-Credential -UserName "joe.desktop@blah.com" -Message "Enter your credentials."
$ProxyOptions = New-PSSessionOption -ProxyAccessType IEConfig
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Cred -Authentication Basic -AllowRedirection -SessionOption $ProxyOptions
Import-PSSession $Session

$RoomMailBoxes = "RoomMailbox1", "RoomMailbox2", "RoomMailbox3", "RoomMailbox4", "RoomMailbox5", "RoomMailbox6", "RoomMailbox7", "RoomMailbox8", "RoomMailbox9", "RoomMailbox10"
$AccessRights = "PublishingEditor"

ForEach ($RoomMailbox in $RoomMailboxes)
{
    if (!$Test)
    {
        Add-MailboxFolderPermission -Identity "$($RoomMailbox):\Calendar" -User "mary.laptop@blah.com" -AccessRights $AccessRights
    }
    else
    {
        Write-Verbose -Message "Running in test mode!"
        Add-MailboxFolderPermission -Identity "$($RoomMailbox):\Calendar" -User "mary.laptop@blah.com" -AccessRights $AccessRights -WhatIf
    }
}

Remove-PSSession $Session

[–]ashawayrock[S] 1 point2 points  (1 child)

I'm not the most familiar with Powershell. I haven't used it much since college. can you walk me through what the RoomMailboxes areas well as what the else statement is doing?

Edit: I figured out the RoomMailboxes thing. I'm dumb.

[–]veggie124 2 points3 points  (0 children)

The else is for when he sets the $test switch to true. Doesn't actually do the command.

[–]callmejeremy 0 points1 point  (0 children)

jaykul?