It's expecting a string argument.  Without explicitly making it a string, the 
parser is getting confused by that colon.

In powershell you can have something called psdrives, which map and act like 
dos drives, but can have arbitrary names (not just a single letter).  That 
colon is making it think it's looking for a folder called \calendar at whatever 
psdrive is named $_.  There's no such drive, so the result is null.  Those 
extra bits make it parse as a literal string instead of a psdrive and path.

From: Damien Solodow [mailto:damien.solo...@harrison.edu]
Sent: Thursday, January 12, 2012 1:26 PM
To: MS-Exchange Admin Issues
Subject: RE: Script assist


Yeah, that worked. I'm curious though as to why the extra parts are necessary 
though.

________________________________
From: Campbell, Rob [rob_campb...@centraltechnology.net]
Sent: Thursday, January 12, 2012 1:09 PM
To: MS-Exchange Admin Issues
Subject: RE: Script assist
Does this work any better?

Get-content list.txt | foreach-object -process {add-mailboxfolderpermission 
"$($_):\calendar" -user "Admin Assistants" -accessrights Editor}


From: Damien Solodow 
[mailto:damien.solo...@harrison.edu]<mailto:[mailto:damien.solo...@harrison.edu]>
Sent: Thursday, January 12, 2012 10:26 AM
To: MS-Exchange Admin Issues
Subject: Script assist

Ok, this should be easy but I'm missing something dumb.
I have a list of email addresses for mailboxes and I want to grant a group 
Editor rights to the calendar of every mailbox in that list.

Here's what I'm running:
Get-content list.txt | foreach-object -process {add-mailboxfolderpermission 
$_:\calendar -user "Admin Assistants" -accessrights Editor}

When I run it I get "the specified mailbox "\calendar" doesn't exist.
If I do get-content list.txt | foreach-object -process {write-host $_} I get a 
list of the email addresses in the file.

Get-content list.txt | gm says they are strings.

Exchange 2010 SP2.

DAMIEN SOLODOW
Systems Engineer
317.447.6033 (office)
317.447.6014 (fax)
HARRISON COLLEGE
500 North Meridian St
Suite 500
Indianapolis, IN 46204-1213
www.harrison.edu<http://www.harrison.edu/>


---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
with the body: unsubscribe exchangelist

**************************************************************************************************

Note:

The information contained in this message may be privileged and confidential and

protected from disclosure.  If the reader of this message is not the intended

recipient, or an employee or agent responsible for delivering this message to

the intended recipient, you are hereby notified that any dissemination,

distribution or copying of this communication is strictly prohibited. If you

have received this communication in error, please notify us immediately by

replying to the message and deleting it from your computer.

**************************************************************************************************

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
with the body: unsubscribe exchangelist

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to 
listmana...@lyris.sunbeltsoftware.com<mailto:listmana...@lyris.sunbeltsoftware.com>
with the body: unsubscribe exchangelist
**************************************************************************************************
Note: 
The information contained in this message may be privileged and confidential 
and 
protected from disclosure.  If the reader of this message is not the intended  
recipient, or an employee or agent responsible for delivering this message to  
the intended recipient, you are hereby notified that any dissemination,   
distribution or copying of this communication is strictly prohibited. If you  
have received this communication in error, please notify us immediately by  
replying to the message and deleting it from your computer. 
**************************************************************************************************

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to listmana...@lyris.sunbeltsoftware.com
with the body: unsubscribe exchangelist

Reply via email to