• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2233
  • Last Modified:

Powershell: Suppress WARNING: The command completed successfully but no settings have been modified


can anyone help me on this?
How can I suppress the yellow warning
"WARNING: The command completed successfully but no settings have been modified"
I'm running the command       
"Set-RemoteDomain -Identity "$Domain" -TNEFEnabled $false"
When the remotedomain already exists I'm getting this warning, but I rather don't have it in the output windows ;-)
Is there a way to suppres this
I've already tried
      $global:ErrorActionPreference = "SilentlyContinue"
      $global:WarningPreference = "SilentlyContinue"
But they don't seem to work :(
Filip Heens
Filip Heens
1 Solution
It looks like a bug

You can use this workaround..
If (!(Get-RemoteDomain |?{$_.DomainName -eq "$Domain" -and $_.TNEFEnabled -eq $False})){
Set-RemoteDomain -Identity "$Domain" -TNEFEnabled $false

Open in new window

Filip HeensAuthor Commented:
Perfectly, this realy helped me in solving my problem...

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now