Hi All,
My goal is to write the data to text file located at remote location.
I'm able to write the data to file whose destination server credentials are same as source with below code. But could not write the data to file whose destination server credentials are difference from source.
Could you please help me in passing the destination server credentials so that it connects and writes the data?
Please find my existing code below
Option Explicit
Dim oWsh, oWshSysEnv, objFSO, objWMIService
Dim oDrives, oDrive, objOutFile, colItems, objItem
Dim strLineDate, strLineTime, strLineProcessorTime, strLineDriveSpace, strLinePercentCommittedBytesInUse
Set oWsh = WScript.CreateObject("WScript.Shell")
Set oWshSysEnv = oWsh.Environment("PROCESS")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
strLineDate = Date()
strLineTime = Time()
Set oDrives = objFSO.Drives
For Each oDrive In oDrives
Select Case oDrive.DriveType
Case 2
strLineDriveSpace = strLineDriveSpace & " " & oDrive.DriveLetter & "\: " & Round
(oDrive.FreeSpace / (1024 * 1024 * 1024),2) & "GB free (" & Round(100 * (oDrive.FreeSpace /
oDrive.TotalSize), 2) & " %) "
End Select
Next
Set objOutFile = objFSO.OpenTextFile("\\132.146.33.251\ft2\hdd_cpu_ram_MONv1.csv", 8, True)
WScript.Quit