Solved

Checking if Windows Server joined to the domain or not ?

Posted on 2011-09-05
3
428 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
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

785 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