• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Clatent

Technology | Fitness | Food

  • About
  • Resources
  • Contact

One-Liner Wednesday December 14, 2022

December 14, 2022 by ClaytonT Leave a Comment

Ever have to migrate a share? Or see who is still accessing a share you need to do work on and want to make sure everyone is off of it so the user doesn’t lose any data? Here is the perfect one liner.

Get-wmiobject -computername ServerName win32_serverconnection | select-object sharename,username,computername

All you have to do is put your Server name in and then this will show all shares that users are connected to with their computer name. You could run it right on your server you want to check the shares on as well. This has been super helpful when doing maintenance and when we’ve had to migrate storage to different servers/locations.

Microsoft Learn:
Get-wmiobject

Related

Tagged With: One Liner Wednesday, PowerShell, Windows Server

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recipe Rating




Primary Sidebar

Clayton Tyger

Tech enthusiast dad who has lost 100lbs and now sometimes has crazy running/biking ideas. Read More…

Find Me On

  • Email
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter

Recent Posts

  • One-Liner Wednesday January 25, 2023
  • Module Monday January 23, 2023
  • One-Liner Wednesday January 18, 2023
  • Module Monday January 16, 2023
  • Read-Only Friday January 13, 2023

Categories

  • 365
  • Active Directory
  • Cim
  • Dashboards
  • Documentation
  • Get-WMI
  • Learning
  • Module Monday
  • Nutanix
  • One Liner Wednesday
  • Passwords
  • PDF
  • PowerShell
  • Read-Only Friday
  • Reporting
  • Security
  • Windows
  • WSUS

© 2023 Clatent