Jump to content
screwloose

Extract Email Account Details

Recommended Posts

Hey Guys,

 

Here is my first (of Many) script!

It uses MailPassView to get the email account information from the local computers.

 

I'm not sure how to package these up so if there are any problems just let me know! :)

 

erdn.png

Labtech-Email.zip

Share this post


Link to post
Share on other sites

This looks useful for quickly troubleshooting email settings, thanks for sharing!

 

Would you mind posting screenshots of your script? It won't import on my system for some reason, maybe because I'm running v51.159 and I see the script was exported from v60.239.

Share this post


Link to post
Share on other sites
This looks useful for quickly troubleshooting email settings, thanks for sharing!

 

Would you mind posting screenshots of your script? It won't import on my system for some reason, maybe because I'm running v51.159 and I see the script was exported from v60.239.

 

You can edit the .XML files and change Version="60.239" to Version="1".

After that you should be able to import the scripts.

Share this post


Link to post
Share on other sites

I get nothing when trying this out. Tab looks good script loooks good except for I get "VBScript completed. Formatted Mail data is: C:\Windows\LTSvc\scripts\Email_Details.vbs(28, 3) Microsoft VBScript runtime error: Invalid procedure call or argument: 'left'" in the scripts tab when running to extract." Any clue why that would be?

Share this post


Link to post
Share on other sites

Hi Screwloose,

 

Really like what you've done, the demo looks great!

 

However I've downloaded the ZIP, however there is .SQL file in there and not sure where to place this.

 

Also the script calls for these files, which are not in your ZIP

Mail_Details.vbs

mailpv.exe

 

Also guessing there is a .dll to go with it, as your screenshot shows a tab?

 

Could you please post these as I'm keen to try this out

 

THANKS

Share this post


Link to post
Share on other sites

Hey sjones,

 

Import the .sql file into your database.

This was the first 'plugin' I made so wasn't aware of EDF's at the time.

 

As for the .vbs file, I feel kind of silly leaving this out.

Here is the code:

Set fso = CreateObject("Scripting.FileSystemObject")
Set ws = CreateObject("WScript.Shell")
dim oExec

set oExec = ws.exec(ws.ExpandEnvironmentStrings("%windir%") & "\LTSVC\scripts\mailpv.exe /scomma " & ws.ExpandEnvironmentStrings("%windir%") & "\temp\email.csv")
for x = 1 to 120
 WScript.Sleep(1000)
 if oExec.Status = 1 then exit for
next

oExec.Terminate()

OutPut=""

if fso.fileexists(ws.ExpandEnvironmentStrings("%windir%") & "\temp\email.csv") then
 set f = fso.OpenTextFile(ws.ExpandEnvironmentStrings("%windir%") & "\temp\email.csv", 1)
 do while not f.atendofstream
   temp =  f.ReadLine()
   dim t
   t = split(temp,",")
   OutPut = OutPut & "(%clientid%,'" & t(0) & "','" &  t(1) & "','" &  t(2) & "','" & t(3) & "','" &  t(4) & "','" &  t(5) & "','" &  t(6) & "','" &  t(7) & "','" &  t(8) & "','" &  t(9) & "','" &  t(10) & "','" &  t(11) & "','" &  t(12) & "',@computerid@),"
 loop
 f.close
 fso.deletefile ws.ExpandEnvironmentStrings("%windir%") & "\temp\email.csv",true
 wscript.echo left(OutPut,len(output)-1)
end if

 

There is no DLL as it uses the Custom Tabs plugin.

Install it, then go into the custom tab config and import the files in the zip and it should show up.

Share this post


Link to post
Share on other sites

screwloose,

 

I was able to figure out the issue with the script location and download the file from NirSoft.net, tab shows up fine, etc (the command on the tab will need to be updated to the correct script ID after import).

 

The issue I have is when I run this against my client machines, I receive the following error everytime: Process completed. Formatted Mail data is: The system cannot find the path specified.

 

I've reviewed the script and have not been able to identify why it fails. Ideas?

 

Thanks.

 

-jeff

Share this post


Link to post
Share on other sites

I've got this running the script correctly now, however it is not updating the information in the tab. It does show all the details in the output of the script results. I'm thinking this is because I've not create a table for email_details. I'll test and confirm later. Thanks.

 

-jeff

Share this post


Link to post
Share on other sites

screwloose,

 

