我正在尝试更改在创建用户功能中创建的新用户的 OU 路径。我遇到了这个 if 语句返回 NULL 的 OU 路径的问题,我不确定为什么。任何帮助都会很棒!
$dropdown_FirstOU = New-Object System.Windows.Forms.ComboBox
$dropdown_FirstOU.Location = New-Object System.Drawing.Size(55,110)
$dropdown_FirstOU.Size = New-Object System.Drawing.Size(280,40)
$dropdown_FirstOU.DropDownStyle = System.Windows.Forms.ComboBoxStyle]::DropDownList
$dropdown_FirstOU.Items.AddRange($Sites)
$Form_SelectOU.Controls.Add($dropdown_FirstOU)
if ($dropdown_FirstOU -eq "Aberdeen") {
$OU = "OU=Aberdeen,OU=UK,DC=Kuehne-Nagel,DC=local"
} elseif ($dropdown_FirstOU -eq "Kingpin") {
$OU = "OU=Kingpin,OU=UK,DC=Kuehne-Nagel,DC=local"
}