Which perfmon counter watches for incoming SMB connections on W2K3 server?

518

To get the list of users connected to shared folders on Windows Server 2003:

Start > Right-click on My Computer > Choose Manage > Go to Shared Folders node on the left.

Shares - lists all shared folders and number of connections;

Sessions - lists users using shares;

Open Files - list of files used by users.

You may also use command line to configure idle time, server settings via Net Config Server command

enter image description here

Net config server usage example

enter image description here

Share:
518

Related videos on Youtube

Craig
Author by

Craig

Updated on September 18, 2022

Comments

  • Craig
    Craig almost 2 years

    I have searched around for help but have been unsuccessful. I have found different codes to use a button on a worksheet to go back to the previous worksheet the user was on. What the company I work for wants are links on the top of almost each worksheet to function as a navigation pane for the users. I have created links at the top of the necessary sheets which all work as expected. I originally added code to my workbook to use a back link (previous sheet user was on, not the sheet before the current sheet) at cell "A5" and it worked for awhile but as I've been progressing on other items within the workbook, the code stopped working. I have compared the code on the working workbook with the nonworking workbook and they're the same and I don't believe other code is causing it to malfunction. Looking at the code below, does anyone have a suggestion for me?

    On worksheets that will have a back button I have:

    Option Explicit 
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range) 
     If Selection.Count = 1 Then
      If Not Intersect(Target, Range("A5")) Is Nothing Then 
       Call SelectLast 
      End If 
     End If
    End Sub
    

    In the ThisWorkbook object I have the following:

    Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) 
      LastSheet = Sh.Name 
    End Sub
    

    Finally, I have the following in it's own module:

    Public LastSheet As String 
    Sub SelectLast() 
      Application.Sheets(LastSheet).Select 
    End Sub
    

    Any assistance would be greatly appreciated. Thanks!

    • Nathan_Sav
      Nathan_Sav almost 7 years
      if target.cells.count=1 maybe and Application.Sheets(LastSheet).activate
    • Tim Williams
      Tim Williams almost 7 years
      What does it do instead of working?
    • Craig
      Craig almost 7 years
      @TimWilliams I get a Compile error: "Expected variable or procedure, not module". It then highlights the first line in yellow "Private Sub Worksheet_SelectionChange(ByVal Target As Range)" and my "Call SelectLast" module gets highlighted in blue. And it doesn't appear to be doing it anymore but just flipping through the tabs at one point was causing me to get an error, though I don't recall what it said. I eventually just marked all my code re: this as a comment so I could deal with it later.
  • Marc
    Marc over 11 years
    Thanks! but..., is this actually depicting the amount of active SMB user sessions to a server?
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    Yes, and this approach lists only incoming SMB connections.
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    Use cmd > net session to list outgoing SMB connections. This can be helpful in getting more details.
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    As you can see net session is CLI tool, and Sessions under Shared Folders is a GUI. CLI tool is useful if you want to drop smb sessions via script.
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    Vote up if the answer suits you. Thx! )
  • Craig
    Craig almost 7 years
    Pardon my ignorance but what do you mean by "Add a workbook-level name "LastSheet""? Do you mean declare it as a public variable?
  • Craig
    Craig almost 7 years
    I didn't think of adding a label! Probably because I've never done made a user form and never had a need for one. I will give this a try now and let you know. Thanks!
  • Craig
    Craig almost 7 years
    I gave it a go and could not make it work. I believe the reason is because the caption I need to read "Back", "Previous Tab" or something similar, not the name of a sheet. Now that I think about it, it might be because I wasn't specific enough in my original description so I'll go up and change it. But I don't want the link to select the sheet before it, I want the link to select whatever sheet the user was last on, which may or may not be the sheet before the current one.
  • Tim Williams
    Tim Williams almost 7 years
    Formulas tab >> Define name; choose "Workbook" for scope and enter "LastSheet" as the name. "Refers to" is not important when you're creating the name, so just accept whatever is already populated.
  • Craig
    Craig almost 7 years
    Ah! I thought you meant doing this in VBA. I attempted your solution but without success. I believe it's because the named range is static in what it refers to. VBA needs to determine the sheet the user was last on, not the sheet that is before it.
  • Tim Williams
    Tim Williams almost 7 years
    My bad - I did not fully test my code... See update above which now properly re-points the name to the correct place.
  • Craig
    Craig almost 7 years
    I have not applied the Previous Sheet link to all sheets yet but just tried it on three of them and it's working perfectly. Thank you!
  • Craig
    Craig almost 7 years
    I just wanted to add a little extra code for anyone else that may come across this and use it. The coding Tim provided that shows the back link with the name of the last sheet would leave an apostrophe at the end of the name. To remove the last apostrophe, use: =SUBSTITUTE(HYPERLINK("#lastsheet","Back to "&SUBSTITUTE(MID(CELL("address",LastSheet),1+FIND("]",CELL("‌​address",LastSheet))‌​,200),"!$A$1","")),"‌​'","")