Solved

Checking if Windows Server joined to the domain or not ?

Posted on 2011-09-05
3
433 Views
Last Modified: 2012-05-12
Hi People,

Given a list of IP address or Server name, can we actually list which server is currently joined to the domain or not (WORKGROUP only) using Powershell ?
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Assisted Solution

by:Felix Leven
Felix Leven earned 50 total points
ID: 36486893
Here is a PowerShell script which you can use to identify the domain membership of remote computers .  You can use a text file as an input file with all your computers names.

Not my script, link only:
http://portal.sivarajan.com/2010/02/identify-domain-membership-powershell.html
0
 
LVL 4

Assisted Solution

by:ZeevM333
ZeevM333 earned 50 total points
ID: 36488025
http://www.softpedia.com/progDownload/nbtscan-Download-100891.html
download this.
Save the .exe file under C:\
i'll assume your IP is 10.1.2.12 for this example.
Launch Command prompt and type the following while you're under C:\>

nbtscan-1.0.35.exe 10.1.2.1-254

Will give you the computer names IP's and if in domain or workgroups and which domains and workgroups.

Can simply supply a list of IP's as well for it to check...use the help menu to find what you need.
0
 
LVL 1

Accepted Solution

by:
m_rayansaz earned 400 total points
ID: 36492588
Ok since you have your list you can use is as an input file for a script which you run with domain admin.
You can use these comands in the script to find out uniq codes relevant to each version of windows; and then isolating server systems from the list.

$SystemHash = @{}  # Initialize the variable as a hashtable
$SystemHash["build"] = (Get-WmiObject Win32_OperatingSystem).BuildNumber
$SystemHash["SPNumber"] = (Get-WmiObject Win32_OperatingSystem).CSDVersion
$SystemHash["Caption"] = (Get-WmiObject Win32_OperatingSystem).Caption
$SystemHash["SKU"] = (Get-WmiObject
Win32_OperatingSystem).OperatingSystemSKU


for example you can have this script:

#
$Domain_Success_File = New-Item -type file -force "c:\temp\Domain_Success_File.txt"
$Domain_Failed_File = New-Item -type file -force "temp\Domain_Failed_File.txt"
$InputFile = Get-Content X:\2009\Scripts\Computers.txt
ForEach ($Comp in $InputFile){$adminpath = Test-Path \\$Comp\admin$
if ($adminpath -eq "TRUE"){
                  $compOS = get-wmiobject Win32_OperatingSystem -comp $computer
                  $compOSF = $compOS.Caption
                  $compSP = get-wmiobject Win32_OperatingSystem -comp $computer
                  $compSPF = $compSP.ServicePackMajorVersion
                  .
                  .
                  .
                  }
.
.
.
}


note I have used some part of codes from http://www.sivarajan.com/scripts.html but it's not complete, just as guideline.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question