如何取消选中响应在AD中请求服务的客户端计算机

时间:2017-02-15 00:27:00

标签: powershell active-directory

如何取消选中"响应请求服务的客户端计算机"在使用Powershell的Active Directory中?

我尝试查看DirectoryEntry属性和方法,但看不到任何相关内容。

Active Directory checkbox

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。您需要使用intellimirrorSCP对象类:

$directoryEntry = New-Object 'System.DirectoryServices.DirectoryEntry'    
$directoryEntry.Path = $LdapPath
$searcher = New-Object 'System.DirectoryServices.DirectorySearcher'($directoryEntry)    
$searcher.SearchScope = [System.DirectoryServices.SearchScope]::SubTree    
$searcher.PageSize = [System.Int32]::MaxValue
$searcher.Filter = "(&(objectClass=intellimirrorSCP)(name='ServerNameHere-Remote-Installation-Services'))"
$result = $searcher.FindOne()
$directoryEntry = $result.GetDirectoryEntry()
$directoryEntry.Properties.netbootAnswerRequests[0] = $false
$directoryEntry.CommitChanges()