Hi @Qasim Ali
You can use the following command to get the name and the domain of target computer:
Get-WmiObject -Namespace root\cimv2 -Class Win32_ComputerSystem -ComputerName desktop01 | Select Name, Domain
Please don't forget to mark helpful answer as accepted