set-Umserver cmdlet 的脚本输入问题

发布于 2024-09-26 07:48:08 字数 713 浏览 0 评论 0原文

我编写了一些 Exchange 2010 统一消息自动化脚本。我正在尝试自动将 UM 拨号计划与 UM 服务器关联。 powershell 命令是:

[PS] E:\Scripts>Set-UmServer -id Exchange01 -DialPlans "test1", "test2"

当我尝试以下脚本解决方案时:

[PS] E:\Scripts>$str = "`"test1`", `"test2`""
[PS] E:\Scripts>Set-UmServer -id Exchange01 -DialPlans $str

我收到错误:

The UM dial plan "test1", "test2" doesn't exist.
+ CategoryInfo          : NotSpecified: (0:Int32) [Set-UmServer], ManagementObjectNotF
+ FullyQualifiedErrorId : 7AF43AA1,Microsoft.Exchange.Management.Tasks.UM.SetUMServer

我的感觉是我错误地处理了变量,并且变量正在“test1”、“test2”而不是“test1”中交换, “测试2”。

任何指导将不胜感激。

问候

乔恩

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

躲猫猫 2024-10-03 07:48:08

你工作过度了。 :-) 试试这个:

$str = "test1", "test2"
Set-UmServer -id Exchange01 -DialPlans $str 

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

$str = "test1", "test2"
Set-UmServer -id Exchange01 -DialPlans $str 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文