I have a text file which I could convert into any format, I choose CSV as per similar discussion in: Bulk add / import / enroll users
In text files I have computer name, IP address, MAC address
All those computers exist in LDAP but without IP address and MAC
I would like to import that into LDAP with, possibly, udm. I tried command manually to insert at least 1 computer and I get errors, could someone please help me create the correct command? Thanks. I tried:
udm computers/windows modify --dn=cn=PC2 --set macAddress=00:11:22:33:44:55
Warning: No attribute with name 'macAddress' in this module, value not set.
Modify computers/computer not allowed
udm computers/computer modify --dn cn=PC2 --set macAddress=00:11:22:33:44:55
Warning: No attribute with name 'macAddress' in this module, value not set.
E: object not found
I tried various options, modify, --set, --append --dn=cn=PC2
No luck.
Invalid syntax: dhcpEntryZone: Not a valid DLAP DN
tried udm computers/ipmanagedclient modify --cn=cn=pc3,cn=computers,dc=roman,dc=com --set dhcpEntryZone="cn=roman.com,cn=dhcp,dc=roman,dc=com"
I get error:
Invalid syntax: dhcpEntryZone: This is not a valid MAC address (valid examples are 86:f5:d1:f5:6b:3e, 86-f5-d1-f5-6b-3e, 86f5d1f56b3e, 86f5.d1f5.6b3e)
(my DHCP service is named roman.com)
and even with that I am not sure whether DHCP options will pick up MAC address automatically? And DNS settings?
I thought I would try one liner and still get dhcpEntryZone error. udm computers/ipmanagedclient modify --cn=cn=pc3,cn=computers,dc=roman,dc=com --set mac=00:11:22:33:44:55 --set dhcpEntryZone="cn=roman.com,cn=dhcp,dc=roman,dc=com" --set network="default"
when in doubt, I suggest you edit one object via the web-based management console. Then search for that object with udm, and it’ll output the settings the way it recognizes them. That’ll show you how to set up forward/reverse DNS zone entries.
UDM dhcp/host does not work for me. If I need to modify existing object, then I need to provide DN.
ucsbase=$(ucr get ldap/base)
udm dhcp/host list
DN: cn=WIN10-1,cn=roman.com,cn=dhcp,dc=roman,dc=com
<…fixedaddress host and hwaddress not copied here…>
udm dchp/host modify --dn=cn=PC2,cn=roman.com,cn=dhcp,$ucsbase --superordinate “cn=roman.com,cn=dhcp,$ucsbase” --set host="{C2{ --set fixedaddress=“192.168.200.22” --set hwaddress=“ethernet 00:11:22:33:44:55”
E: object not found
udm dchp/host modify --dn=cn=PC2,cn=computers,$ucsbase --superordinate “cn=roman.com,cn=dhcp,$ucsbase” --set host="{C2{ --set fixedaddress=“192.168.200.22” --set hwaddress=“ethernet 00:11:22:33:44:55”
Information provided is not sufficient: No superordinate object given
hmm, you should only have to modify a computers/ipmanagementclient object and set its dnsEntryZoneForward, dnsEntryZoneReverse and dhcpEntryZone properties. The corresponding dhcp/host, dns/host_record and dns/ptr_record objects should be created or updated automatically for you.
Of course you can create the DHCP and DNS objects manually, but then you have to verify whether or not they exist and call udm … create --superordinate=… … if they do and udm … create --dn=… … if they don’t. BTW, you only need to specify --superordinate when creating entries, not when you modify them as the DN already contains the information where the object to modify is located.
Thanks to: udm computers/windows list udm dhcp/host list
I was able to understand which settings to pass into udm. Above command was almost complete, the missing option was the network which then pre-configures DNS for me. So the final command would look like:
where:
network=cn=default, default is the name I gave to one of the networks. dhcpEntryZone=cn=roman.com, roman.com is the name of the DHCP service in my UCS Lab.
–dn=cn=PC2, PC2 is the name of the computer/host.