Home Forums Programming Powershell Get hard drive information of a remote server using Powershell 1,0 RE: Get hard drive information of a remote server using Powershell 1,0

  • Well using the mentioned, I can not run it on a server and get the drive info of a remote server. as when this will be execute it will collect the information of the local drives to that server.

    Let me try and explain the full scenario that might be helpful (to me eventually :))

    what I am trying to achieve is to run a script that copies an installation file from one location to many servers on their E drive under a folder (lets call it as) Temp. Now this part is easy as I can use copy-item member and give copy from and copy to locations, but what I need to check before a copy, is to what is the free space on the E drive of that server so that the servers drive does not run out of space while copying. For the same I need to verify that the free space on every server is enough before I copy the file.

    Execution mode :

    1. Run a Foreach loop to consider one server at a time (example : foreach($server in $servers))

    2. Test if E drive exists on the server

    3. Test if the space on E drive is greater then 700 mb

    4. Create a new folder Temp on E drive(if it does not exist)

    5. Copy the file from a shared path into the Temp folder.

    Hope this helps in explaining what I am trying to do and as mentioned earlier Remoting is not an option for me as I do not have powershell 2.0 on all my servers.