Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running Windows Core: How-to view domain and join/unjoin domain #4

Open
itoleck opened this issue Dec 6, 2023 · 0 comments
Open

Running Windows Core: How-to view domain and join/unjoin domain #4

itoleck opened this issue Dec 6, 2023 · 0 comments
Assignees

Comments

@itoleck
Copy link
Owner

itoleck commented Dec 6, 2023

Running Windows Core Series, getting on and off the domain.

When running these commands or using them in scripts keep in mind that some may become deprecated in future versions of Windows. Best practice is to use the PowerShell commands when possible to future proof any script that use these commands. These commands were run on Windows Server 2012R2.

When running Windows Server 2012+ without a GUI note that the GUI can be reinstalled via PowerShell (Install-WindowsFeature) and a reboot.

From Windows Server core command prompt:

Display current domain information using AD management tools.

C:>POWERSHELL

PS C:>Get-ADDomain

Display domain from command prompt.

C:>WMIC COMPUTERSYSTEM LIST BRIEF

Display current logged on user’s domain.

C:>ECHO %USERDOMAIN%

Join a domain named CONTOSO.

C:>POWERSHELL

PS C:>Add-Computer -DomainName CONTOSO -Restart

Join a workgroup named WORKGROUP.

C:>POWERSHELL

PS C:>Add-Computer -WorkGroupName WORKGROUP

Unjoin server from the current domain using the contoso\administrator account.

C:>POWERSHELL

PS C:>Remove-Computer -UnjoinDomaincredential CONTOSO\Administrator -Passthru -Verbose -Restart

If you know any other interesting ways of getting this information from a Windows Server core installation post below.

@itoleck itoleck self-assigned this Feb 7, 2024
@itoleck itoleck transferred this issue from itoleck/Blog Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant