2013-05-15 55 views
0

以下腳本正在使用Active Directory擴展屬性來正確地過濾結果,因爲它只顯示「script_ignore」位於「信息」字段中的AD用戶(這是「註釋」字段AD用戶電話標籤&電腦)。顯示活動目錄擴展屬性

然而,它不顯示任何擴展的屬性,因爲我預計在以下的foreach對象%_info或$ _city。

如何輸出擴展屬性?

get-aduser -filter { info -like "script_ignore" } | % { 
    $_.name + " " + $_.city + " " + $_.info 
} 

回答

1

您需要在Properties參數中添加您感興趣的任何屬性,這些屬性未包含在默認屬性集中。

get-aduser -filter { info -like "script_ignore" } -Properties City,Info | % { 
    $_.name + " " + $_.city + " " + $_.info 
} 
+0

非常感謝! – RichGK