Confirm if a Computer is a Domain Member using Powershell

Just a quick post, as I recently had the need to do this in an Azure environment, where I needed to confirm that computers had joined an Azure AD Domain services domain. I was looking for a quick and convenient way to confirm that the computer had joined the domain correctly – but without connecting to the network that the virtual machine was deployed to. I was able to achieve this using the Azure ‘Run Command’ virtual machine feature, and the following Powershell code.

To determine whether a computer is a domain member you can run:


(Get-WmiObject -Class Win32_ComputerSystem).PartOfDomain

If this returns a value of ‘True’, then the computer has been joined to a domain successfully. If it returns a value of ‘False’ then it is not a domain member. In this case the following Powershell can be used to confirm that the computer is a member of a workgroup instead:


(Get-WmiObject -Class Win32_ComputerSystem).Workgroup

Related posts

Docker Exec Command With Practical Examples

Debugging with Git Bisect

A Beginners Guide to Azure Repos

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Read More