[ExchangeList] Re: PST script

  • From: "Tom Kern" <tpkern@xxxxxxxxx>
  • To: exchangelist@xxxxxxxxxxxxx
  • Date: Fri, 15 Sep 2006 10:20:32 -0400

No, my fault.
Sorry to bug you.
"wfile.writeln"  should be "wfile.writeline"
 
worked like a charm.
 
 
Thanks again and sorry to bug you before researching more myself.
 
Thanks!!
 


 
On 9/15/06, ChongJa@xxxxxxxxxxxxxxxx <ChongJa@xxxxxxxxxxxxxxxx > wrote:

No prob, should've tested before I sent it. Let me find out and I'll should send you something by today.

 


From: exchangelist-bounce@xxxxxxxxxxxxx [mailto:exchangelist-bounce@xxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Friday, September 15, 2006 9:49 AM


To: exchangelist@xxxxxxxxxxxxx
Subject: [ExchangeList] Re: PST script

 

Thanks.

 

Now, I get this error-

"Object doesn't support this property or method: 'wfile.writeln"

 

 

Weird thing also, is that it takes at least 10mins to spit that error out and quit.

 

Sorry to bug you with this since you're just trying to help.

 

I appreciate all you've done so far.

Thanks!



 

On 9/14/06, ChongJa@xxxxxxxxxxxxxxxx <ChongJa@xxxxxxxxxxxxxxxx > wrote:

Looks like quotes were bad, try this.

 

 

strComputer = "."

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

 

Set colFiles = objWMIService.ExecQuery _

    ("Select * from CIM_DataFile Where Extension = 'pst'")

Set fso = CreateObject("Scripting.FileSystemObject")

 

set wfile = fso.opentextfile("c:\test.csv",2,true)

 

 

For Each objFile in colFiles

Wfile.writeln(strComputer & " " & objFile.Drive & " " & objFile.Path & " " & objFile.FileName & "." & objFile.Extension & " " & objFile.FileSize)

Next

 

 

 

 


From: exchangelist-bounce@xxxxxxxxxxxxx [mailto:exchangelist-bounce@xxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Thursday, September 14, 2006 4:30 PM


To: exchangelist@xxxxxxxxxxxxx
Subject: [ExchangeList] Re: PST script

 

It doesn't like the first " in this line-

 

Wfile.writeln(strcomputer & " " & objFile.Drive & objFile.Path & " " & objFile.FileName & "." & objFile.Extension & " " & objFile.FileSize)
Next

 

Sorry.

 

Thanks


 

On 9/14/06, ChongJa@xxxxxxxxxxxxxxxx <ChongJa@xxxxxxxxxxxxxxxx > wrote:

 

Retrieving Computer Names from a Text File

 

http://www.microsoft.com/technet/scriptcenter/resources/tales/sg1102.mspx

 

 

Found this. I set it up so that it also gets the computer name and writes to a file. Test it out and let me know if it doesn't work.

 

How Can I Get a List of All the .PST Files on a Computer?

 

 

http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr05/hey0408.mspx

 

 


 
 

strComputer = "."
 
 
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
 

 
 
Set colFiles = 

 
objWMIService.ExecQuery _
 
    ("Select * from CIM_DataFile Where Extension = 'pst'")

Set fso = CreateObject("Scripting.FileSystemObject")

set wfile = fso.opentextfile("c:\test.csv",2,true)

 

 
 
For Each objFile in colFiles
 
Wfile.writeln(strcomputer & " " & 
objFile.Drive & objFile.Path
 
& " " & objFile.FileName

 
 & "." & 
objFile.Extension 

& " " & objFile.FileSize)

 
 

Next
 
 
 
 

 

 


From: exchangelist-bounce@xxxxxxxxxxxxx [mailto:exchangelist-bounce@xxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Thursday, September 14, 2006 1:53 PM


To: exchangelist@xxxxxxxxxxxxx
Subject: [ExchangeList] Re: PST script

 

Thanks.

It works pretty well.

 

I'm just making my way around VBscript so any help on how to modify the script to read in a text file of pc names and spit out the result path info to a diff text file would be great.

I don't suppose there is anyway to get the name of the pc in the path info as well?

 

Thanks. You've been a great help!

 

On 9/14/06, ChongJa@xxxxxxxxxxxxxxxx <ChongJa@xxxxxxxxxxxxxxxx > wrote:

Test it out, on a few computers and if it's something you can work with, I'll help you to pipe out the additional info, pc name, dir path.

 


From: exchangelist-bounce@xxxxxxxxxxxxx [mailto:exchangelist-bounce@xxxxxxxxxxxxx] On Behalf Of Chong, James
Sent: Thursday, September 14, 2006 1:16 PM
To: exchangelist@xxxxxxxxxxxxx
Subject: [ExchangeList] Re: PST script

 

Use something like this from MS scriptcenter. Pipe the results to a text file. In order for you to search your network, you must execute this script to read in a text file of all your computers in your network.

 


 
 

 
 
strComputer = "."

 
 

Set objWMIService = GetObject("winmgmts:" _

 
 

    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

 
 
Set colFiles = objWMIService.ExecQuery _

 
    ("Select * from CIM_DataFile where Extension = 'mp3'")
 

 
 
For Each objFile in colFiles

 
    Wscript.Echo objFile.Name
 
 
 

 
Next

 

 

http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct04/hey1014.mspx

 


From: exchangelist-bounce@xxxxxxxxxxxxx [mailto:exchangelist-bounce@xxxxxxxxxxxxx] On Behalf Of Tom Kern
Sent: Thursday, September 14, 2006 12:44 PM
To: ExchangeList
Subject: [ExchangeList] PST script

 

Does anyone know of a script or free utility which can scan every pc on your network for PST files and just dump out the pc name,dir path to each pst it finds to a text file?

 

 

My manager wants to have a listing of all pst files our users have on the network.

This includes pst's dumped locally as well as one's in their networked home dir.

 

 

Thanks alot.

 

 

 


Other related posts: