문제

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 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top