Updating SVM Active Directory configurations using the NetApp CLI
You can use the NetApp ONTAP CLI to join and unjoin your SVM to an Active Directory, and to modify an existing SVM Active Directory configuration.
Joining an SVM to an Active Directory using the ONTAP CLI
You can join existing SVMs to an Active Directory using the ONTAP CLI, as described in the following procedure. You can do this even if your SVM is already joined to an Active Directory.
To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace
with the IP address of the file system's management port.management_endpoint_ip[~]$ssh fsxadmin@management_endpoint_ipFor more information, see Managing file systems with the ONTAP CLI.
-
Create a DNS entry for your Active Directory by providing the full directory DNS name (
corp.example.com) and at least one DNS server IP address.::>vserver services name-service dns create -vserversvm_name-domainscorp.example.com-name-serversdns_ip_1,dns_ip_2To verify the connection to your DNS servers, run the following command. Replace
svm_namewith your own information.FsxId0ae30e5b7f1a50b6a::>vserver services name-service dns check -vserversvm_nameName Server Vserver Name Server Status Status Details ------------- --------------- ------------ -------------------------- svm_name 172.31.14.245 up Response time (msec): 0 svm_name 172.31.25.207 up Response time (msec): 1 2 entries were displayed. -
To join your SVM to your Active Directory, run the following command. Note that you will must specify a
computer_namethat doesn't already exist in your Active Directory and provide the directory DNS name for-domain. For-OU, enter the OUs that you want the SVM to join, as well as the full DNS name in DC format.::>vserver cifs create -vserver svm_name -cifs-servercomputer_name-domaincorp.example.com-OUOU=Computers,OU=example,DC=corp,DC=example,DC=comTo verify the status of your Active Directory connection, run the following command:
::>vserver cifs check -vserversvm_nameVserver : svm_name Cifs NetBIOS Name : svm_netBIOS_name Cifs Status : Running Site : Default-First-Site-Name Node Name DC Server Name DC Server IP Status Status Details --------------- -------------- --------------- ------ -------------- FsxId0ae30e5b7f1a50b6a-01 corp.example.com 172.31.14.245 up Response time (msec): 5 FsxId0ae30e5b7f1a50b6a-02 corp.example.com 172.31.14.245 up Response time (msec): 20 2 entries were displayed. -
If you can't access shares after this join, determine whether the account you’re using to access the share has permissions. For example, if you're using the default
Adminaccount (a delegated administrator) with an AWS managed Active Directory, you will must run the following command in ONTAP. Thenetbios_domaincorresponds with your Active Directory’s domain name (forcorp.example.com, thenetbios_domainused here isexample).FsxId0123456789a::>vserver cifs users-and-groups local-group add-members -vserver svm_name -group-name BUILTIN\Administrators -member-names netbios_domain\admin
Modify an Active Directory configuration using the ONTAP CLI
You can use the ONTAP CLI to modify an existing Active Directory configuration.
To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace
with the IP address of the file system's management port.management_endpoint_ip[~]$ssh fsxadmin@management_endpoint_ipFor more information, see Managing file systems with the ONTAP CLI.
-
Run the following command to temporarily bring down the SVM's CIFS server:
FsxId0123456789a::>vserver cifs modify -vserversvm_name-status-admin down -
If you need to modify the DNS entries of your Active Directory, run the following command:
::>vserver services name-service dns modify -vserversvm_name-domainscorp.example.com-name-serversdns_ip_1,dns_ip_2You can validate the connection status to your Active Directory's DNS servers using the
vserver services name-service dns check -vserver svm_namecommand.::>vserver services name-service dns check -vserversvm_nameName Server Vserver Name Server Status Status Details ------------- --------------- ------------ -------------------------- svmciad dns_ip_1 up Response time (msec): 1 svmciad dns_ip_2 up Response time (msec): 1 2 entries were displayed. -
If you need to modify the Active Directory configuration itself, you can change existing fields by using the following command, replacing:
-
computer_name, if you want to modify the NetBIOS (machine account) name of the SVM. -
domain_name, if you want to modify the name of the domain. This should correspond with the DNS domain entry noted in Step 3 of this section (corp.example.com). -
organizational_unit, if you want to modify the OU (OU=Computers,OU=example,DC=corp,DC=example,DC=com).
You will need to reenter the Active Directory credentials that you used to join this device to the Active Directory.
::>vserver cifs modify -vserversvm_name-cifs-server computer_name -domaindomain_name-OUorganizational_unitYou can verify the connection status of your Active Directory connection using the
vserver cifs check -vservercommand.svm_name -
-
When you finish modifying your Active Directory and DNS configuration, bring the CIFS server back up by running the following command:
::>vserver cifs modify -vserversvm_name-status-admin up
Unjoin an Active Directory from your SVM using the NetApp ONTAP CLI
The NetApp ONTAP CLI can also be used to unjoin your SVM from an Active Directory by following the steps below:
To access the ONTAP CLI, establish an SSH session on the management port of the Amazon FSx for NetApp ONTAP file system or SVM by running the following command. Replace
with the IP address of the file system's management port.management_endpoint_ip[~]$ssh fsxadmin@management_endpoint_ipFor more information, see Managing file systems with the ONTAP CLI.
-
Delete the CIFS server that unjoined your device from the Active Directory by running the following command. For ONTAP to delete the machine account for your SVM, provide the credentials that you originally used to join the SVM to the Active Directory.
FsxId0123456789a::>vserver cifs modify -vserversvm_name-status-admin down -
If you need to modify the DNS entries of your Active Directory, run the following command:
FsxId0123456789a::vserver cifs delete -vserversvm_nameIn order to delete an Active Directory machine account for the CIFS server, you must supply the name and password of a Windows account with sufficient privileges to remove computers from the "CORP.ADEXAMPLE.COM" domain. Enter the user name:user_nameEnter the password: Warning: There are one or more shares associated with this CIFS server Do you really want to delete this CIFS server and all its shares? {y|n}:y -
Delete the DNS servers for your Active Directory by running the following command:
::vserver services name-service dns delete -vserversvm_nameIf you see a warning like the following—indicating that
dnsshould be removed as anns-switch—and you don't plan to rejoin this device to an Active Directory, you can remove thens-switchentries.Warning: "DNS" is present as one of the sources in one or more ns-switch databases but no valid DNS configuration was found for Vserver "svm_name". Remove "DNS" from ns-switch using the "vserver services name-service ns-switch" command. Configuring "DNS" as a source in the ns-switch setting when there is no valid configuration can cause protocol access issues. -
(Optional) Remove the
ns-switchentries fordnsby running the following command. Verify the source order, then remove thednsentry for thehostsdatabase by modifying thesourcesso that they contain only the other sources listed. In this example, the only other source isfiles.::>vserver services name-service ns-switch show -vserversvm_name-database hostsVserver: svm_name Name Service Switch Database: hosts Name Service Source Order: files, dns::>vserver services name-service ns-switch modify -vserversvm_name-database hosts -sources files -
(Optional) Remove the
dnsentry by modifying thesourcesfor the database host to include onlyfiles.::>vserver services name-service ns-switch modify -vserver svm_name -database hosts -sources files