Powershell Mailbox For-Each query Share on Facebook Post on reddit Tweet on Twitter Share on LinkedIn Home › Forums › Messaging Software › Exchange 2007 / 2010 / 2013 › Powershell Mailbox For-Each query This topic has 1 reply, 1 voice, and was last updated 9 years, 2 months ago by Pdog. Viewing 1 post (of 1 total) Author Posts PdogMember Sep 16, 2011 at 9:06 am #156214 Hi Peeps, I am attempting to add a mailbox permission to a bunch of users via the shell. This is what I have established so far: I have a text file of the SMTP addresses of the users. (c:users.txt) [email protected] [email protected] [email protected] [email protected] I ran the command $users = get-content “C:users.txt” | get-mailbox I know I want to use this command: $Users | add-mailboxpermission -user “Domainfirstnamelastname -AccessRights FullAcccess The problem is the add-mailboxpermission requires the -identity switch first, how do I reference $users? I tried a foreach-object but it didn’t work, any ideas? Author Posts Viewing 1 post (of 1 total) You must be logged in to reply to this topic.