Trouble scripting inputs for set-Umserver cmd let
-
28-09-2019 - |
문제
I've writing some Exchange 2010 Unified Messaging automation scripts. I'm trying to automate the assoication of UM dial plans to UM Servers. The powershell command is :
[PS] E:\Scripts>Set-UmServer -id Exchange01 -DialPlans "test1", "test2"
When I try the following scripting solution:
[PS] E:\Scripts>$str = "`"test1`", `"test2`""
[PS] E:\Scripts>Set-UmServer -id Exchange01 -DialPlans $str
I get an error:
The UM dial plan "test1", "test2" doesn't exist.
+ CategoryInfo : NotSpecified: (0:Int32) [Set-UmServer], ManagementObjectNotF
+ FullyQualifiedErrorId : 7AF43AA1,Microsoft.Exchange.Management.Tasks.UM.SetUMServer
My feeling is that I'm handling the variable incorrectly and the variable is swapping in ""test1", "test2"" rather than "test1", "test2".
Any guidance would be greatly appreciated.
regards
Jon
해결책
You're overworking it. :-) Try this:
$str = "test1", "test2"
Set-UmServer -id Exchange01 -DialPlans $str
제휴하지 않습니다 StackOverflow