I'm seriously a rookie and have no clue what I'm doing ... that being said, can someone give me a hand with this script? Am I using the wrong command to get filesize? Some error handling would be great as well! Thanks!
Line: 44
Char: 4
Error: Type mismatch: 'FileLen'
Code: 800A000D
Set objFileSystem = CreateObject("Scripting.Fi
leSystemOb
ject")
Set objFile = objFileSystem.CreateTextFi
le("E2K3Da
tabaseSize
.csv", True, False)
Dim strLine
'Storage Groups
Dim strEEV01f,strEEV01g,strEEV
01h,strEEV
01i
'Mailbox Stores
Dim SG1MBXStore1,SG1MBXStore2,
SG1MBXStor
e3,SG1MBXS
tore4
Dim SG2MBXStore1,SG2MBXStore2,
SG2MBXStor
e3,SG2MBXS
tore4
Dim SG3MBXStore1,SG3MBXStore2,
SG3MBXStor
e3,SG3MBXS
tore4
Dim SG4MBXStore1,SG4MBXStore2,
SG4MBXStor
e3,SG4MBXS
tore4
'Databases
Dim strFile11,strFile12,strFil
e13,strFil
e14
Dim strFile21,strFile22,strFil
e23,strFil
e24
Dim strFile31,strFile32,strFil
e32,strFil
e34
Dim strFile41,strFile42,strFil
e43,strFil
e44
'Database Size
Dim strSize11,strSize12,strSiz
e13,strSiz
e14
Dim strSize21,strSize22,strSiz
e23,strSiz
e24
Dim strSize31,strSize32,strSiz
e33,strSiz
e34
Dim strSize41,strSize42,strSiz
e43,strSiz
e44
strLine = "Path,Database,Size"
objFile.WriteLine strLine
'Information for
strEEV01f = "\\cdc01eev01\f$\EXCHSRVR\
MDBDATA"
strSG1MBXStore1 = "SG1MBXStore1.edb"
strSG1MBXStore2 = "SG1MBXStore2.edb"
strSG1MBXStore3 = "SG1MBXStore3.edb"
strSG1MBXStore4 = "SG1MBXStore4.edb"
strFile1 = strEEV01f & "\" & strSG1MBXStore1
strFile2 = strEEV01f & "\" & strSG1MBXStore2
strFile3 = strEEV01f & "\" & strSG1MBXStore3
strFile4 = strEEV01f & "\" & strSG1MBXStore4
strSize11 = FileLen(strFile1)
strSize12 = FileLen(strFile1)
strSize13 = FileLen(strFile1)
strSize14 = FileLen(strFile1)
strEEV01g = "\\cdc01eev01\g$\EXCHSRVR\
MDBDATA"
strSG2MBXStore1 = "SG2MBXStore1.edb"
strSG2MBXStore2 = "SG2MBXStore2.edb"
strSG2MBXStore3 = "SG2MBXStore3.edb"
strSG2MBXStore4 = "SG2MBXStore4.edb"
strFile21 = strEEV01g & "\" & strSG2MBXStore1
strFile22 = strEEV01g & "\" & strSG2MBXStore2
strFile23 = strEEV01g & "\" & strSG2MBXStore3
strFile24 = strEEV01g & "\" & strSG2MBXStore4
strSize21 = FileLen(strFile21)
strSize22 = FileLen(strFile22)
strSize23 = FileLen(strFile23)
strSize24 = FileLen(strFile24)
strEEV01h = "\\cdc01eev01\h$\EXCHSRVR\
MDBDATA"
strSG3MBXStore1 = "SG3MBXStore1.edb"
strFile31 = strEEV01h & "\" & strSG3MBXStore1
strFile32 = strEEV01h & "\" & strSG3MBXStore2
strFile33 = strEEV01h & "\" & strSG3MBXStore3
strFile34 = strEEV01h & "\" & strSG3MBXStore4
strSize31 = FileLen(strFile31)
strSize32 = FileLen(strFile32)
strSize33 = FileLen(strFile33)
strSize34 = FileLen(strFile34)
strEEV01i = "\\cdc01eev01\i$\EXCHSRVR\
MDBDATA"
strSG1MBXStore1 = "SG1MBXStore1.edb"
strFile41 = strEEV01i & "\" & strSG4MBXStore1
strFile42 = strEEV01i & "\" & strSG4MBXStore2
strFile43 = strEEV01i & "\" & strSG4MBXStore3
strFile44 = strEEV01i & "\" & strSG4MBXStore4
strSize41 = FileLen(strFile21)
strSize42 = FileLen(strFile22)
strSize43 = FileLen(strFile23)
strSize44 = FileLen(strFile24)
' Research changing from Bytes to Gigabytes
'Storage Group 1
objFile.WriteLine strEEV01f & "," & strSG1MBXStore1 & "," & Format(strSize11, "#,##0")
objFile.WriteLine strEEV01f & "," & strSG1MBXStore2 & "," & Format(strSize12, "#,##0")
objFile.WriteLine strEEV01f & "," & strSG1MBXStore3 & "," & Format(strSize13, "#,##0")
objFile.WriteLine strEEV01f & "," & strSG1MBXStore4 & "," & Format(strSize14, "#,##0")
'Storage Group 2
objFile.WriteLine strEEV01g & "," & strSG2MBXStore1 & "," & Format(strSize21, "#,##0")
objFile.WriteLine strEEV01g & "," & strSG2MBXStore2 & "," & Format(strSize22, "#,##0")
objFile.WriteLine strEEV01g & "," & strSG2MBXStore3 & "," & Format(strSize23, "#,##0")
objFile.WriteLine strEEV01g & "," & strSG2MBXStore4 & "," & Format(strSize24, "#,##0")
'Storage Group 3
objFile.WriteLine strEEV01h & "," & strSG3MBXStore1 & "," & Format(strSize31, "#,##0")
objFile.WriteLine strEEV01h & "," & strSG3MBXStore2 & "," & Format(strSize32, "#,##0")
objFile.WriteLine strEEV01h & "," & strSG3MBXStore3 & "," & Format(strSize33, "#,##0")
objFile.WriteLine strEEV01h & "," & strSG3MBXStore4 & "," & Format(strSize34, "#,##0")
'Storage Group 4
objFile.WriteLine strEEV01i & "," & strSG4MBXStore1 & "," & Format(strSize41, "#,##0")
objFile.WriteLine strEEV01i & "," & strSG4MBXStore2 & "," & Format(strSize42, "#,##0")
objFile.WriteLine strEEV01i & "," & strSG4MBXStore3 & "," & Format(strSize43, "#,##0")
objFile.WriteLine strEEV01i & "," & strSG4MBXStore4 & "," & Format(strSize44, "#,##0")
Start Free Trial