Exchange 2007 Management Shell Scripting Question

Status
Not open for further replies.
P

Peter Venkman

Hi,

I have no experience scripting with powershell or the management

shell, and I was looking for a little insight. I just need to do a

couple very simple scripts for a recipient admin to run on resource

mailboxes. For example, they'd need to run this on a conference room

mailbox called testcr:

Set-MailboxCalendarSettings testcr –AutomateProcessing:Autoaccept

Set-MailboxCalendarSettings testcr –DeleteSubject $false

The problem being is that we have no way of knowing what mailbox

they'll have to run it against as they create them. How would I make

the script prompt for a mailbox?

Likewise, if I wanted to add restrictive permissions how would I get

it to prompt for both mailbox and allowed user? (completed command

ex: Set-MailboxCalendarSettings testcr –BookInPolicy:user@domain.com)

Thanks in advance!
 
E

Ed Crowley [MVP]

$name = Read-Host "Enter server name"

$caladmin = Read-Host "Enter calendar administrator in user@domain.com form"

Set-MailboxCalendarSettings

$name –AutomateProcessing:Autoaccept –DeleteSubject

$false –BookInPolicy:$calad min

You need but one command line to apply all swtiches.

Ed Crowley MVP

"There are seldom good technological solutions to behavioral problems."

> .

"Peter Venkman" <pauldi@iona.com> wrote in message

news:c629f297-35b8-4ad9-b9e8-2d4668e0671b@r19g2000yqb.googlegroups.com...

Hi,

I have no experience scripting with powershell or the management

shell, and I was looking for a little insight. I just need to do a

couple very simple scripts for a recipient admin to run on resource

mailboxes. For example, they'd need to run this on a conference room

mailbox called testcr:

Set-MailboxCalendarSettings testcr –AutomateProcessing:Autoaccept

Set-MailboxCalendarSettings testcr –DeleteSubject $false

The problem being is that we have no way of knowing what mailbox

they'll have to run it against as they create them. How would I make

the script prompt for a mailbox?

Likewise, if I wanted to add restrictive permissions how would I get

it to prompt for both mailbox and allowed user? (completed command

ex: Set-MailboxCalendarSettings testcr –BookInPolicy:user@domain.com)

Thanks in advance!
 
D

Dr Venkman

Thank you.

I have tried that with a simple script:

$RoomName=READ-HOST "Enter Mailbox Name"

set-mailboxcalendarsettings $RoomName -automateprocessing:autoaccept

--
When I run that script though, a window pops up for a fraction of a

second and closes.

On Jan 28, 5:36 pm, "Ed Crowley [MVP]" <cursp...@nospam.net> wrote:
> $name = Read-Host "Enter server name"
> $caladmin = Read-Host "Enter calendar administrator in u...@domain.com form"
> Set-MailboxCalendarSettings
> $name –AutomateProcessing:Autoaccept –DeleteSubject
> $false –BookInPolicy:$calad min

> You need but one command line to apply all swtiches.
> > Ed Crowley MVP
> "There are seldom good technological solutions to behavioral problems."
> .

> "PeterVenkman" <pau...@iona.com> wrote in message

> news:c629f297-35b8-4ad9-b9e8-2d4668e0671b@r19g2000yqb.googlegroups.com...
> Hi,

> I have no experience scripting with powershell or the management
> shell, and I was looking for a little insight.  I just need to do a
> couple very simple scripts for a recipient admin to run on resource
> mailboxes.  For example, they'd need to run this on a conference room
> mailbox called testcr:

> Set-MailboxCalendarSettings testcr –AutomateProcessing:Autoaccept
> Set-MailboxCalendarSettings testcr –DeleteSubject $false

> The problem being is that we have no way of knowing what mailbox
> they'll have to run it against as they create them.  How would I make
> the script prompt for a mailbox?

> Likewise, if I wanted to add restrictive permissions how would I get
> it to prompt for both mailbox and allowed user?  (completed command
> ex: Set-MailboxCalendarSettings testcr –BookInPolicy:u...@domain.com)

> Thanks in advance!
 
J

Jamestechman

Did you try:

$RoomName=READ-HOST -prompt "Enter Mailbox Name"

James Chong (MVP)

MCITP | EA | EMA; MCSE | M+, S+

Security+, Project+, ITIL

On Feb 2, 10:55 am, Dr Venkman <pdimar...@gmail.com> wrote:
> Thank you.

> I have tried that with a simple script:

> $RoomName=READ-HOST "Enter Mailbox Name"

> set-mailboxcalendarsettings $RoomName -automateprocessing:autoaccept

> --
> When I run that script though, a window pops up for a fraction of a
> second and closes.

> On Jan 28, 5:36 pm, "Ed Crowley [MVP]" <cursp...@nospam.net> wrote:

>
> > $name = Read-Host "Enter server name"
> > $caladmin = Read-Host "Enter calendar administrator in u...@domain.com form"
> > Set-MailboxCalendarSettings
> > $name –AutomateProcessing:Autoaccept –DeleteSubject
> > $false –BookInPolicy:$calad min

>
> > You need but one command line to apply all swtiches.
> > > > Ed Crowley MVP
> > "There are seldom good technological solutions to behavioral problems."
> > .

>
> > "PeterVenkman" <pau...@iona.com> wrote in message

>
> >news:c629f297-35b8-4ad9-b9e8-2d4668e0671b@r19g2000yqb.googlegroups.com....
> > Hi,

>
> > I have no experience scripting with powershell or the management
> > shell, and I was looking for a little insight.  I just need to do a
> > couple very simple scripts for a recipient admin to run on resource
> > mailboxes.  For example, they'd need to run this on a conference room
> > mailbox called testcr:

>
> > Set-MailboxCalendarSettings testcr –AutomateProcessing:Autoaccept
> > Set-MailboxCalendarSettings testcr –DeleteSubject $false

>
> > The problem being is that we have no way of knowing what mailbox
> > they'll have to run it against as they create them.  How would I make
> > the script prompt for a mailbox?

>
> > Likewise, if I wanted to add restrictive permissions how would I get
> > it to prompt for both mailbox and allowed user?  (completed command
> > ex: Set-MailboxCalendarSettings testcr –BookInPolicy:u...@domain.com)

>
> > Thanks in advance!-


 
Status
Not open for further replies.
Top