I have this fully functional now. I did have to manually create the MySQL table and define fields as well. Perhaps we can ask Greg if there is a better way to export a custom tab that will incorporate all of these custom features. I'll try to create an implementation process for this so others can follow and post later this week when time permits. Thanks.

 

-jeff

Share this post


Link to post
Share on other sites

The way to export tabs and all the tables that go with it is to make a plugin with the plugin creator. It will let you define tables and other items and it will convert a tab to code.

Share this post


Link to post
Share on other sites

I have scripts working fine, but don't know how to create the Tab which is displayed on the top of this post.

screwloose can you please send DLL file so the plugin can be included to get the tab on computer screen.

 

-Harpal Singh

Harpal@SankalpIT.com

Share this post


Link to post
Share on other sites

mcclain.tim: Should get IMAP accounts also. It returns what ever is picked up by mailpassview.

 

harpal: You need to install the custom tabs plugin then import this tab.

Share this post


Link to post
Share on other sites

Screwloose,

 

I have had this working for some time now and just realized something interesting yesterday that has me puzzled. We have defined the fields as:

 

Name,Application,Email,Server,ServerPort,Secured,Type,User,Password,Profile,PasswordStrength,SMTPServer,SMTPServerPort

 

The VB Script runs properly and the information is populated in the table correctly in the database based on the above named fields:

 

Name,Application,Email,Server,ServerPort,Secured,Type,User,Password,Profile,PasswordStrength,SMTPServer,SMTPServerPort

 

The custom tab is Data List with the following SQL Query: SELECT DISTINCT Name,Application,Email,Server,ServerPort,Secured,Type,User,Password,Profile,PasswordStrength,SMTPServer,SMTPServerPort FROM plugin_msp_email_details WHERE ComputerID=%computerid%

 

The problem is the field "Name" does not show up in the view of the custom tab for either Computers or Clients though the SQL Query is calling it.

 

I have the exact same problem on a similar tool, script, tab.

 

Any ideas why the Name would not be displayed in the custom tab if the data is in the table and we are calling the data to be displayed? Thanks.

 

-jeff

Share this post


Link to post
Share on other sites
Hey Guys,

 

Here is my first (of Many) script!

It uses MailPassView to get the email account information from the local computers.

 

I'm not sure how to package these up so if there are any problems just let me know! :)

 

erdn.png

 

Anyway we can export the email accounts for a client to a excel sheet?

Share this post


Link to post
Share on other sites

 

Any ideas why the Name would not be displayed in the custom tab if the data is in the table and we are calling the data to be displayed? Thanks.

 

-jeff

 

I fixed this by adding ID to the start of the SQL Query (under Email tab in Custom Tabs).

 

Mine looks like this:

 

SELECT ID,Name,Application,Email,Server,ServerPort,Secured,Type,User,Password,Profile,PasswordStrength,SMTPServer,SMTPServerPort FROM email_details WHERE ComputerID=%computerid%

Share this post


Link to post
Share on other sites

Can anyone tell me what I did wrong here, im getting this error returned from the vbscript, "Output: C:\windows\LTSvc\scripts\Email_Details.vbs(25, 3) Microsoft VBScript runtime error: Invalid procedure call or argument: 'left'" I've double checked and I believe I have copied the vbs code above correctly.

 

Nevermind, I didnt realize the script would error out like that on exchange account machines. Wow and I just now realized that someone else had already asked the same question in this thread even though I read it like 3 times :oops: , I gotta start getting more sleep!

Share this post


Link to post
Share on other sites

Works great for me, any way to export the client view to a excel spreadsheet? Guessing a command could be entered from custom tabs but not sure what would do that.

Share this post


Link to post
Share on other sites

As of Sept this year this is now broken as no Command line ags are taken and it will not export to CSV file.

 

 

17/09/2014 1.82

Removed the command-line options that export the passwords to a file from the official version. A version of this tool with full command-line support will be posted on separated Web page

Share this post


Link to post
Share on other sites

Not to take over anyone's projects or threads,

 

We just took this idea and turbo charged it by creating a new plugin that not only gets email passwords and accounts but Web user and passes, Network and dial up accounts and Instant Messenger account info all in one package. We spoke with Nirsoft and have received up to date Apps that will continue to export to a file so we are able to keep this project moving forward.. I borrowed example script from ScrewLoose Thanks for getting it started..

 

http://www.squidworks.net/2014/12/passport-password-manager-plugin-for-labtech/

 

website-view.jpg

 

 

Enjoy

 

Cubert :ugeek:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×