Create an Active Directory Subnet

Creates a new Active Directory subnet and links it to a current AD site.

 
 
 
 
 
5 Star
(3)
Add to favorites
Active Directory
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
  • Adding 'description' fails
    1 Posts | Last post December 30, 2011
    • Try as I might, I've been unable to make this work:
      ## set the description which isn't directly exposed property for ActiveDirectorySite 
      $subnetde = $subnet.GetDirectoryEntry() 
      $subnetde.Description = $subnetdescription 
      $subnetde.CommitChanges() 
      
      The result is:
      Exception calling "CommitChanges" with "0" argument(s): "Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))"
      
      It seems you can't add a name to the property set using the ".description" notation:
      New PropertyValueCollection cannot be set into a DirectoryEntry PropertyCollection.
      
      However, *this* works:
      ## set the description which isn't directly exposed property for ActiveDirectorySite 
      $subnetde = $subnet.GetDirectoryEntry() 
      $subnetde.Put('description',$description)
      $subnetde.CommitChanges()