• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Check all machines if all the drives are NTFS or not

Hi,

I have a list of machine names or a script to scan the whole network and tell me if all the partitions in the machine is NTFS or not.

Regards
Sharath
0
bsharath
Asked:
bsharath
  • 3
  • 2
1 Solution
 
jonnietexasCommented:
try downloading a computer inventory program.  You will probably get the info from it.   tucows or download.com
0
 
canaliCommented:

' get-FS-type-all-PCs.vbs
' read the computer computers list from the file c:\computers.txt
' for get output on file run:
'
' cscript //nologo get-FS-type-all-PCs.vbs >result.txt
'
' cscript //nologo get-FS-type-all-PCs.vbs |find /i /v "FAT32" >PC-with-only-ntfs.txt
'
' cscript //nologo get-FS-type-all-PCs.vbs |find /i "FAT32" >PC-with-FAT32.txt
'
' Gastone Canali
'
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Computers.txt", ForReading)
do while not objFile.AtEndOfStream
    PC = objFile.ReadLine
    Gethdinfo (PC)
loop
objFile.Close
sub Gethdinfo(strComputer)
  getinfo=""
  On Error Resume Next
  Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/CIMV2" )
  Set colInstances = objWMIService.ExecQuery( "SELECT * FROM Win32_LogicalDisk where driveType=3",  "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly )
  If Err.Number = 0 then
    For Each objInstance In colInstances
          getinfo=getinfo & " " & objInstance.deviceID &" " & objInstance.FileSystem  
    Next
  else
    getinfo="Error computer not found"
    err.clear
  end if
  WScript.echo strComputer & space(10-len(strComputer)) &": " & getinfo
end sub
0
 
bsharathAuthor Commented:
I dont get any results.I tried all 3 ways.
0
Independent Software Vendors: 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!

 
canaliCommented:
:: ================
:: READ THIS FIRST
:: ================
:: * To run this script you must have domain administrators rights.
:: * This script require "Computers.txt" file on C: drive root from where it will pick computer names.
:: * Successful run will generate "FSinfo.htm" on C: drive root.
:: * Copy and Paste following script into notepad and save it with any name having .bat extension.
:: Batch Script Start

@Echo Off
SETLOCAL EnableDelayedExpansion

IF NOT EXIST C:\Computers.txt Goto ShowErr
FOR %%R IN (C:\Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr
IF EXIST C:\FSinfo.htm DEL /F /Q C:\FSinfo.htm

FOR /F %%c IN ('Type Computers.txt') Do (
    Echo Processing: %%c
      PING -n 1 -w 1000 %%c|Find /I "TTL" >NUL
      IF NOT ErrorLevel 1 (
            SET Qry=wmic /NODE:"%%c" LogicalDisk where driveType=3 get deviceid,filesystem /format:hform
            !Qry! >>C:\FSinfo.htm
      )ELSE (Echo %%c: Not able to connect )
)      

Goto EndScript
:ShowErr
Echo "C:\Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: Batch Script End

0
 
bsharathAuthor Commented:
Nice one Canali.Is thera way to get the report in csv format as it would be difficult to sort or find all Ntfs partitions
0
 
canaliCommented:
:: CSV verson ================
:: READ THIS FIRST
:: ================
:: * To run this script you must have domain administrators rights.
:: * This script require "Computers.txt" file on C: drive root from where it will pick computer names.
:: * Successful run will generate "FSinfo.csv" on C: drive root.
:: * Copy and Paste following script into notepad and save it with any name having .bat extension.
:: Batch Script Start

@Echo Off
SETLOCAL EnableDelayedExpansion

IF NOT EXIST C:\Computers.txt Goto ShowErr
FOR %%R IN (C:\Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr
IF EXIST C:\FSinfo.csv DEL /F /Q C:\FSinfo.csv

FOR /F %%c IN ('Type Computers.txt') Do (
    Echo Processing: %%c
      PING -n 1 -w 1000 %%c|Find /I "TTL" >NUL
      IF NOT ErrorLevel 1 (
            SET Qry=wmic /NODE:"%%c" LogicalDisk where driveType=3 get deviceid,filesystem /format:csv
            !Qry! >>C:\FSinfo.csv
      )ELSE (Echo %%c: Not able to connect )
)      

Goto EndScript
:ShowErr
Echo "C:\Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: Batch Script End
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now