I found something strange.
Remove-Computer -UnjoinDomainCredential office-2\administrator -PassThru -Verbose -Rest
art
VERBOSE: Performing the operation "Remove-Computer" on target "DC-2-2".
Remove-Computer : **Cannot remove computer 'DC-2-2' because it is not in a domain.**
At line:1 char:1
+ Remove-Computer -UnjoinDomainCredential office-2\administrator -PassT ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (DC-2-2:String) [Remove-Computer], InvalidOperationException
+ FullyQualifiedErrorId : ComputerNotInDomain,Microsoft.PowerShell.Commands.RemoveComputerCommand
HOWEVER
PS C:\Users\Administrator> systeminfo
Host Name: DC-2-2 OS Name: Microsoft Windows Server 2016 Standard Evaluation OS Version: 10.0.14393 N/A Build 14393 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Server OS Build Type: Multiprocessor Free Registered Owner: Windows User Registered Organization: Product ID: 00378-00000-00000-AA739 Original Install Date: 2/23/2023, 5:29:46 PM System Boot Time: 3/7/2023, 8:15:28 PM System Manufacturer: Microsoft Corporation System Model: Virtual Machine System Type: x64-based PC Processor(s): 1 Processor(s) Installed. [01]: Intel64 Family 6 Model 142 Stepping 10 GenuineIntel ~1800 Mhz BIOS Version: American Megatrends Inc. 090008 , 12/7/2018 Windows Directory: C:\Windows System Directory: C:\Windows\system32 Boot Device: \Device\HarddiskVolume1 System Locale: en-us;English (United States) Input Locale: en-us;English (United States) Time Zone: (UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius Total Physical Memory: 1,024 MB Available Physical Memory: 385 MB Virtual Memory: Max Size: 2,048 MB Virtual Memory: Available: 1,331 MB Virtual Memory: In Use: 717 MB Page File Location(s): C:\pagefile.sys Domain: OFFICE-2 Logon Server: \DC-2-2 Hotfix(s): 3 Hotfix(s) Installed. [01]: KB3192137 [02]: KB3211320 [03]: KB3213986 Network Card(s): 1 NIC(s) Installed. [01]: Microsoft Hyper-V Network Adapter Connection Name: LAN-2 DHCP Enabled: No IP address(es) [01]: 10.0.0.35 Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed. PS C:\Users\Administrator>
Any idea what is going on here?