Domanda

Ho scrivere alcuni script di automazione di messaggistica unificata di Exchange 2010. Sto cercando di automatizzare l'assoication di dial plan di messaggistica unificata a server. Il comando PowerShell è:

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

Quando provo la seguente soluzione di script:

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

ottengo un errore:

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

La mia sensazione è che sto gestire la variabile in modo non corretto e la variabile è lo scambio in "" test1" , 'test2'" piuttosto che 'test1', 'test2'.

Qualsiasi orientamento sarebbe molto apprezzato.

Per quanto riguarda

Jon

È stato utile?

Soluzione

Stai superlavoro esso. :-) Prova questo:

$str = "test1", "test2"
Set-UmServer -id Exchange01 -DialPlans $str 
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top