cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
taeratrin
Champion Sweeper
Not really a custom action, but I've created a deployment tool that scans the specificied domain for computers, creates a c:\temp folder, copies the lsclient to that folder, and executes it. It lists the computers with checkboxes, so you can select multiple computers (as well as buttons that let you select all and clear all).

If anyone is interested in this tool, let me know and I'll clean up the code (some of it is hard-coded) and upload it. It requires the latest .Net framework and psexec.exe


Edit : lastest version attached below.
32 REPLIES 32
taeratrin
Champion Sweeper
OK, as promised, a new version has been finished. The following has been changed :

1) It marks which ones completed successfully (strikeout) and which ones didn't (bold)
2) These will be persistent if you check the box on the options page
3) They can be reset by pressing the 'Clear Lists' button
4) A timer has been added. The interval (in hours) can be set through the options page. It will only cycle through the computers you have checked.
5) No more batch file. While this may seem good at first, I had to resort to copying the lsclient.exe to the Windows folder of the remote machine.
6) Be sure that the LSClient Path in Options points to a network share accessable by all computers. (should be in the form of '\\server\share')

There are still some places where error-checking/validation does not exist, but as long as you don't do anything weird with the config, everything should be fine.

Please report any bugs you encounter.

NOTE : Another buggy attachment. Please see below for real file.

taeratrin
Champion Sweeper
OK, I don't know how much luck I'll have getting an answer for this here, but here it goes :

I'm working on eliminating the batch file altogether, but am running into an "Access Denied" error when the invoke is called. WMI testing programs tell me everything should be fine. Here is the code :

Private Sub ExecuteFile(ByVal comp As ListViewItem)
Dim wmi As ManagementClass
Dim wmi_in, wmi_out As ManagementBaseObject
Dim retValue As Integer

Try
wmi = New ManagementClass("\\" & comp.Text & "\root\cimv2:Win32_Process")
' get the parameters to the Create method
wmi_in = wmi.GetMethodParameters("Create")
' fill in the command line plus any command-line arguments
' NOTE: the command can NOT be on a network resource!
wmi_in("CommandLine") = """" & My.Settings.ClientPath & "\lsclient.exe"" " & My.Settings.LSServer
' do it!
wmi_out = wmi.InvokeMethod("Create", wmi_in, Nothin)
' get the return code. This not the return code of the
' application... it's a return code for the WMI method
retValue = Convert.ToInt32(wmi_out("returnValue"))
Select Case retValue
Case 0
' success!
CompFinishedList.Add(comp)
Case 2
Throw New ApplicationException("Access denied")
Case 3
Throw New ApplicationException("Insufficient privilege")
Case 8
Throw New ApplicationException("Unknown failure")
Case 9
Throw New ApplicationException("Path not found")
Case 21
Throw New ApplicationException("Invalid parameter")
Case Else
Throw New ApplicationException("Unknown return code " & retValue)
End Select
Catch ex As ApplicationException
If Not CompErrorList.Contains(comp) Then
CompErrorList.Add(comp)
End If
MsgBox(ex.Message)
End Try

End Sub


I've also been running into this error when executing the batch file lately, but it isn't WMI that returns the error, just the following line in the .bat :
\\Path\To\Client\lsclient.exe server
Running the command from a prompt works fine, even as a regular user, but from the batch it fails every time. Except, of course, on my machine, as well as a test server I have sitting next to me.

Anyone have any ideas?


EDIT : The WMI error code is 2147217407. Searching Google for info now.

EDIT : Nevermind. Resolved.
taeratrin
Champion Sweeper
OK, I've gone back and looked at the code, and have found the error-checking to be a complete mess. It was working properly, but for testing I made it pop-up with a messagebox. I've fixed this, and am working on a way to store which computers it's been deployed to, and which it wasn't able to contact. This will be indicated visually by making the computer name in the listview either strike-out or bold (respectively), and will be persistent between runs.

I'm also going to look into creating that timer I mentioned in the previous post. I'll make it optional, probably a button you can turn on and off.

If you have any requested features, please feel free to list them here. I'll post the next version as soon as it's ready.
taeratrin
Champion Sweeper
1) I haven't really been working on this project lately, since it's easier to deploy through group policy (put it in the logon script for users), but I'll look into a way of doing this.

2) The program already has error checking for this. I'll go back and review it to make sure it's working properly. If you can send me any details of the error you're receiving, it'd be helpful.

3) This was designed to run lsclient only once, for testing your clients and troubleshooting connection errors. I suppose I could implement some sort of timer, which would emulate active scanning. I'll look into this.
Christopher_Bel
Engaged Sweeper
This is a good tool .. I would like to request some kind of notice whether it was able to copy the file or not. Also, I have ran into error when a pc is not online it crashes the program. Is there a way to add to it to test to see if the computer is online first before it copies the file.

Once the file is copy I thought about running a batch file to run it on startup. How did you run yours once it was deployed to all computer? Please let me know.
misgci
Engaged Sweeper
Arrrgh. Nevermind.

I put in the fully qualified domain name (domain.local) and the full name for the LS server (LSserver.Domain.local) and it worked.
misgci
Engaged Sweeper
Any idea what would cause this? I have .Net 3.5 SP1 installed.

System.Runtime.InteropServices.COMException(Ox8007203A): The Server is not operational.

at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
at System.DirectoryServices.DirectoryEntry.Bind()
at System.DirectoryServices.DirectoryEntry.get_AdsObject()
at System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne)
at System.DirectoryServices.DirectorySearcher.FindAll()
at LSClient_Deploy.Form1.GetComputerNames(String DomainString) in C:\Documents and Settings\alexanderdav\My Documents\Visual Studio 2008\Projects\LSClient Deploy\LSClient Deploy\Form1.vb:line 58


In the config dialog I have

DomainName
LSServerName
c:\LSclient

I copied lsclient.exe into c:\LSclient on the machine from which I am running the deployment tool.

Thanks.
taeratrin
Champion Sweeper
I was thinking either that or it's marked as read-only (Windows XP will do that to things copied to the C drive). Either way is simple to solve, just don't have the time right now for testing.
Anonymous
Not applicable
Maybe the process is still running when you try to erase the file. Do you monitor if the process finnishes?
taeratrin
Champion Sweeper
Made some more changes. It now no longer requires the use of psexec. It will, however, copy the lsclient to the C drive of the remote computer (for some odd reason it's not letting me delete it after it's done).

EDIT : New version on the next page