Solved

Checking if Windows Server joined to the domain or not ?

Posted on 2011-09-05
3
425 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How does your email signature look on mobiles?

Do your employees use mobile devices to reply to emails? With mobile becoming increasingly important to the business world, it is in your best interest to make sure that your email signature looks great across all types of devices.

Join & Write a Comment

"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Synchronize a new Active Directory domain with an existing Office 365 tenant
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now