Fat 32

Lee HLee H Member Posts: 1,135
Hi

Bit of an odd request but does anyone know how to do a quick scan of your network and have it return a list of host names which C drive is FAT32

Thanks

Lee H
.

Comments

  • jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    Don't think there is a quick way apart from connecting to the Computer Management remotely and check the Disk Management ...

    Edit: You can check it with diskpart too .. maybe there is a way to use diskpart for remote systems
    DISKPART> list disk
    
      Disk ###  Status      Size     Free     Dyn  Gpt
      --------  ----------  -------  -------  ---  ---
      Disk 0    Online       233 GB      0 B
      Disk 1    No Media        0 B      0 B
      Disk 2    No Media        0 B      0 B
    
    DISKPART> select disk 0
    
    Disk 0 is now the selected disk.
    
    DISKPART> detail disk
    
    Areca ARC-1200-VOL#00 SCSI Disk Device
    Disk ID: AF0BA1F9
    Type   : RAID
    Bus    : 0
    Target : 0
    LUN ID : 0
    Read-only  : No
    Boot Disk  : Yes
    Pagefile Disk  : Yes
    Hibernation File Disk  : No
    Crashdump Disk  : Yes
    
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  --------
      Volume 1     C                NTFS   Partition    233 GB  Healthy    System
    
    My own knowledge base made public: http://open902.com :p
  • ClaymooreClaymoore Member Posts: 1,637
    WMI will do it. You can query WMI:

    "SELECT * FROM Win32_LogicalDisk WHERE FileSystem = 'FAT32'"

    This would work well with PowerShell using input and output files. Here is a script adapted from another WMI query based script I was using to check for some installed software. (I haven't tested this one though)

    #Define Input File
    $ComputerFile = "C:\Temp\List.txt"
    $ComputerList = Get-Content $ComputerFile
    #$strComputer = "."

    foreach ($NextComputer in $ComputerList)
    {
    write-host "Connecting to $NextComputer..."
    $Disk = get-wmiobject -Query "SELECT * FROM Win32_LogicalDisk
    WHERE FileSystem = 'FAT32'" -ComputerName $NextComputer
    Write-Host "FileSystem = $Disk.FileSystem"

    if ($Disk.FileSystem -eq "FAT32")
    {
    Add-Content "C:\Temp\FAT32.txt" "$NextComputer"
    }
    else
    {
    Add-Content "C:\Temp\NTFS.txt" "$NextComputer"
    }
    }
  • Lee HLee H Member Posts: 1,135
    I was hoping to maybe send out a script and have it return a TXT file with all the host names

    Or is that like waving a magic wand, lol
    .
  • ClaymooreClaymoore Member Posts: 1,637
    Lee H wrote: »
    I was hoping to maybe send out a script and have it return a TXT file with all the host names

    Or is that like waving a magic wand, lol

    That's exactly what the PowerShell script does. It reads an input file with a list of computers, performs a remote WMI query on each one, and writes the computer name to a different file based on whether the disk is formatted FAT32 or not (which would mean NTFS).
  • HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    Claymoore,

    You don't have to have quite the complexity of the script. You don't need a loop or conditional logic for this. Just set your $computers variable to be a collection and reference the collection in the script in the -computer parameter

    You can also built a CSV file instead of writing out to a txt file. This would allow sorting, etc., on top of it simplifying the script.

    This would do it all while prompting for an account with the proper rights to the computers.

    $cred = get-credential
    $computers = get-content listfile.txt
    get-wmiobject -Query "SELECT * FROM Win32_LogicalDisk WHERE FileSystem = 'FAT32' " -Computer $computers -credential $cred | select systemname,drivetype,filesystem | export-csv report.csv

    Done!

    Edit: Claymoore, your script wouldn't get the non-FAT32 drives since you only queried for FAT32 from the get go.
    Good luck to all!
  • Lee HLee H Member Posts: 1,135
    We have a mixture of W2K and XP so WMI wil only apply to XP clients, still good to find all the XP PC;s though for sure

    Thanks for your help
    .
  • HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    Why do you think it won't work with W2K?
    Good luck to all!
  • Lee HLee H Member Posts: 1,135
    Thanks Hero, just googled it and found this

    NT-Bugtraq: WMI Filtering for Windows 2000
    .
  • HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    Lee H wrote: »
    Thanks Hero, just googled it and found this

    NT-Bugtraq: WMI Filtering for Windows 2000

    Dude, WMI filtering for GPO's is only natively unsupported for Windows 2000. W2K still has WMI capability. Very very different things.
    Good luck to all!
  • ClaymooreClaymoore Member Posts: 1,637
    HeroPsycho wrote: »
    Claymoore,

    You don't have to have quite the complexity of the script. You don't need a loop or conditional logic for this. Just set your $computers variable to be a collection and reference the collection in the script in the -computer parameter

    You can also built a CSV file instead of writing out to a txt file. This would allow sorting, etc., on top of it simplifying the script.

    This would do it all while prompting for an account with the proper rights to the computers.

    $cred = get-credential
    $computers = get-content listfile.txt
    get-wmiobject -Query "SELECT * FROM Win32_LogicalDisk WHERE FileSystem = 'FAT32' " -Computer $computers -credential $cred | select systemname,drivetype,filesystem | export-csv report.csv

    Done!

    Edit: Claymoore, your script wouldn't get the non-FAT32 drives since you only queried for FAT32 from the get go.

    Thanks, HP. Still getting the hang of this whole PowerShell thing. I jumbled a script together to query for some installed software and just adapted it here, then added the WHERE statement and of course nver tested it. But to convert all those lines to 3 lines of code is pretty sweet.

    I was dreading learning PowerShell at first, but now that I am on an Exchange 2007 project and actually using it I am finding it relatively easy to learn and very powerful. Quest PowerGui and the PowerGui script editor certainly help. icon_thumright.gif
  • HeroPsychoHeroPsycho Inactive Imported Users Posts: 1,940
    Pick up a copy of PowerShell TFM 2nd Edition. It's awesome!
    Good luck to all!
  • undomielundomiel Member Posts: 2,818
    Windows Management Instrumentation - Wikipedia, the free encyclopedia

    Claims that it comes with 2000 and ME and is available as a download from 95 & 98. I couldn't find a page talking about it specifically in Windows 2000 but about SP2 adding additional functionality to Windows 2000 WMI.
    Jumping on the IT blogging band wagon -- http://www.jefferyland.com/
Sign In or Register to comment.