How to run a AD query to detect what users are using a network share? Trying to decommission an old NAS.
dsk
unfortunately cannot query ad know if user uses network shares. there many ways map network drives (login script, gpp, manual map & homedirectory in user profile, etc ...)
you query ad homedirectory, or try query gpo, not return manual mapped drive or login script mapped drive.
anyway, there many way answer problem. use
1) psexec,
2) login script "net use >> \\server\share\%username%-map.txt" create text file, in share folder, , list network drives used users
3) powershell solution:
$computer = "computer1","computer2","computer3" $computer | % { if (test-connection $_) { get-wmiobject -class "win32_share" -namespace "root\cimv2" -computername $_ } else {write-host "$($_) not accessible" } }
hope helps
cyreli
Windows Server > Windows PowerShell
Comments
Post a Comment