我为此问题搜索了很长时间,并发现了在远程 power shell 会话中使用变量的多个链接:
在 PowerShell 3.0 中将局部变量传递给远程会话
但是我找不到如何将其传递给引用的过滤器公式的部分的解决方案......
这是我认为应该起作用的:
Invoke-Command -Session $hex_session {New-AddressList -Name ($args[0] + " - All Rooms") -RecipientFilter ("(CustomAttribute1 -eq '" + $args[0] + "' -and (RecipientDisplayType -eq 'ConferenceRoomMailbox')") -RecipientContainer ("bla.blup.com/Hosted/"+$args[0])} -ArgumentList $Tenant
但是没有...
我在服务器上输入的原始命令是:
New-AddressList -Name "Tenant00001 – All Rooms" -RecipientFilter "(CustomAttribute1 -eq 'Tenant00001') -and (RecipientDisplayType -eq 'ConferenceRoomMailbox')" -RecipientContainer "bla.blup.com/Hosted/Tenant00001"
有人有同样的问题吗?
谢谢你的帮助
干杯伊夫