Exchange 2010 powershell script enabling account services automatically

I used this script below to create exchange users from existing AD accounts. It does it well except for the fact that it enables OWA and pop3. Any reason why this automatically does this without me even specifying to do so. When I create an account by hand this does not happen.

$mailbox=import-csv C:\temp\mailusers.CSV
ForEach ($mailbox in $mailbox) {Enable-Mailbox -Identity $Mailbox.Identity -Database $Mailbox.Database | Enable-Mailbox –Archive -ArchiveDatabase $Mailbox.Database}
techdriveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheBDPSr. Sys EngineerCommented:
OWA, ActiveSync, and POP3 are enabled by default. You should be able to update your script to disable it if you don't want it. But you would have to explicitly tell it  you want to disable it.
0
Muralidharan RAssociate ConsultantCommented:
While creating mailbox, OWA, POP3 are automatically enabled.
You need to add Set-CasMailbox cmdlet in your script to disable it..

http://support.microsoft.com/kb/2573225

http://exchangeserverpro.com/modify-settings-multiple-exchange-2010-mailboxes/
0
techdriveAuthor Commented:
If you have POP3 service disabled why would it automatically enable POP3 accounts.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Muralidharan RAssociate ConsultantCommented:
By default POP3 and IMAP enabled in mailboxes.

untill you start the IMAP and POP3 services in CAS server, users cannot connect to mailbox using POP3 & IMAP.

The below link would help you to understand more,

http://technet.microsoft.com/en-us/library/bb124107(v=exchg.141).aspx
0
SubsunCommented:
If you have POP3 service disabled why would it automatically enable POP3 accounts.
Even if the user account is pop3 enabled (which is by design) the user won’t be able to access the mailbox using pop3 protocol unless you enable the service on server.
0
techdriveAuthor Commented:
Thanks for all the helpful info guys
0
techdriveAuthor Commented:
Any alternatives to disable pop3 from being enabled on the users account when it is created.
0
Muralidharan RAssociate ConsultantCommented:
I don't think you could disable POP3 and IMAP while creating mailbox.

But you could use template to create mailbox..

http://www.petri.co.il/using-templates-to-create-exchange-recipient-objects-part-1.htm 

you need to add the below cmdlet while creating templates.
[add set-casmailbox -ActiveSyncEnabled $false -PopEnabled $false -ImapEnabled $false ]

Also the below link would help you to find other way,

http://social.technet.microsoft.com/Forums/exchange/en-US/ed59af64-6287-421a-ada8-c221d3a4bcc5/disable-pop3imapactivesync-globally-in-exchange-2010
0
SubsunCommented:
If you are talking about the script then you can pipe the Enable-Mailbox result to Set-CASMailbox to disable pop and IMAP... For example..
$mailbox=import-csv C:\temp\mailusers.CSV
ForEach ($mailbox in $mailbox) {Enable-Mailbox -Identity $Mailbox.Identity -Database $Mailbox.Database | Enable-Mailbox –Archive -ArchiveDatabase $Mailbox.Database | Set-CASMailbox -PopEnabled:$false -ImapEnabled:$false}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.