【发布时间】:2020-05-11 08:06:46
【问题描述】:
有没有办法通过规范名称将 GPO 与 OU 链接起来?
New-Gplink -gpo <gponame> -target <CANONICAL NAME>
根据我的阅读,我们只能使用专有名称。也许有办法解决它? 我用它把它们都保存在一个变量中
$test=Get-ADOrganizationalUnit -Filter * -Properties CanonicalName | Select-Object -Property CanonicalName
现在使用 gui 我打开一个窗口供用户从那里选择一个 ou
foreach ($item in $test){
[void]$listbox.items.add($item)}
所以现在我可以通过使用来捕捉用户的选择:
$catch = $listbox.selected.item
所以如果我现在想使用链接 gpo
new-gplink -gpo <gponame> -target $catch
我会得到一个错误。 任何帮助将不胜感激!
【问题讨论】:
标签: windows powershell gpo