Solved

Checking if Windows Server joined to the domain or not ?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Suggested Courses

628 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