Exception calling “SetInfo” with “0” argument(s): “The object already exists. (Exception from HRESULT: 0x80071392)” —> System.DirectoryServices.DirectoryServicesCOMException (0x80071392)

  • This error will be raised if the AD object already exists.
  • Also, an error will be raised if any of the attribute values is blank (or otherwise invalid).
  • You cannot assign a blank (or Null) value to any attribute.
  • If a missing value is possible, you may need to revise the script to check for this and only assign a value if the value is non-missing.
  • Of course, mandatory attributes, like cn an sAMAccountName, cannot be missing.
  • Perhaps similar (in part) to below:

If ($givenName -ne "") {$objUser.Put(“givenName”, $givenName)}

Leave a Reply

Your email address will not be published. Required fields are marked *