none
How to check or see if a list of computers are sharing the c$ drive RRS feed

Answers

All replies

  • You can get this from Win32_Share. Get-WmiObject allows you to pass in a list of machine names via the ComputerName parameter:

    http://ss64.com/ps/get-wmiobject.html


    Don't retire TechNet! - (Don't give up yet - 13,225+ strong and growing)

    Tuesday, July 14, 2015 6:59 PM
  • Thanks, that's a pretty good start.

    $computers = Get-Content -Path 'H:\My Documents\sccm\cn001.txt'
    Get-WmiObject -Class win32_share -Cn $computers
    The output doesn't really help though. I would need to figure out how to tweak it. It's just columns of share names, paths, and descriptions (or error messages). I might need a list of computers that share the c drive and another list of computers that don't.
    Tuesday, July 14, 2015 7:40 PM
  • What's the purpose of this exercise?

    -- Bill Stewart [Bill_Stewart]

    Tuesday, July 14, 2015 7:42 PM
    Moderator
  • If the c$ is shared, then I can check the Windows folder. If it's not shared, then I'd need to share it before checking the folder. I'm just seeing if I can automate this chore and save some time.
    Tuesday, July 14, 2015 7:53 PM
  • Thanks, that's a pretty good start.

    $computers = Get-Content -Path 'H:\My Documents\sccm\cn001.txt'
    Get-WmiObject -Class win32_share -Cn $computers
    The output doesn't really help though. I would need to figure out how to tweak it. It's just columns of share names, paths, and descriptions (or error messages). I might need a list of computers that share the c drive and another list of computers that don't.

    Pipe through Get-Member to see what properties are available to you and then use Select-Object to narrow down your output.


    Don't retire TechNet! - (Don't give up yet - 13,225+ strong and growing)

    Tuesday, July 14, 2015 7:54 PM
  • If the c$ is shared, then I can check the Windows folder. If it's not shared, then I'd need to share it before checking the folder. I'm just seeing if I can automate this chore and save some time.

    Try Test-Path.


    Don't retire TechNet! - (Don't give up yet - 13,225+ strong and growing)

    Tuesday, July 14, 2015 7:54 PM
  • You don't need c$ to get to the Windows installation directory. You can use admin$.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, July 14, 2015 8:07 PM
    Moderator