views:

22

answers:

1

Hi,

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

A: 

You're overworking it. :-) Try this:

$str = "test1", "test2"
Set-UmServer -id Exchange01 -DialPlans $str 
Keith Hill
Thanks Keith. This gave me the hint I needed to fix the problem. I ended up using the following as it gave me more flexibility: $str = @() $str = $str + "test1" $str = $str + "test2"
Arcass