|
Écrit par Arnaud Petitjean
|
|
04-01-2010 |
|
Voici une petite requête WMI simple mais efficace pour obtenir la liste des partages d'une machine :
PS > Get-WmiObject Win32_Share
Name Path Description
---- ---- -----------
ADMIN$ C:\Windows Remote Admin
C$ C:\ Default share
homes C:\homes
IPC$ Remote IPC
NETLOGON C:\Windows\SYSVOL\sysvol\powershell-scripting.com\SCRIPTS Logon server share
Profiles_UPM C:\Profiles_UPM
SYSVOL C:\Windows\SYSVOL\sysvol Logon server share
Pour obtenir les partages d'une machine distante, il suffit d'ajouter le paramètre -ComputerName MachineDistante :
PS > Get-WmiObject Win32_Share -Computer Serveur01
|