Quantcast
Channel: Symantec Connect - Client Management Suite - Discussions
Viewing all articles
Browse latest Browse all 2021

Get Outlook mail id using custom script

$
0
0
I need a solution
Using the below script i can pull the values to a txt file, Can some body me help me to fetch the output into CMDB instead of text file.
I hope we need to change rest of bold thing.
 
'Find all Outlook pst files on C and D Drives
'Pat Fiannaca
 
strComputer = "."
on error resume next
set wshnetwork=createobject("wscript.network")
scomputername=wshnetwork.computername
set wshnetwork=nothing
Const OverwriteExisting = True
 
Set objWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2")
 
Set colFiles = objWMIService.ExecQuery _
    ("Select * from CIM_DataFile Where Extension = 'ost' AND (Drive = 'C:' OR Drive = 'D:')")
 
If colFiles.Count = 0 Then
    Wscript.Quit
End If
 
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder("C:\pstlog")
Set objTextFile = objFSO.CreateTextFile("c:\pstlog\pst_files_on_"& scomputername & ".txt " , True)
 
For Each objFile in colFiles
    objTextFile.Write(objFile.Drive & objFile.Path & "")
    objTextFile.Write(objFile.FileName & "."& objFile.Extension & ", Size ")
    objTextFile.Write(objFile.FileSize /1024 & "kb"& vbCrLf)
Next
 
objTextFile.Close

 


Viewing all articles
Browse latest Browse all 2021

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>