Inserting Variable into command?

Hi,

I'm having some real trouble trying to insert a variable into a command like this:

Add-MailboxFolderPermission-Identity$FeeEarner:\"Inbox"-User$Secretary-AccessRightsEditor

It won't take the $FeeEarner:\"Inbox" part, I know it looks very wrong but I have no idea how it should be, tried all sorts!

Any help is much appreciated.

Thanks

Dave

September 7th, 2015 6:21pm

This is how we need to work with this situation.

$identity='{0}:\Inbox' -f $FeeEarner
Add-MailboxFolderPermission -Identity $identity -User $Secretary -AccessRightsEditor

Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 6:41pm

This works for me

Add-MailboxFolderPermission -Identity "$($FeeEarner):\Inbox" -User $Secretary -AccessRightsEditor

September 7th, 2015 7:38pm

This works for me

Add-MailboxFolderPermission -Identity "$($FeeEarner):\Inbox" -User $Secretary -AccessRightsEditor

  • Proposed as answer by Mike Laughlin 18 hours 38 minutes ago
  • Marked as answer by I.T. Dave 16 hours 17 minutes ago
Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 11:37pm

This works for me

Add-MailboxFolderPermission -Identity "$($FeeEarner):\Inbox" -User $Secretary -AccessRightsEditor

  • Proposed as answer by Mike Laughlin Tuesday, September 08, 2015 12:30 PM
  • Marked as answer by I.T. Dave Tuesday, September 08, 2015 2:51 PM
September 7th, 2015 11:37pm

Thanks that worked perfectly.

Thank you all for your help.

Dave

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 9:51am

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

Other recent topics Other recent topics