2015-01-06 3 views
-1

삭제 한 후 netbootmachinefilepath 속성을 업데이트하고 싶습니다. 이 특성은 비어 있거나 삭제 될 수 있으므로 값을 "지운"후에 실제로 삭제하는 "지우기"때문에이 특성을 다시 만들어야합니다."netbootmachinefilepath"만들기 Active Directory 컴퓨터 속성

Powershell을 사용하여이 속성을 다시 만들려면 어떻게해야합니까?

뭔가 편집

$directoryEntry.Properties.Create("netbootmachinefilepath") 
$directoryEntry.CommitChanges() 

같은 때문에 내가 ActiveDirectory에 모듈을 사용할 수 아니에요 우리의 서버에 소프트웨어 문제 될 것이 기대했다.

+0

더 많은 (코드) 문맥을 보여주십시오. 어떤 값이'$ directoryEntry'에 할당됩니까? 방법? –

답변

1

속성에 값이 없어도 상관 없습니다.

$directoryEntry.Properties["netbootmachinefilepath"].Value = "yourvalue" 
$directoryEntry.CommitChanges() 

심지어 $directoryEntry.Properties.Contains("netbootmachinefilepath")
$directoryEntry.Properties["netbootmachinefilepath"]가 null을 반환하지 않습니다 false입니다. 빈 PropertyValueCollection을 반환합니다.

위의 코드를 테스트하여 값을 설정했는데 이전에는 아무런 가치가 없습니다.

+0

netbootmachinefilepath는 일단 지워지면 작동하지 않으므로 작동하지 않습니다. –

+0

$ directoryEntry.Properties.Contains ("netbootmachinefilepath")가 false와 같기 때문에 이것을 확인할 수 있습니다. –

+3

예,'$ directoryEntry.Properties.Contains ("netbootmachinefilepath")'false'를 반환하지만'$ directoryEntry.Properties [ "netbootmachinefilepath"]'는 값을 설정하는 데 사용할 수있는'PropertyValueCollection'을 반환합니다. – baldpate

관련 문제