Enumerate File Server Shares and Associated Number of Connections

Please help!
My scenario: I have a mixed Windows 2003 & 2008 file server estate and i need to establish what shares are published on each server and the associated number of active connections, just like what the "Shares" section in computer management
gives me.  
I'd like to do this via some sort of script so I can then have a choice of what to do with the output, the interface won't give me the flexibility I need.  There seems to be a lot of scripts & help out there but nothing seems to quite give me what
I need e.g. I can enumerate the number of shares in a variety of ways but then can't figure out what i need to do to report the number of open connections, I've also found ways to report on the number of open sessions but then can't figure out how to get more
granularity on individual shares. Driving me a bit crazy right now as I'm probably near but due to my aged scripting abilities I just can't figure it out
Any ideas?  BTW PowerShell isn't installed on my Windows 2003 estate and it isn't practical to deploy/install it.
Thanks in advance.

Simple one-stop shopping for share info is here:
https://technet.microsoft.com/en-us/library/jj635704.aspx
¯\_(ツ)_/¯

Similar Messages

  • File Serving/Shares and vhdx

    On a 2012R2 guest OS that is going to be a file server...(low I/O really for our smb)
    Should I make one big VHDX attached to the guest to host say 7 shares... 
    Or should I logically split them up into separate vhdx files, but not 7 different ones as I would like to group them together into say maybe 4. 
    This is mainly for logical organization and isolation. I was curious to any negative effects from doing it that way. 
    I mean I wouldn't like a bunch of smaller vhdx files, but I'm not sure if I want one big one either. 
    I wouldn't mind having the engineering share as it's own vhdx though. 

    Go with one VHDX putting shared folders on it. There's no point with deploying multiple ones, you're not going to have better performance or security, you'll just make whole management more complicated. 
    StarWind VSAN [Virtual SAN] clusters Hyper-V without SAS, Fibre Channel, SMB 3.0 or iSCSI, uses Ethernet to mirror internally mounted SATA disks between hosts.

  • Server 2012 R2 SMB - The process cannot access the file '\\server\share\test.txt' because it is being used by another process.

    Hi,
    We are having issues with Server 2012 R2 SMB shares.
    We try to write some changes to a file, but we first create a temporary backup in case the write fails. After the backup is created we write the changes to the file and then we get an error:
    The process cannot access the file '\\server\share\test.txt' because it is being used by another process.
    It looks like the backup process keeps the original file in use.
    The problem doesn't always occur the first time, but almost everytime after 2 or 3 changes. I have provided some code below to reproduce the problem, you can run this in a loop to reproduce.
    The problem is that once the error arises, the file remains 'in use' for a while, so you cannot retry but have to wait at least several minutes. 
    I've already used Process Explorer to analyze, but there are no open file handles. 
    To reproduce the problem: create two Server 2012 R2 machines and run the below code from one server accessing an SMB share on the other server.
    Below is the code I use for testing, if you reproduce the scenario, I'm sure you get the same error.
    We are not looking for an alternative way to solve this, but wonder if this is a bug that needs to be reported?
    Anybody seen this behavior before or know what's causing it?
    The code:
    string file =
    @"\\server\share\test.txt";
    if (File.Exists(file))
    File.Copy(file, file +
    ".bak", true);
    File.WriteAllText(file,
    "Testje",
    Encoding.UTF8);
    The error:
     System.IO.IOException: The process cannot access the file '\\server\share\test.txt' because it is being used by another process.

    Hi,
    There is someone else having the same issue with yours. You could try code in the article below:
    “The process cannot access the file because it is being used by another process”
    http://blogs.msdn.com/b/shawncao/archive/2010/06/04/the-process-cannot-access-the-file-because-it-is-being-used-by-another-process.aspx
    If you wonder the root cause of the issue, the .NET Framework Class Libraries forum can help.
    Best Regards,
    Mandy 
    If you have any feedback on our support, please click
    here .
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Impossible to access File server shares using a DNS alias

    I am currently testing migration scenarios to replace 2 standalone W2K3 File Servers into 1 W2K8R2 Failover Cluster.
    Everything went very well, shares are well accessible as long as I use the new File Server names, but...
    ... when I try to use DNS aliases (of the old servers), It is getting a nightmare!
    First, each time I tried to to connect to the shares using the alias name \\tempsf\ I got an error message prompting for Duplicate name on the network.
    I solved this first issue by applying the DisableStrictNameChecking
    reg key (see below). The Duplicate name error message disappeared and I was able to access to the \\tempsf\ folder but it was empty however I have 2 shares well displayed when accessing it through the real file server name. Moreover, I confirm that :
    ping tempsf resolves correctly the real file server name and IP
    nslookup tempsf do the same
    net view \\realfileserver displays my 2 shares
    net view \\tempsf doesn't display anything :-(
    Then, I almost tried everything currently documented :
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters Add a new DWORD value called DisableStrictNameChecking and set to 1.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters Add a new Multi-String value called OptionalNames. Enter one or more aliases, one per line.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters Add a new DWORD value called DisableLoopBackCheck and set to 1.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 Add a new Multi-String Value BackConnectionHostNames. Enter one or more aliases, one per line.
    And also the SETSPN:
    setspn -A host/<your_ALIAS_name> <ServerrName>
    setspn -A host/<your_ALIAS_name.domain.com> <ServerNname>
    But still nothing... Launch date is approaching, I am feeling so desperate...
    Any idea? please... Thanks in advance,
    Max
    PS : Ahh yes, one more thing, we are using a third-party DNS here (Infoblox) but I don't think it could be the issue.

    Hello,
    Configure my new File Server (new name, new IP)
    Shutdown the old File Server
    Map the mirrored SAN disk to the new File Server
    Mount Storage and create shares (previously exported from old FS)
    Update Alias to point to point to new FS (in Infoblox)
    Update Reg keys, setspn and netdom as explained above
    Try access. Shares well displayed when using new FS name but nothing when using updated alias despite dns resolution is ok.
    I also found the following doc :
    http://blogs.technet.com/b/askcore/archive/2009/01/09/file-share-scoping-in-windows-server-2008-failover-clusters.aspx?PageIndex=2#comments which explain precisely the way the W2K8R2 File Servers are working but without giving any solution to my issue.
    Your doc was interesting but didn't help :-(
    Anyone else ? Thanks

  • SBS 2008 - Windows 8.1+ clients trouble accessing file server shares

    I have now upgraded 1 Windows 8 machine to Windows 8.1, and also clean installed another with Win 8.1 update 1 today, and both machines have trouble accessing the SBS2008 file server shares by UNC. If I browse by IP address of the server it seems to work
    flawlessly. The odd thing is that it's sporadic. So if I browse in explorer to "\\*netbiosname*\share" the Win8.1 machine will sometimes be able to access the share, and other times it will fail with a "network unable to reach location etc.."
    error. When it does work, it can take up to 5-10 minutes while explorer is frozen before the share is accessed. We're running quite a few Windows 8 machines without a problem, but it seems to be a specific problem with 8.1. Any idea?

    This doesn't seem to fix this specific problem. I had a few days of "luck", but now it's back. I just upgraded another co-workers machine to Win8.1 and he advised me that he's been having the same problem even with the above fix applied. His issue
    is when opening an office document that's located on the file server using location "\\servername\filename.xlsx", it takes a very long time (minutes) to open the excel file. This was happening to me as well, and if I tried to browse the network during
    this period, Windows Explorer would sometimes give me path not found, and unspecified error. I will try and capture a screen of the error when it occurs. Any ideas??
    edit: I have also noticed an unresponsive Windows Explorer for a few seconds to a minute over the last few days, which is a pretty good indicator that it's still happening on my machine.
    The odd thing is, if I use the IP address of the file server, everything is fine. I changed all of my links to use the IP since October when Win8.1 was released to combat this problem, and only changed them back to the server name for testing since I want
    to start deploying Win8.1 to others in the office. Unless I can fix this bug, they'll have to be stuck on Win8.
    Thanks,
    kk

  • Remote Server Shares and Permissions...

    Hi there...is there any command prompt CMD to view or list the server shares and permission (either Remotely or locally) in Windows environment... Pls let me know...
    VT

    Hi,
    Yes, you can use "ICACLS <path>" to check NTFS permissions (locally on the file server using the local drive or remotely using the UNC path). You could refer to the article below to know more detailed infomation about iCacls.
    iCacls 
    http://technet.microsoft.com/en-us/library/cc753525.aspx
    You can use "NET SHARE <sharename>" to check share permissions (locally on the file server).
    Net share
    http://technet.microsoft.com/en-us/library/bb490712.aspx
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Application server name and port number

    Hi
    Is it possible to get the application server name(ip) and port number at runtime. Becuase i want to open an html file which is in the application server, when a button is pressed by using web.show_document ();
    Can anyone guide me please.
    Thanks in advance
    geethu

    application server name and port number

  • Message Server Port and Instance Number

    Hi All,
    I need to create Technical System and Business System in SLD for my IDOC-XI-FILE Scenario. There i need to specify the Message Server port under Message Server and Instance Number in Central Application Server. Please let me know where i have to found these. Please help as soon as possible.
    Thanks & Regards,
    Nagarjuna.

    Hi Nagarujna,
    Instance Number : - just check the logon pad.. select your Ecc or R/3 system and click on chane item....  Usally it is 00.
    Message server port : it is 3600 + instance no.
    3600 + 00 = 3600
    Sachin

  • Cant UNC to file server share from DC

    thanks aaron, ill check out the link as well.

    Hey Guys.I have 2 Servers. Server1(DC), Server2(File Server).Server1 is Server 2012 running Hyper V, Server2 is a VM running on Server1 (Also server 2012)I can UNC into server2 from all workstations on the network and get access to the shared data files, but i cannot from Server1If i try to access server2 via the IP from server 1, i get in, but only 3 folders show up, folders which have nothing to do with the data shares. The 3 Folders are1) Netlogon 2) sysvol 3) VBRcatalogThe error i get when i try to UNC via name, is as follows;"\\server3 is not accessible. You might not have permission to use this network resource.Contact the administrator of the server to find out if you have permissions.The target account name is incorrect"Any help would be appreciated :/
    This topic first appeared in the Spiceworks Community

  • Connection to file server slow and unreliable after upgrading to Leopard

    I have a client with a G5 PowerMac (3 GB memory) who has been connecting reliably to a network file server (Windows based) at her company for years. Upon upgrading to Leopard the connections is slower. Or, rather, opening the root level directory is fast. The second level folder is fast. The third level is fast. Beyond that she gets the spinning cursor and it can take a long time to open, even if there are only a couple files inside. Also, navigating back to the first level I see a spinning cursor and "Connecting..." as though the Mac had lost connection with the file server simply by opening the volume. Sometimes she has to Force Quit the Finder (which reports "not responding". Weird. Any ideas out there?

    Hi Greg,
    It was my second visit to this company, and it was for something else that I was focussed on. I don't know what kind of server they are running. It's a PC house running Exchange servers so it's probably some kind of Microsoft system. If the problem persists I'l get more info next week when they reopen after the holiday.

  • Find out SQL Server Logins and associated Server Roles

    We have SQL Server 2000, 2005, 2008 and R2 in our environment.  We have several SQL Servers in our environment. I want to find out Server Logins and Server Roles Assigned in SQL Server. I want following information. Is there any way I can
    find it? Any help would be highly appreciated.
    SQL Server
    Login
    Role Assigned
    Server1
    Login1
    bulkadmin
    Server1
    Login2
    serveradmin
    Server1
    Login1
    diskadmin
    Server2
    Login1
    public

    The query only returns those logins that are assigned to at least one server role.if they are not assigned it will not return that login.If you want to return all the login then use the query below.Note that query returns public for those login with no server
    role assigned.
    select @@SERVERNAME
    ,sl.name
    ,isnull(DB_Roles.Roles,'Public')
    from syslogins sl
    left join
    select 'sysadmin' as Roles
    union all
    select 'securityadmin'
    union all
    select 'serveradmin'
    union all
    select 'setupadmin'
    union all
    select 'processadmin'
    union all
    select 'diskadmin'
    union all
    select 'dbcreator'
    union all
    select 'bulkadmin'
    union all
    select 'No serverRole'
    union all
    select 'public'
    ) DB_Roles
    on
    Case When sl.sysadmin=1 and DB_Roles.Roles='sysadmin' then 'sysadmin'
    When sl.securityadmin=1 and DB_Roles.Roles='securityadmin' then 'securityadmin'
    When sl.serveradmin=1 and DB_Roles.Roles='serveradmin' then 'serveradmin'
    When sl.setupadmin=1 and DB_Roles.Roles='setupadmin' then 'setupadmin'
    When sl.processadmin=1 and DB_Roles.Roles='processadmin' then 'processadmin'
    When sl.diskadmin=1 and DB_Roles.Roles='diskadmin' then 'diskadmin'
    When sl.dbcreator=1 and DB_Roles.Roles='dbcreator' then 'dbcreator'
    When sl.bulkadmin=1 and DB_Roles.Roles='bulkadmin' then 'bulkadmin'
    else null end=DB_Roles.Roles
    order by 2
    Vinay Valeti| If you think my suggestion is useful, please rate it as helpful. If it has helped you to resolve the problem, please Mark it as Answer
    works like a charm, thank you!!!

  • Time Capsule blinks yellow,when I go to airport utility to set up, it Says This apple wi-fi bse station doesn't have any DNS server addresses and might have trouble connecting to internet.  My internet works, but I can't back up anything. What do I do??

    Worked fine for about a couple of weeks after my son -law installed the time capsule.  I can access the Internet both from my wife's I phone and from my desktop.  I think that I need to get the DNS server numbers and put them in the two blanks; but where do I get them?  Thanks, Jim

    If the modem is also a router, either use the modem in bridge and run pppoe client on the TC.. that is assuming ADSL or similar eg vdsl. If it is cable service.. and the modem is a router, then bridge the TC.. go to internet page and select connect by ethernet and below that set connection sharing to bridge.
    Please tell us more about the modem if the above gives you issues.

  • Copying files between Iphone and PC over 3G-connection?

    Hi,
    Is there any application for copying files between PC and Iphone using a 3G or Edge connection? I'm using Jaadu VNC client on my Iphone but it has no functions for file transfers (as far as I know).
    Thanks for any hints!

    No. I don't believe that would be allowed with the SDK. You could always email them to yourself.

  • Need server.xml and web.xml for connection pooling

    hi guys,
    I am having lots of problem implementing the Connection Pool. I want to use the Tomcat's Connection pool classes and not my connection pool.
    I have gone through lots of problem trying to configure it.
    I got the range of errors. Has someone worked on this. Does it work with Tomcat 4.1 and Oracle 8i. Can anyone provide any links or previous posts to help me out.
    If someone can paste their working server.xml and web.xml then that would be really grt.
    Any kind of help would be really helpful.
    Amit

    Tomcat does not have a connection pooling mechanism. I've used Apache Commons DBCP with Tomcat although with PostgreSQL. It works great.
    Nothing in my web.xml gets modified. Only server.xml needs to be updated for DBCP. The Tomcat JNDI Datasource documentation is very good and should get you through.

  • Count files in Directory and the number of files in each sub directory

    Hello,
    I trying write a method which will start at a root of a file and count all the files in that directory. Then count all the files in each sub directory.
    import java.io.File;
    import java.io.FilenameFilter;
    import java.io.IOException;
    public class RunScan {
         * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              File file = new File("/home/robert/count");
              File[] files = file.listFiles();
              traverse(files);
              printfiles();
         private static int totalNumFiles = 0;
         private static int totalNumDir = 0;
         private static int filePerDir = 0;
         private static int subDir = 0;
         private static void traverse(File[] files) {
    for(int i = 0; i < files.length; i++) {
    if(files.isDirectory()) {
         totalNumDir++;
         printDir(files[i].toString());
         traverse(files[i].listFiles());
    totalNumFiles++;
    filePerDir++;
         private static void printfiles(){
              System.out.println("total files "+ (totalNumFiles));
         System.out.println("totls sub dir "+ totalNumDir);
         private static void printDir(String dirName){
              System.out.println("Total Files in "+dirName+" "+filePerDir);
              filePerDir = 0;

    Hint: Google "visitor pattern." This gives clues how to build a re-usable solution that can you use for future traversals that do things other than just file counts. Here's a teaser of an simple interface:
    public interface TreeVisitor {
    * Processes a single file or directory. <em>Tip:</em> If you want to track the number of
    * items processed, this function is the best place to update a counter.
    * Implementors of this method should not throw checked exceptions.
    * @param item The file or directory process.
    * @param depth Number of levels below top of traversal tree (0 = top of tree).
    public void visit(File item, int depth);
    }

Maybe you are looking for

  • Numbers (or Pages) Template Cannot Be Opened From Outside the Application

    Ever since the upgrade to Mavericks, I cannot open a Numbers (or Pages) template without being asked..... Do you want to add this custom template to the Template Chooser?  Then my only options are Cancel or Add to Template Chooser. If I cancel, it wo

  • Get directory structure on CF Server

    Hi, Is there any possibility to view the directory structure of the CF Server using CF Tags? E.g. When you are creating a MS Access datasource, it allows you to Browse to the required directory on the CF Server. Would be grateful if you could please

  • "page fault in nonpaged area" BSOD when installing latest driver for M476dw

    I just purchased a Color Laserjet MFP M476dw for use on my wireless network. I downloaded the latest version of the driver suite from HP:  LJPro-MFP-M476-Full-Solution-13302 for my OS Windows 8.1 / 64-bit  listed as version:  10.0.13302.320  --   25

  • GR Creation With  Excisable Entries

    Hi All,         I am working on GR Creation Interface.In which i have to create GR against Purchase Order. For that i am using BAPI_GOODSMVT_CREATE.If Purchase order line item excisable in such case i have to be update relvant Excise Group, Excise In

  • Internal memory full

    My phone memory is almost full. I have a 32gb SD card but it won't automatically send things to it. I've been to the Verizon store and they can't help me. Is there anyone out there experience the same thing. I'm not very tech savvy so if someone can