# Operation # Useful CLI Commands Univention Corporate Server ### Useful CLI command line troubleshooting tools The following is a list of CLI commands used for administering the Univention Corporate Server (UCS) #### UCS Show Commands
CommandDescription
**ucr get server/role**Show the server role
**ucr get domainname**Show Domainname
**ucr get windows/domain**Show WIndows Domain
#### UCS Edit Commands
CommandDescription
**/usr/share/univention-samba4/scripts/purge\_s4\_computer.py --computername=backupdomaincontroller**Uninstallation of Backup Domain Controller, see here: [https://docs.software-univention.de/ext-windows/latest/en/#ext-win-s4-deinstall](https://docs.software-univention.de/ext-windows/latest/en/#ext-win-s4-deinstall)
#### Samba Show Commands For Samba 4 Troubleshooting check this article: [https://help.univention.com/t/samba-4-troubleshooting/32](https://help.univention.com/t/samba-4-troubleshooting/32)
CommandDescription
**samba-tool drs showrepl**To get an overview of the current drs replication status you can use this command at every UCS Samba 4 DC which is joined to the domain.
**root@master:~# univention-s4search cn=master msDS-KeyVersionNumber root@backup:~# univention-s4search cn=master msDS-KeyVersionNumber**For a given user, computer, or built-in account, this attribute specifies the Kerberos version number of the current key for that account. Therefore it can be used to compare the replication status of systems. The values have to be equal - otherweise the replication seems to be broken. If a system uses another value in comparison to the master, then it has to be rejoined or you first try to replicate just the Server account. Example: ``` root@master:~# univention-s4search cn=master msDS-KeyVersionNumber dn: CN=MASTER,OU=Domain Controllers,DC=test,DC=domain msDS-KeyVersionNumber: 7 root@backup:~# univention-s4search cn=master msDS-KeyVersionNumber dn: CN=MASTER,OU=Domain Controllers,DC=test,DC=domain msDS-KeyVersionNumber: 1 ```
**samba-tool dbcheck --cross-ncs**This checks the database of samba4. Samba saves its date not just in one database,but it slits it up in 5 partitions. To check al partitions and not just the basic one you need to add the parameter `--cross-ncs`
**samba-tool dbcheck --cross-ncs --fix --yes**To fix upcomming issues you can use `--fix` and `--yes` if you do not want to be asked for approval each error or warning.
**/usr/share/univention-samba4/scripts/check\_essential\_samba4\_dns\_records.sh**For a complete overview of the relevant dns records.