Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query for a Folder

Status
Not open for further replies.

oline61

MIS
Apr 4, 2003
3
US
I am trying to create a query that is like querying for a file name, but I'm really trying to query for the folder that contains multiple files.

Anyone have any ideas/solutions?

Right now I'm trying to query a particular path on my c drive. Is this even doable? Can you query a path?

 
You can query WMI CIM_Datafile for file properties, CIM_Directory for folder properties (except size), and/or use objFSO.GetFolder for folder size. Permissions can be found using cacls.exe or perms.exe (from Microsoft). The information can be written back to the SMS reporting node in WMI, or as a noidmif, and would be collected during the SMS hardware inventory.

Here is a tool that works for files. I'm not sure if it works for folders:
Extended Software Inventory for SMS
 
I don't understand your message. I 'll try to be more specific.

I need a query that I can run in SMS that will look into a specified pc's c: drive to find all folders with in a path (PATH is c:\Docs and Settings\)that will hold all of the users who have logged into the specified machine in the past.

I can write a query that will find the lastlogonuser, but I need ALL of the lastlogonusers for the history of the machine.

Here is an example of what I am doing.

select SMS_R_System.NetbiosName, SMS_G_System_PC_BIOS.SerialNumber, SMS_GH_System_COMPUTER_SYSTEM.TimeStamp, SMS_R_System.LastLogonUserName from SMS_R_System inner join SMS_G_System_PC_BIOS on SMS_G_System_PC_BIOS.ResourceID = SMS_R_System.ResourceId inner join SMS_GH_System_COMPUTER_SYSTEM on SMS_GH_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_R_System.NetbiosName = "USLVWS806503" and SMS_R_System.LastLogonUserName = "JLamkin" order by SMS_R_System.NetbiosName, SMS_G_System_PC_BIOS.SerialNumber, SMS_GH_System_COMPUTER_SYSTEM.TimeStamp, SMS_R_System.LastLogonUserName

Output shows:
Asset # Serial # Time UID 1 UID 2 etc...
USLVWS806503 serial123456789 Time/Date JLamkin

I need it to show:
Asset # Serial # Time UID 1 UID 2 etc...

Any assistance is appreciated!
USLVWS806503 123456789 Time/Date JLamkin DJohnson
 
System resource user logon history is not available, and my experience is that computer system logon history is spotty.

If you're looking for the list of users at \Documents and Settings then you'll need a custom agent to extract that information and send it to SMS. My note above says some about that area (though far from complete).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top