![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) | ||||||||||||
| Guest | Bug with CIM_DataFile? So I was looking at a way with WMI to check the number of open connections to a file in a server share. I know it can be done other ways but I want to use WMI. I can check the number of connections to the share that have open files but I can't see which files the connections are to by using the Win32_Share, Win32_ServerSession, or Win32_ServerConnections classes. After looking around MSDN for a few hours I found the CIM_Datafile class which has a property called InUseCount.
Data type: uint64 Access type: Read-only Number of "file opens" that are currently active against the file. This property is inherited from CIM_LogicalFile. I used the following line: Get-WmiObject -Query {Select * From CIM_Datafile Where Name="C:\ \install.log"}|Select-Object * Which returns all kinds of information about the file. But the InUseCount is always Null. Even if I have several instances of the file open its Null. I've looked around quite a bit and several other people have noticed this but I can't figure out if I'm doing something wrong, if the property isn't implemented, if its a bug. Does anyone know anything about this property or another way to check the number of connections to a file using WMI? | ||||||||||||
| | #2 (permalink) | ||||||||||||||||||||||||
| Guest | RE: Bug with CIM_DataFile? My advice to Kuma as well as *anyone* else which is attempting to use WMI is to get to know "wmic". This command based tool is invaluable for determining whether the problem has something to do with Powershell or not. btw Powershell does have significant problems with impersonation which was been noted a number of times in this forum. My suggestion is not to use it. But back to the issue if you run the below command at the prompt you'll see that "inusecount" is blank wmic datafile where "path='\\'" list full Sorry to have to tell you the bad news but you'll need to try a different way. bob "Kuma" wrote:
| ||||||||||||||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: Bug with CIM_DataFile? or scriptomatic.hta ![]() "Bob Landau" <BobLandau@xxxxxx> wrote in message news:5298880C-EBC5-45F0-AC53-C5C896D04A28@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| |
| |