KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there an easy and fast way to find out if the local computer is joined to a domain with PowerShell? I find lots of stuff about getting the current workgroup OR domain but no clear indications on how to know if it really is a workgroup or domain. Just want to find this out before calling some Active Directory related stuff that only gives a timeout after a long wait on workgroup computers. The [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() method takes a long time before failing on workgroup computers and the WMI class Win32_ComputerSystem shows the name but not if it is a real domain.
Tags (comma-separated)
Save Edits
Cancel