locked
Windows pagefile location , and size from a list of server RRS feed

  • Question

  • Hi,

    I am trying to find out a suitable script to get the Windows Servername, pagefile location , and size information from a list of server

    Get-Content C:\Complist.txt |
         ForEach-Object {
    Get-WmiObject Win32_PageFileusage -Computer $_
         } |
        Select-Object Name

    Sunday, January 13, 2019 7:29 PM

Answers

  •  Select-Object pscomputername, name, allocatedbasesize

    Try looking up the class in the documentation.

    Paste Win32_PageFileUsage into your search engine for the docs.  It will usually be the first listed.  All properties, methods and exaples are documented.


    \_(ツ)_/

    • Marked as answer by Shivanq Sunday, January 13, 2019 8:18 PM
    Sunday, January 13, 2019 7:50 PM

All replies

  •  Select-Object pscomputername, name, allocatedbasesize

    Try looking up the class in the documentation.

    Paste Win32_PageFileUsage into your search engine for the docs.  It will usually be the first listed.  All properties, methods and exaples are documented.


    \_(ツ)_/

    • Marked as answer by Shivanq Sunday, January 13, 2019 8:18 PM
    Sunday, January 13, 2019 7:50 PM
  • Thank you JRV.. 
    Here is the script which is working for multpile computers
    $computer = get-content c:\complist_1.txt  
    $namespace = "root\CIMV2" 
    Get-WmiObject -class Win32_PageFileUsage -computername $computer -namespace $namespace | select __SERVER,caption,currentusage| Format-Table
    Sunday, January 13, 2019 8:19 PM
  • You asked for size not usage?

    Server name for all remote operations is always available as PsComputerName.  PageFIle size is not the same as usage.

    We don't need namespace for the default namespace. 

    "Name" is the same as caption for the class but is not the same as name for most classes.


    \_(ツ)_/

    Sunday, January 13, 2019 8:48 PM