-confirm:$false doesn't work in Orchestrator

This may be an Orchestrator issue, but I've decided to post here first. I'm working primarily with DFSN cmdlets but have come across this issue with others as well (like remove-ADGroupMember).

When attempting to run the command "Remove-DfsnFolder $path -confirm:$false" I receive the error:

 "A command that prompts the user failed because the host program or the command type does not support user interaction. The host was attempting to request confirmation with the following message: Perfoming operation "Delete DFS Namespace folder" on Target "\\DOMAIN.NET\Users\!test"

I've tried this via the Run .NET Script activity calling Powershell.exe. I've tried running inside of Invoke-Command. I've tried using the Execute PS Script activity as well. I've tried setting $ConfirmPreference="None".

Any thoughts on why Orchestrator will not recognize the non-use of user interaction?


March 30th, 2015 12:56pm

the default value for the -confirm switch is false. What happens if you just leave it off altogether?

Free Windows Admin Tool Kit Click here and download it now
March 30th, 2015 3:24pm

Unfortunately that produces the same result.
March 31st, 2015 8:39am

If the command works as expected when typed at the powershell console, then I suspect it may be a lmitation imposed by Orchestrator. If so, I'd suggest you look for help from a more Orchestrator-related forum. Or perhaps the scripting guy forum, who posted this:

http://blogs.technet.com/b/heyscriptingguy/archive/2013/09/11/debugging-a-powershell-script-within-orchestrator.aspx

Free Windows Admin Tool Kit Click here and download it now
March 31st, 2015 12:12pm

So immediately after I posted to the Orchestrator forum, I tried something else. I ran the Remove-DfsnFolder $path -confirm:$false command inside an Invoke-Command scriptblock (which I'm doing in SCorch) and I received a confirmation prompt. 

This makes me believe it has something to do with the confirm parameter inside an Invoke-Command.

Thoughts?

March 31st, 2015 2:48pm

That could be, but it does not explain the issue when you run the  command through orchestraor without an invoke-command - unless orchestrator itself wraps all your code into an invoke-command scriptblock...

Free Windows Admin Tool Kit Click here and download it now
March 31st, 2015 4:00pm

I'm wrapping the commands in an Invoke-Command inside the Run .NET activity because I need to run the command on a server that has the DFSN module installed.
April 1st, 2015 9:52am

I'm not familiar with the command, but is there a -Force parameter? If so, what happens when you use it?
Free Windows Admin Tool Kit Click here and download it now
April 1st, 2015 10:33am

The -force parameter does get rid of the prompting issue, however the changes do not actually get applied after running the command.
April 2nd, 2015 10:04am

I wonder if perhaps there might be a double-hop issue here...
Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2015 1:02pm

Hi ComputerPaul,

Are you throwing the arguments into the invoke-command argument parameter or using the $using: variable to pass the path?

Have you tried using the execute PowerShell activity to the server rather than the .net activity?



July 1st, 2015 6:41pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics