Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

remove mail user in mail contact in exchange management shell

Posted on 2009-06-29
3
Medium Priority
?
1,178 Views
Last Modified: 2012-05-07
Hi,
first I 'd like to find a script to remove mail user in mail contact in exchange management shell.

And I have script to enable a user mailbox.
Enable-MailUser -Identity 'AD.LOCAL/MIS/test' -Alias 'test' -ExternalEmailAddress 'SMTP:test@mail.com'
I'd like to put them together and run in exchange management shell.
My questions is when I run test.ps1 it showed me a error message, "The term 'enable_mail_yantest.psl' is not recognized as a cmdlet, function, operable program, or script file. Verify the term and try again."

Please help,
Thanks,
0
Comment
Question by:luyan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 20

Accepted Solution

by:
Rick Fee earned 1500 total points
ID: 24737228
Try this...this works for me:

Remove-MailContact aliasofcontact
Enable-MailUser test -Alias test -ExternalEmailAddress SMTP:test@mydomain.com

This only makes contacts...are you looking to have the test user account to have a mailbox on the exchange database?
0
 

Author Comment

by:luyan
ID: 24739605
Yes, I'd like to have the test user account have a mailbox on exchange.

Thx
0
 

Author Comment

by:luyan
ID: 24739809
when I run
Remove-MailContact aliasofcontact
it said
Object could not be found on domain controller.
So I tried command,
REmove-mailuser test

it is successful with some option 'y' 'a', n'',...

but when I run,
Enable-MailUser test -Alias test -ExternalEmailAddress SMTP:test@mydomain.com
it said,
object /ad/mis/test' could not be found on domaincontroller
I thought remove-mailuser removed user account as well, right?

Can I run them in batch file and silently?

Remove-Mailuser aliasofcontact
Enable-MailUser test -Alias test -ExternalEmailAddress SMTP:test@mydomain.com

Thanks,

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question