Ignore output message

Welcome Forums General PowerShell Q&A Ignore output message

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years ago.

  • Author
  • #5433

    Points: 0
    Rank: Member

    by PatricF at 2013-01-15 05:58:22


    If I run a command, like: Set-MailContact -Identity "User One" -CustomAttribute "Testing"
    I get this message:

    WARNING: The command completed successfully but no settings of 'domain.com/Microsoft Exchange Hosted Organizations/TestOrg/User One' have been modified.

    I tried to add | Out-Null but I still get the message. I don't want any feedback at all from the command, even if it's a red error message. How do I fix this?

    by ArtB0514 at 2013-01-15 06:06:31

    Read Get-Help About_CommonParameters. Then try this:

    Set-MailContact -Identity "User One" -CustomAttribute "Testing" -ErrorAction "SilentlyContinue" -WarningAction "SilentlyContinue"

    by PatricF at 2013-01-15 06:35:06

    Ah, thank you very much!

    by ArtB0514 at 2013-01-15 06:47:50

    No problem. It took me a while to catch onto the common parameters, too.

    by PatricF at 2013-01-15 07:04:18

    This was weird. 'Set-MailContact' still gives me the yellow warning message, however with some other commands it work just fine..
    It works with the "ErrorAction" for 'Set-MailContact' but not "WarningAction" for some reason..

    Do you have any idea why?

    by ArtB0514 at 2013-01-15 10:37:09

    Nope, sorry. I looked up the Set-MailContact cmdlet online (http://technet.microsoft.com/en-us/library/aa995950(v=EXCHG.80).aspx) and there is absolutely no useful information there. No list of parameters at all. Also tried Get-Help Set-MailContact -Full in the EMC and got no help.

The topic ‘Ignore output message’ is closed to new replies.