Question : A script to return user information

Hello,
I'm looking for a script that I will email to users and when they click on it it will send me an email with the following information (in excell or plain email  either way)

1. User FIrst and Last name
2. windows Logon Name
3. connected Printers (name and path)
4. outlook PST file name and (location) if possilble
5. computer model #  ( example . Dell D430 )

Thank You

Answer : A script to return user information

Hi, I have added the computer name, but it's difficult to find out where the PST file is stored.  It's an obfuscated binary value in the registry.

As far as the default locations go, however, if you look here:
http://office.microsoft.com/en-us/outlook-help/using-the-microsoft-outlook-personal-folders-backup-tool-HA001087532.aspx

under the "Where .pst files are stored" heading, you will find the default location for each Operating System.

Regards,

Rob.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
Set objNetwork = CreateObject("WScript.Network")
Set objADSysInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSysInfo.UserName)
' Email variables:
strServer = "mailhost.abc.com"
strTo = "[email protected]"
strFrom = "[email protected]"
strSubject = "Subject Here"
strBody = "Name: " & objUser.givenName & " " & objUser.sn & VbCrLf & _
	"Logon Name: " & objUser.samAccountName & VbCrLf & VbCrLf & "Printers: "

Set objPrinters = objNetwork.EnumPrinterConnections
For intPrinter = 0 To objPrinters.Count - 1 Step 2
	strBody = strBody & VbCrLf & objPrinters(intPrinter) & vbTab & objPrinters(intPrinter + 1)
Next

strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
Set colComputer = objWMIService.ExecQuery("Select Manufacturer,Model From Win32_ComputerSystem")
For Each objComputer In colComputer
	strManufacturer = "Manufacturer: " & objComputer.Manufacturer
    strModel = "Model: " & objComputer.Model
Next
strBody = strBody & VbCrLf & VbCrLf & "Computer Name: " & objNetwork.ComputerName & VbCrLf & "Computer Model: " & strModel

SendEmail strServer, strTo, strFrom, strSubject, strBody

MsgBox "Email has been sent."

Sub SendEmail(strServer, strTo, strFrom, strSubject, strBody)
        Dim objMessage
        
        Set objMessage = CreateObject("CDO.Message")
        objMessage.To = strTo
        objMessage.From = strFrom
        objMessage.Subject = strSubject
        objMessage.TextBody = strBody
 
        '==This section provides the configuration information for the remote SMTP server.
        objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        'Name or IP of Remote SMTP Server
        objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strServer
        'Server port (typically 25)
        objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25      
        objMessage.Configuration.Fields.Update
        '==End remote SMTP server configuration section==
 
        objMessage.Send
        Set objMessage = Nothing
End Sub
Random Solutions  
 
programming4us programming4us