Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Schema > 10.21. Managing the Confidentiality Bit

10.21. Managing the Confidentiality Bit

Problem

You want to manage the confidentiality of a schema attribute.

Solution

Using a command-line interface

admod -schema -rb cn=<AttrName> searchFlags::128

Using VBScript

' This code safely modifies the
' confidentiality bit of an attribute.
' ------ SCRIPT CONFIGURATION ------
strAttribute = "<schemaAttributeDN>"
 ' e.g. "cn=SalesUser-Description,cn=Schema,
 ' cn=Configuration,dc=adatum,dc=com"
strAttr = "searchFlags"         ' e.g. adatum-UserProperties
boolEnableBit = <TRUEorFALSE>   ' e.g. TRUE
intBit = 128
' ------ END CONFIGURATION --------

set objAttribute = GetObject("LDAP://" & strAttribute)
intBitsOrig = objAttribute.Get(strAttr)
intBitsCalc = CalcBit(intBitsOrig, intBit, boolEnableBit)

if intBitsOrig <> intBitsCalc then
   objObject.Put strAttr, intBitsCalc
   objObject.SetInfo
   WScript.Echo "Changed " & strAttr & " from " & intBitsOrig & " to " & intBitsCalc
else
   WScript.Echo "Did not need to change " & strAttr & " (" & intBitsOrig & ")"
end if

Function CalcBit(intValue, intBit, boolEnable)

   CalcBit = intValue

   if boolEnable = TRUE then
      CalcBit = intValue Or intBit
   else
      if intValue And intBit then
         CalcBit = intValue Xor intBit
      end if
   end if

End Function

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint