mcseforsale
Posts: 57
Joined: Wed Mar 27, 2013 10:53 pm

How to tell if computer is a domain member

Tue Jul 19, 2022 7:46 pm

My current project requires different execution strings in custom actions based on whether the computer is a domain member. Is there a way to check if the computer is on a domain?

Thanks!
Andy

Catalin
Posts: 6537
Joined: Wed Jun 13, 2018 7:49 am

Re: How to tell if computer is a domain member

Wed Jul 20, 2022 8:35 am

Hello Andy,

You could do that from within your custom action.

For instance, in PowerShell, you can check whether a computer is part of domain as it follows:

Code: Select all

(get-wmiobject -class win32_computersystem).PartofDomain
The above will return a boolean (true/false).

Win32_ComputerSystem class

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”