Hello All...

I am looking for a script that will search the registry and display
all the current .pst files for a user, and then check the file size...
If it is over a certain value email a warning to a administrator and
the user...

i have found this

Option Explicit
Const HKEY_CURRENT_USER = &H80000001
Const r_PSTGuidLocation = "01023d00"
Const r_MasterConfig = "01023d0e"
Const r_PSTCheckFile = "00033009"
Const r_PSTFile = "001f6700"
Const r_keyMaster = "9207f3e0a3b11019908b08002b2a56c2"
Const r_ProfilesRoot = "Software\Microsoft\Windows NT\CurrentVersion
\Windows Messaging Subsystem\Profiles"
Const r_DefaultProfileString = "DefaultProfile"
Dim oReg :Set oReg=GetObject("winmgmts:
{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
Dim arrSubKeys, subkey, strValue, i, pstFile, arrPSTs,
DefaultProfileName

oReg.GetStringValue
HKEY_CURRENT_USER,r_ProfilesRoot,r_DefaultProfileString,DefaultProfileName
GetPSTsForProfile(DefaultProfileName)

'_____________________________________________________________________________________________________________________________
Function GetPSTsForProfile(p_profileName)
Dim strHexNumber, strPSTGuid, strFoundPST

oReg.GetBinaryValue HKEY_CURRENT_USER,r_ProfilesRoot & "\" &
p_profileName & "\" & r_keyMaster,r_MasterConfig,strValue
For Each i In strValue
If Len(Hex(i)) = 1 Then
strHexNumber = CInt("0") & Hex(i)
Else
strHexNumber = Hex(i)
End If
strPSTGuid = strPSTGuid + strHexNumber
If Len(strPSTGuid) = 32 Then
If IsAPST(r_ProfilesRoot & "\" & p_profileName & "\" &
strPSTGuid) Then
Wscript.Echo PSTFileName(r_ProfilesRoot & "\" &
p_profileName & "\" & _
PSTlocation(r_ProfilesRoot & "\" &
p_profileName & "\" & strPSTGuid))
End If
strPSTGuid = ""
End If
Next
End Function
'_____________________________________________________________________________________________________________________________
Function IsAPST(p_PSTGuid)
Dim x, P_PSTGuildValue
Dim P_PSTCheck:P_PSTCheck=0
IsAPST=False
oReg.GetBinaryValue
HKEY_CURRENT_USER,p_PSTGuid,r_PSTCheckFile,P_PSTGuildValue
For Each x in P_PSTGuildValue
P_PSTCheck = P_PSTCheck + Hex(x)
Next
If P_PSTCheck=20 Then
IsAPST=True
End If
End Function
'_____________________________________________________________________________________________________________________________
Function PSTlocation(p_PSTGuid)
Dim y, P_PSTGuildValue
oReg.GetBinaryValue
HKEY_CURRENT_USER,p_PSTGuid,r_PSTGuidLocation,P_PSTGuildValue
For Each y In P_PSTGuildValue
If Len(Hex(y)) = 1 Then
PSTlocation = PSTlocation & CInt("0") & Hex(y)
Else
PSTlocation = PSTlocation & Hex(y)
End If
Next
End Function
'_____________________________________________________________________________________________________________________________
Function PSTFileName(p_PSTGuid)
Dim z, P_PSTName
Dim strString : strString = ""
oReg.GetBinaryValue HKEY_CURRENT_USER,p_PSTGuid,r_PSTFile,P_PSTName
For Each z in P_PSTName
If z > 0 Then strString = strString & Chr(z)
Next
PSTFileName = strString
End Function
'_________________________________________________________________________________________________________
Function ExpandEvnVariable(ExpandThis)
Dim objWSHShell :Set objWSHShell = CreateObject("WScript.Shell")
ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" &
ExpandThis & "%")
End Function
'_________________________________________________________________________________________________________



and it DOES tell me all the PST i have active, but i dont know how to
do the rest.. We dont use exchange, so we use the dreaded local PST
files and a good amount of my time is being used up baby sitting
users.

Thanks for the help in advance.

Re: Help needed... VBScript to determine ALL pst files from users profile by Pegasus

Pegasus
Wed Jan 30 13:31:11 CST 2008


"Jeff Pancrazio" <jpancrazio@gmail.com> wrote in message
news:4203dbe4-ab90-4c55-993a-89eb6666b1c0@p69g2000hsa.googlegroups.com...
> Hello All...
>
> I am looking for a script that will search the registry and display
> all the current .pst files for a user, and then check the file size...
> If it is over a certain value email a warning to a administrator and
> the user...
>
> i have found this
>
> Option Explicit
> Const HKEY_CURRENT_USER = &H80000001
> Const r_PSTGuidLocation = "01023d00"
> Const r_MasterConfig = "01023d0e"
> Const r_PSTCheckFile = "00033009"
> Const r_PSTFile = "001f6700"
> Const r_keyMaster = "9207f3e0a3b11019908b08002b2a56c2"
> Const r_ProfilesRoot = "Software\Microsoft\Windows NT\CurrentVersion
> \Windows Messaging Subsystem\Profiles"
> Const r_DefaultProfileString = "DefaultProfile"
> Dim oReg :Set oReg=GetObject("winmgmts:
> {impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
> Dim arrSubKeys, subkey, strValue, i, pstFile, arrPSTs,
> DefaultProfileName
>
> oReg.GetStringValue
> HKEY_CURRENT_USER,r_ProfilesRoot,r_DefaultProfileString,DefaultProfileName
> GetPSTsForProfile(DefaultProfileName)
>
> '_____________________________________________________________________________________________________________________________
> Function GetPSTsForProfile(p_profileName)
> Dim strHexNumber, strPSTGuid, strFoundPST
>
> oReg.GetBinaryValue HKEY_CURRENT_USER,r_ProfilesRoot & "\" &
> p_profileName & "\" & r_keyMaster,r_MasterConfig,strValue
> For Each i In strValue
> If Len(Hex(i)) = 1 Then
> strHexNumber = CInt("0") & Hex(i)
> Else
> strHexNumber = Hex(i)
> End If
> strPSTGuid = strPSTGuid + strHexNumber
> If Len(strPSTGuid) = 32 Then
> If IsAPST(r_ProfilesRoot & "\" & p_profileName & "\" &
> strPSTGuid) Then
> Wscript.Echo PSTFileName(r_ProfilesRoot & "\" &
> p_profileName & "\" & _
> PSTlocation(r_ProfilesRoot & "\" &
> p_profileName & "\" & strPSTGuid))
> End If
> strPSTGuid = ""
> End If
> Next
> End Function
> '_____________________________________________________________________________________________________________________________
> Function IsAPST(p_PSTGuid)
> Dim x, P_PSTGuildValue
> Dim P_PSTCheck:P_PSTCheck=0
> IsAPST=False
> oReg.GetBinaryValue
> HKEY_CURRENT_USER,p_PSTGuid,r_PSTCheckFile,P_PSTGuildValue
> For Each x in P_PSTGuildValue
> P_PSTCheck = P_PSTCheck + Hex(x)
> Next
> If P_PSTCheck=20 Then
> IsAPST=True
> End If
> End Function
> '_____________________________________________________________________________________________________________________________
> Function PSTlocation(p_PSTGuid)
> Dim y, P_PSTGuildValue
> oReg.GetBinaryValue
> HKEY_CURRENT_USER,p_PSTGuid,r_PSTGuidLocation,P_PSTGuildValue
> For Each y In P_PSTGuildValue
> If Len(Hex(y)) = 1 Then
> PSTlocation = PSTlocation & CInt("0") & Hex(y)
> Else
> PSTlocation = PSTlocation & Hex(y)
> End If
> Next
> End Function
> '_____________________________________________________________________________________________________________________________
> Function PSTFileName(p_PSTGuid)
> Dim z, P_PSTName
> Dim strString : strString = ""
> oReg.GetBinaryValue HKEY_CURRENT_USER,p_PSTGuid,r_PSTFile,P_PSTName
> For Each z in P_PSTName
> If z > 0 Then strString = strString & Chr(z)
> Next
> PSTFileName = strString
> End Function
> '_________________________________________________________________________________________________________
> Function ExpandEvnVariable(ExpandThis)
> Dim objWSHShell :Set objWSHShell = CreateObject("WScript.Shell")
> ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" &
> ExpandThis & "%")
> End Function
> '_________________________________________________________________________________________________________
>
>
>
> and it DOES tell me all the PST i have active, but i dont know how to
> do the rest.. We dont use exchange, so we use the dreaded local PST
> files and a good amount of my time is being used up baby sitting
> users.
>
> Thanks for the help in advance.
>

This is a fairly complex script you wrote. Would it not be simpler
to search the "Documents and Settings" folder for recent .PST
files and to send an EMail to yourself and the user if any of them
are above a certain size?



Re: Help needed... VBScript to determine ALL pst files from users by Jeff

Jeff
Wed Jan 30 13:50:56 CST 2008

On Jan 30, 2:31=A0pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> "Jeff Pancrazio" <jpancra...@gmail.com> wrote in message
>
> news:4203dbe4-ab90-4c55-993a-89eb6666b1c0@p69g2000hsa.googlegroups.com...
>
>
>
>
>
> > Hello All...
>
> > I am looking for a script that will search the registry and display
> > all the current .pst files for a user, and then check the file size...
> > If it is over a certain value email a warning to a administrator and
> > the user...
>
> > i have found this
>
> > Option Explicit
> > Const HKEY_CURRENT_USER =3D &H80000001
> > Const r_PSTGuidLocation =3D "01023d00"
> > Const r_MasterConfig =3D "01023d0e"
> > Const r_PSTCheckFile =3D "00033009"
> > Const r_PSTFile =3D "001f6700"
> > Const r_keyMaster =3D "9207f3e0a3b11019908b08002b2a56c2"
> > Const r_ProfilesRoot =3D "Software\Microsoft\Windows NT\CurrentVersion
> > \Windows Messaging Subsystem\Profiles"
> > Const r_DefaultProfileString =3D "DefaultProfile"
> > Dim oReg =A0 =A0 =A0 =A0:Set oReg=3DGetObject("winmgmts:
> > {impersonationLevel=3Dimpersonate}!\\.\root\default:StdRegProv")
> > Dim arrSubKeys, subkey, strValue, i, pstFile, arrPSTs,
> > DefaultProfileName
>
> > oReg.GetStringValue
> > HKEY_CURRENT_USER,r_ProfilesRoot,r_DefaultProfileString,DefaultProfileNa=
me
> > GetPSTsForProfile(DefaultProfileName)
>
> > '_______________________________________________________________________=
___=AD___________________________________________________
> > Function GetPSTsForProfile(p_profileName)
> > =A0 Dim strHexNumber, strPSTGuid, strFoundPST
>
> > =A0 oReg.GetBinaryValue HKEY_CURRENT_USER,r_ProfilesRoot & "\" &
> > p_profileName & "\" & r_keyMaster,r_MasterConfig,strValue
> > =A0 For Each i In strValue
> > =A0 =A0 =A0 If Len(Hex(i)) =3D 1 Then
> > =A0 =A0 =A0 =A0 =A0 strHexNumber =3D CInt("0") & Hex(i)
> > =A0 =A0 =A0 Else
> > =A0 =A0 =A0 =A0 =A0 strHexNumber =3D Hex(i)
> > =A0 =A0 =A0 End If
> > =A0 =A0 =A0 strPSTGuid =3D strPSTGuid + strHexNumber
> > =A0 =A0 =A0 If Len(strPSTGuid) =3D 32 Then
> > =A0 =A0 =A0 =A0 =A0 If IsAPST(r_ProfilesRoot & "\" & p_profileName & "\"=
&
> > strPSTGuid) Then
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 Wscript.Echo PSTFileName(r_ProfilesRoot & "\=
" &
> > p_profileName & "\" & _
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PSTlocation(r_Profil=
esRoot & "\" &
> > p_profileName & "\" & strPSTGuid))
> > =A0 =A0 =A0 =A0 =A0 End If
> > =A0 =A0 =A0 strPSTGuid =3D ""
> > =A0 =A0 =A0 End If
> > =A0 Next
> > End Function
> > '_______________________________________________________________________=
___=AD___________________________________________________
> > Function IsAPST(p_PSTGuid)
> > =A0 Dim x, P_PSTGuildValue
> > =A0 Dim P_PSTCheck:P_PSTCheck=3D0
> > =A0 IsAPST=3DFalse
> > =A0 oReg.GetBinaryValue
> > HKEY_CURRENT_USER,p_PSTGuid,r_PSTCheckFile,P_PSTGuildValue
> > =A0 =A0 =A0 For Each x in P_PSTGuildValue
> > =A0 =A0 =A0 =A0 =A0 P_PSTCheck =3D P_PSTCheck + Hex(x)
> > =A0 =A0 =A0 Next
> > =A0 =A0 =A0 If P_PSTCheck=3D20 Then
> > =A0 =A0 =A0 =A0 =A0 IsAPST=3DTrue
> > =A0 =A0 =A0 End If
> > End Function
> > '_______________________________________________________________________=
___=AD___________________________________________________
> > Function PSTlocation(p_PSTGuid)
> > =A0 Dim y, P_PSTGuildValue
> > =A0 oReg.GetBinaryValue
> > HKEY_CURRENT_USER,p_PSTGuid,r_PSTGuidLocation,P_PSTGuildValue
> > =A0 =A0 =A0For Each y In P_PSTGuildValue
> > =A0 =A0 =A0 =A0 =A0If Len(Hex(y)) =3D 1 Then
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0PSTlocation =3D PSTlocation & CInt("0") & Hex=
(y)
> > =A0 =A0 =A0 =A0 =A0Else
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0PSTlocation =3D PSTlocation & Hex(y)
> > =A0 =A0 =A0 =A0 =A0End If
> > =A0 =A0 =A0Next
> > End Function
> > '_______________________________________________________________________=
___=AD___________________________________________________
> > Function PSTFileName(p_PSTGuid)
> > =A0 Dim z, P_PSTName
> > =A0 Dim strString : strString =3D ""
> > =A0 oReg.GetBinaryValue HKEY_CURRENT_USER,p_PSTGuid,r_PSTFile,P_PSTName
> > =A0 =A0 =A0 For Each z in P_PSTName
> > =A0 =A0 =A0 =A0 =A0 If z > 0 Then strString =3D strString & Chr(z)
> > =A0 =A0 =A0 Next
> > =A0 PSTFileName =3D strString
> > End Function
> > '_______________________________________________________________________=
___=AD_______________________________
> > Function ExpandEvnVariable(ExpandThis)
> > =A0 Dim objWSHShell =A0 =A0:Set objWSHShell =3D CreateObject("WScript.Sh=
ell")
> > =A0 ExpandEvnVariable =3D objWSHShell.ExpandEnvironmentStrings("%" &
> > ExpandThis & "%")
> > End Function
> > '_______________________________________________________________________=
___=AD_______________________________
>
> > and it DOES tell me all the PST i have active, but i dont know how to
> > do the rest.. We dont use exchange, so we use the dreaded local PST
> > files and a good amount of my time is being used up baby sitting
> > users.
>
> > Thanks for the help in advance.
>
> This is a fairly complex script you wrote. Would it not be simpler
> to search the "Documents and Settings" folder for recent .PST
> files and to send an EMail to yourself and the user if any of them
> are above a certain size?- Hide quoted text -
>
> - Show quoted text -

Actually, as i said i didnt right the script, i found it, and it
almost does what i need. The problem is, i dont think all the users
have them on there my documents, some might have it in there home dir
(x).. Thanks for the quick response


Re: Help needed... VBScript to determine ALL pst files from users profile by Al

Al
Wed Jan 30 21:42:44 CST 2008


"Jeff Pancrazio" <jpancrazio@gmail.com> wrote in message
news:60f371b0-86ad-4514-86d3-af6e214419f9@d21g2000prf.googlegroups.com...
On Jan 30, 2:31 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> "Jeff Pancrazio" <jpancra...@gmail.com> wrote in message
>
> news:4203dbe4-ab90-4c55-993a-89eb6666b1c0@p69g2000hsa.googlegroups.com...
>
>
>
>
>
> > Hello All...
>
> > I am looking for a script that will search the registry and display
> > all the current .pst files for a user, and then check the file size...
> > If it is over a certain value email a warning to a administrator and
> > the user...
>
> > i have found this
>
> > Option Explicit
> > Const HKEY_CURRENT_USER = &H80000001
> > Const r_PSTGuidLocation = "01023d00"
> > Const r_MasterConfig = "01023d0e"
> > Const r_PSTCheckFile = "00033009"
> > Const r_PSTFile = "001f6700"
> > Const r_keyMaster = "9207f3e0a3b11019908b08002b2a56c2"
> > Const r_ProfilesRoot = "Software\Microsoft\Windows NT\CurrentVersion
> > \Windows Messaging Subsystem\Profiles"
> > Const r_DefaultProfileString = "DefaultProfile"
> > Dim oReg :Set oReg=GetObject("winmgmts:
> > {impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
> > Dim arrSubKeys, subkey, strValue, i, pstFile, arrPSTs,
> > DefaultProfileName
>
> > oReg.GetStringValue
> > HKEY_CURRENT_USER,r_ProfilesRoot,r_DefaultProfileString,DefaultProfileName
> > GetPSTsForProfile(DefaultProfileName)
>
> > '__________________________________________________________________________­___________________________________________________
> > Function GetPSTsForProfile(p_profileName)
> > Dim strHexNumber, strPSTGuid, strFoundPST
>
> > oReg.GetBinaryValue HKEY_CURRENT_USER,r_ProfilesRoot & "\" &
> > p_profileName & "\" & r_keyMaster,r_MasterConfig,strValue
> > For Each i In strValue
> > If Len(Hex(i)) = 1 Then
> > strHexNumber = CInt("0") & Hex(i)
> > Else
> > strHexNumber = Hex(i)
> > End If
> > strPSTGuid = strPSTGuid + strHexNumber
> > If Len(strPSTGuid) = 32 Then
> > If IsAPST(r_ProfilesRoot & "\" & p_profileName & "\" &
> > strPSTGuid) Then
> > Wscript.Echo PSTFileName(r_ProfilesRoot & "\" &
> > p_profileName & "\" & _
> > PSTlocation(r_ProfilesRoot & "\" &
> > p_profileName & "\" & strPSTGuid))
> > End If
> > strPSTGuid = ""
> > End If
> > Next
> > End Function
> > '__________________________________________________________________________­___________________________________________________
> > Function IsAPST(p_PSTGuid)
> > Dim x, P_PSTGuildValue
> > Dim P_PSTCheck:P_PSTCheck=0
> > IsAPST=False
> > oReg.GetBinaryValue
> > HKEY_CURRENT_USER,p_PSTGuid,r_PSTCheckFile,P_PSTGuildValue
> > For Each x in P_PSTGuildValue
> > P_PSTCheck = P_PSTCheck + Hex(x)
> > Next
> > If P_PSTCheck=20 Then
> > IsAPST=True
> > End If
> > End Function
> > '__________________________________________________________________________­___________________________________________________
> > Function PSTlocation(p_PSTGuid)
> > Dim y, P_PSTGuildValue
> > oReg.GetBinaryValue
> > HKEY_CURRENT_USER,p_PSTGuid,r_PSTGuidLocation,P_PSTGuildValue
> > For Each y In P_PSTGuildValue
> > If Len(Hex(y)) = 1 Then
> > PSTlocation = PSTlocation & CInt("0") & Hex(y)
> > Else
> > PSTlocation = PSTlocation & Hex(y)
> > End If
> > Next
> > End Function
> > '__________________________________________________________________________­___________________________________________________
> > Function PSTFileName(p_PSTGuid)
> > Dim z, P_PSTName
> > Dim strString : strString = ""
> > oReg.GetBinaryValue HKEY_CURRENT_USER,p_PSTGuid,r_PSTFile,P_PSTName
> > For Each z in P_PSTName
> > If z > 0 Then strString = strString & Chr(z)
> > Next
> > PSTFileName = strString
> > End Function
> > '__________________________________________________________________________­_______________________________
> > Function ExpandEvnVariable(ExpandThis)
> > Dim objWSHShell :Set objWSHShell = CreateObject("WScript.Shell")
> > ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" &
> > ExpandThis & "%")
> > End Function
> > '__________________________________________________________________________­_______________________________
>
> > and it DOES tell me all the PST i have active, but i dont know how to
> > do the rest.. We dont use exchange, so we use the dreaded local PST
> > files and a good amount of my time is being used up baby sitting
> > users.
>
> > Thanks for the help in advance.
>
> This is a fairly complex script you wrote. Would it not be simpler
> to search the "Documents and Settings" folder for recent .PST
> files and to send an EMail to yourself and the user if any of them
> are above a certain size?- Hide quoted text -
>
> - Show quoted text -

Actually, as i said i didnt right the script, i found it, and it
almost does what i need. The problem is, i dont think all the users
have them on there my documents, some might have it in there home dir
(x).. Thanks for the quick response

===> How I search for PST files on home folders is to do either a windows
explorer search for *.pst in the folder that contains the user home folders,
or sometimes a find.exe command from the command prompt.

I have also run a batch script that searches the C$ share on all the
workstations looking for *.PST files.

/Al



Re: Help needed... VBScript to determine ALL pst files from users profile by Pegasus

Pegasus
Fri Feb 01 15:53:14 CST 2008


"Jeff Pancrazio" <jpancrazio@gmail.com> wrote in message
news:60f371b0-86ad-4514-86d3-af6e214419f9@d21g2000prf.googlegroups.com...
On Jan 30, 2:31 pm, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> "Jeff Pancrazio" <jpancra...@gmail.com> wrote in message
>
> news:4203dbe4-ab90-4c55-993a-89eb6666b1c0@p69g2000hsa.googlegroups.com...
>
>
>
>
>
> > Hello All...
>
> > I am looking for a script that will search the registry and display
> > all the current .pst files for a user, and then check the file size...
> > If it is over a certain value email a warning to a administrator and
> > the user...
>
> > i have found this
>
> > Option Explicit
> > Const HKEY_CURRENT_USER = &H80000001
> > Const r_PSTGuidLocation = "01023d00"
> > Const r_MasterConfig = "01023d0e"
> > Const r_PSTCheckFile = "00033009"
> > Const r_PSTFile = "001f6700"
> > Const r_keyMaster = "9207f3e0a3b11019908b08002b2a56c2"
> > Const r_ProfilesRoot = "Software\Microsoft\Windows NT\CurrentVersion
> > \Windows Messaging Subsystem\Profiles"
> > Const r_DefaultProfileString = "DefaultProfile"
> > Dim oReg :Set oReg=GetObject("winmgmts:
> > {impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
> > Dim arrSubKeys, subkey, strValue, i, pstFile, arrPSTs,
> > DefaultProfileName
>
> > oReg.GetStringValue
> > HKEY_CURRENT_USER,r_ProfilesRoot,r_DefaultProfileString,DefaultProfileName
> > GetPSTsForProfile(DefaultProfileName)
>
> > '__________________________________________________________________________­___________________________________________________
> > Function GetPSTsForProfile(p_profileName)
> > Dim strHexNumber, strPSTGuid, strFoundPST
>
> > oReg.GetBinaryValue HKEY_CURRENT_USER,r_ProfilesRoot & "\" &
> > p_profileName & "\" & r_keyMaster,r_MasterConfig,strValue
> > For Each i In strValue
> > If Len(Hex(i)) = 1 Then
> > strHexNumber = CInt("0") & Hex(i)
> > Else
> > strHexNumber = Hex(i)
> > End If
> > strPSTGuid = strPSTGuid + strHexNumber
> > If Len(strPSTGuid) = 32 Then
> > If IsAPST(r_ProfilesRoot & "\" & p_profileName & "\" &
> > strPSTGuid) Then
> > Wscript.Echo PSTFileName(r_ProfilesRoot & "\" &
> > p_profileName & "\" & _
> > PSTlocation(r_ProfilesRoot & "\" &
> > p_profileName & "\" & strPSTGuid))
> > End If
> > strPSTGuid = ""
> > End If
> > Next
> > End Function
> > '__________________________________________________________________________­___________________________________________________
> > Function IsAPST(p_PSTGuid)
> > Dim x, P_PSTGuildValue
> > Dim P_PSTCheck:P_PSTCheck=0
> > IsAPST=False
> > oReg.GetBinaryValue
> > HKEY_CURRENT_USER,p_PSTGuid,r_PSTCheckFile,P_PSTGuildValue
> > For Each x in P_PSTGuildValue
> > P_PSTCheck = P_PSTCheck + Hex(x)
> > Next
> > If P_PSTCheck=20 Then
> > IsAPST=True
> > End If
> > End Function
> > '__________________________________________________________________________­___________________________________________________
> > Function PSTlocation(p_PSTGuid)
> > Dim y, P_PSTGuildValue
> > oReg.GetBinaryValue
> > HKEY_CURRENT_USER,p_PSTGuid,r_PSTGuidLocation,P_PSTGuildValue
> > For Each y In P_PSTGuildValue
> > If Len(Hex(y)) = 1 Then
> > PSTlocation = PSTlocation & CInt("0") & Hex(y)
> > Else
> > PSTlocation = PSTlocation & Hex(y)
> > End If
> > Next
> > End Function
> > '__________________________________________________________________________­___________________________________________________
> > Function PSTFileName(p_PSTGuid)
> > Dim z, P_PSTName
> > Dim strString : strString = ""
> > oReg.GetBinaryValue HKEY_CURRENT_USER,p_PSTGuid,r_PSTFile,P_PSTName
> > For Each z in P_PSTName
> > If z > 0 Then strString = strString & Chr(z)
> > Next
> > PSTFileName = strString
> > End Function
> > '__________________________________________________________________________­_______________________________
> > Function ExpandEvnVariable(ExpandThis)
> > Dim objWSHShell :Set objWSHShell = CreateObject("WScript.Shell")
> > ExpandEvnVariable = objWSHShell.ExpandEnvironmentStrings("%" &
> > ExpandThis & "%")
> > End Function
> > '__________________________________________________________________________­_______________________________
>
> > and it DOES tell me all the PST i have active, but i dont know how to
> > do the rest.. We dont use exchange, so we use the dreaded local PST
> > files and a good amount of my time is being used up baby sitting
> > users.
>
> > Thanks for the help in advance.
>
> This is a fairly complex script you wrote. Would it not be simpler
> to search the "Documents and Settings" folder for recent .PST
> files and to send an EMail to yourself and the user if any of them
> are above a certain size?- Hide quoted text -
>
> - Show quoted text -

Actually, as i said i didnt right the script, i found it, and it
almost does what i need. The problem is, i dont think all the users
have them on there my documents, some might have it in there home dir
(x).. Thanks for the quick response

===========

Another very simple solution would be to extrac all entries from
the HKey_Users hive and screen it for data that contains ".PST"
and ":". A few lines of code would identify all .PST files.



Re: Help needed... VBScript to determine ALL pst files from users by billy

billy
Mon Feb 04 21:45:20 CST 2008

i'm not testing this on a computer that has outlook installed, so
forgive me if my assumptions are incorrect.
i think that the PSTlocation function returns the full path to the
outlook pst? if so ....

replace your echo command -
Wscript.Echo PSTFileName(r_ProfilesRoot & "\" & p_profileName & "\"
& _
PSTlocation(r_ProfilesRoot & "\" & p_profileName & "\" &
strPSTGuid))

with a conditional echo.
strPSTlocation = PSTlocation(r_ProfilesRoot & "\" & p_profileName &
"\" & strPSTGuid)
Set objFile = objFSO.GetFile(strPSTlocation)
If objFile.Size > [your value here] Then Wscript.Echo
PSTFileName(r_ProfilesRoot & _
"\" & p_profileName & "\" & strPSTlocation) & " is too darn
big!!!"

of course you will need to instance objFSO and dim the vars. (i almost
never use Option Explicit).


Re: Help needed... VBScript to determine ALL pst files from users profile by Pegasus

Pegasus
Tue Feb 05 01:34:44 CST 2008


"billy" <wcasse@yahoo.com> wrote in message
news:90b5f1c5-a0ff-42ef-853c-e7df2026949c@u10g2000prn.googlegroups.com...
> i'm not testing this on a computer that has outlook installed, so
> forgive me if my assumptions are incorrect.
> i think that the PSTlocation function returns the full path to the
> outlook pst? if so ....
>
> replace your echo command -
> Wscript.Echo PSTFileName(r_ProfilesRoot & "\" & p_profileName & "\"
> & _
> PSTlocation(r_ProfilesRoot & "\" & p_profileName & "\" &
> strPSTGuid))
>
> with a conditional echo.
> strPSTlocation = PSTlocation(r_ProfilesRoot & "\" & p_profileName &
> "\" & strPSTGuid)
> Set objFile = objFSO.GetFile(strPSTlocation)
> If objFile.Size > [your value here] Then Wscript.Echo
> PSTFileName(r_ProfilesRoot & _
> "\" & p_profileName & "\" & strPSTlocation) & " is too darn
> big!!!"
>
> of course you will need to instance objFSO and dim the vars. (i almost
> never use Option Explicit).
>

Who ae you replying to?



Re: Help needed... VBScript to determine ALL pst files from users by billy

billy
Fri Feb 08 19:53:43 CST 2008

On Feb 5, 2:34 am, "Pegasus \(MVP\)" <I....@fly.com.oz> wrote:
> "billy" <wca...@yahoo.com> wrote in message
>
> news:90b5f1c5-a0ff-42ef-853c-e7df2026949c@u10g2000prn.googlegroups.com...
>
>
>
> > i'm not testing this on a computer that has outlook installed, so
> > forgive me if my assumptions are incorrect.
> > i think that the PSTlocation function returns the full path to the
> > outlook pst? if so ....
>
> > replace your echo command -
> > Wscript.Echo PSTFileName(r_ProfilesRoot & "\" & p_profileName & "\"
> > & _
> > PSTlocation(r_ProfilesRoot & "\" & p_profileName & "\" &
> > strPSTGuid))
>
> > with a conditional echo.
> > strPSTlocation = PSTlocation(r_ProfilesRoot & "\" & p_profileName &
> > "\" & strPSTGuid)
> > Set objFile = objFSO.GetFile(strPSTlocation)
> > If objFile.Size > [your value here] Then Wscript.Echo
> > PSTFileName(r_ProfilesRoot & _
> > "\" & p_profileName & "\" & strPSTlocation) & " is too darn
> > big!!!"
>
> > of course you will need to instance objFSO and dim the vars. (i almost
> > never use Option Explicit).
>
> Who ae you replying to?

sorry, i was replying to the original question ...

[quote]
I am looking for a script that will search the registry and display
all the current .pst files for a user, and then check the file size...
If it is over a certain value email a warning to a administrator and
the user...
[code that reads the registry for pst files and displays them/]
and it DOES tell me all the PST i have active, but i dont know how to
do the rest.. We dont use exchange, so we use the dreaded local PST
files and a good amount of my time is being used up baby sitting
users.
[/quote]

the changes that i suggested might help Jeff write the code himself.