get-mailboxfolderpermission with /

Dear All,

 

I came across a rather strange phenomen. When I would like to view folder in outlook, which contain / slash.

for example bbr:“\00 Eingehende E-Mails\10/20er Regel”:

When I use exactly this string I can execute this command:

$users = (Get-MailboxFolderpermission bbr:"\00 Eingehende E-Mails\10/20er Regel").user.adrecipient.UserPrincipalName

but when I use it in value I am getting error:

$fname = "bbr:"\00 Eingehende E-Mails\10/20er Regel""

$fname
bbr:"\00 Eingehende E-Mails\10/20er Regel"

$users = (Get-MailboxFolderpermission $fname).user.adrecipient.UserPrincipalName
Cannot process argument transformation on parameter 'Identity'. Cannot convert value "bbr:"\00 Eingehende E-Mails\10/20er Regel"" to type
"Microsoft.Exchange.Configuration.Tasks.MailboxFolderIdParameter". Error: "The mailbox folder identity "bbr:"\00 Eingehende E-Mails\10/20er Regel"" isn't in the correct format. The correct
format should look like this: "<MailboxIdentity>:<FolderPath>". "

How comes, oh wonders.

Could you guys maybe help me with this mind boggling puzzle :slight_smile:

best regards

Artur

You don’t need inner quotes if you are storing it in a variable. The shell won’t parse them out if in a variable first. Use the following:

$fname = 'bbr:\00 Eingehende E-Mails\10/20er Regel'

 

Worked like a charm

May the road rise to meet you,
May the wind be always at your back.
May the sun shine warm upon your face,
The rains fall soft upon your fields.

Thank you so much AdminOfThings45