1 2 Previous Next 17 Replies Latest reply on Mar 14, 2013 9:15 AM by Akbar Aziz

    Extended Object using Powershell to show Windows Shares

    richard mcleod

      I am trying to run a powershell onliner to output a listing of shares on Windows servers. The command I am using now is formatted like this



      nexec -i -e cmd /c "powershell -InputFormat NONE gwmi Win32_Share"


      When I run the extended object, i receive the following error




      when i drop off the 'nexec -i -e cmd /c' piece, it hangs my console.


      Expected output should be something like this



      C:\WINNT\Profiles\me>powershell "gwmi Win32_share | sort name | ft name, path, description, status, type"

      name          path          description          status               type
      ----              ----            -----------               ------                  ----
      ADMIN$      C:\WINNT  Remote Admin    OK                   2147483648
      C$              C:\             Default share      OK                   2147483648
      D$              D:\             Default share      OK                   2147483648
      IPC$                            Remote IPC        OK                   2147483651

      I'm not opposed to writing a script and dropping it on each server to run but I'll have to deploy to ~13000 servers, looking for a method to use onelines


      Any ideas?

        1 2 Previous Next