cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Champ14
Engaged Sweeper II
Hi,

I need your help regarding the logon vbscript for LANSweeper, I have followed this KB: https://www.lansweeper.com/kb/282/how-to-scan-windows-computers-with-the-lspush-scanning-agent-in-a-group-policy.html, but still the client is not reporting back to our server. I can do a test connection from the client and it is successful. I've tried to wait and run gpupdate /force over and over but still with no effect. Been struggling for a week now.

Here's my logon script:
--------------------------------------------------------------
Set WshShell = CreateObject("Wscript.Shell")
WshShell.run "\\Main-DC01\NETLOGON\LsPush.exe Lansweeper-svr",0
---------------------------------------------------------------

Other GPO's are running fine.


Thanks!
1 ACCEPTED SOLUTION
tbal
Engaged Sweeper II
Personally we aren't using this I have setup a scheduled task instead because VPN won't be connected when they logon.

But I would use %logonserver% instead of main-dc01 as it goes towards the DC you login to.

I would check event viewer for any errors, do you have any other logon scripts running? Does the computers have connection to the DC when logging in?

Check gpresult /r as admin to see so the GPO is applied.

What happens if you run the vb script manually?

View solution in original post

6 REPLIES 6
Champ14
Engaged Sweeper II
Hi,

I managed to make it work by using Scheduled Task GPO as suggested by Benyoung, though not sure why the Logon GPO been posted in LANsweeper site is not working.

Anyway, I'l stick with this solution. 🙂

Thanks for all your responses!!
Esben_D
Lansweeper Employee
Lansweeper Employee
Let us know if using %logonserver% instead of main-dc01 did anything.

When you say it runs perfectly when you execute it locally, does it send the data to Lansweeper import folder?

Also, I'm not sure what version you are using. But I would recommend updating to the latest version and trying with the latest lspush.exe version which will be in the Program Files (x86)\Lansweeper\Client folder after updating.
Esben_D
Lansweeper Employee
Lansweeper Employee
To test the logonscript, you can open CommandPrompt on a client machine you want to scan with the command below. Again, make sure that you replace the LansweeperServer with the name of your Lansweeper scanning server, or the IP address of that scannig server. The command will trigger a local scan and will send the scan results directly to your Lansweeper server for import. The /showresult parameter will also provide you with visual feedback.

"%logonserver%\netlogon\LsPush.exe" LansweeperServer /showresult

As tbal mentioned, you can also run the vbs script locally to test it.
Champ14
Engaged Sweeper II
Charles.X wrote:
To test the logonscript, you can open CommandPrompt on a client machine you want to scan with the command below. Again, make sure that you replace the LansweeperServer with the name of your Lansweeper scanning server, or the IP address of that scannig server. The command will trigger a local scan and will send the scan results directly to your Lansweeper server for import. The /showresult parameter will also provide you with visual feedback.

"%logonserver%\netlogon\LsPush.exe" LansweeperServer /showresult

As tbal mentioned, you can also run the vbs script locally to test it.




Hi Charles,

As mentioned from my post, I already tested the script and it is working fine if run manually. All the settings are correct as the machine responded back if runs manually.
tbal
Engaged Sweeper II
Personally we aren't using this I have setup a scheduled task instead because VPN won't be connected when they logon.

But I would use %logonserver% instead of main-dc01 as it goes towards the DC you login to.

I would check event viewer for any errors, do you have any other logon scripts running? Does the computers have connection to the DC when logging in?

Check gpresult /r as admin to see so the GPO is applied.

What happens if you run the vb script manually?
Champ14
Engaged Sweeper II
tbal wrote:
Personally we aren't using this I have setup a scheduled task instead because VPN won't be connected when they logon.

But I would use %logonserver% instead of main-dc01 as it goes towards the DC you login to.

I would check event viewer for any errors, do you have any other logon scripts running? Does the computers have connection to the DC when logging in?

Check gpresult /r as admin to see so the GPO is applied.

What happens if you run the vb script manually?




But I would use %logonserver% instead of main-dc01 as it goes towards the DC you login to.
--->> Il try this. But the script runs perfectly if run manually

I would check event viewer for any errors, do you have any other logon scripts running? Does the computers have connection to the DC when logging in?
--->> No erros from event viewer from our DC, it is replicating as well. Yes we have other Log-In scripts running, but it is under another GPO Object. Yes, the machine has connection to the DC when logging in as it is wired connected, but some machines are using DIrect Access VPN.

Check gpresult /r as admin to see so the GPO is applied.
---->> GPO not being applied, it's not in the list, not even on the rejected list. Nothing happens, Tested with another GPO and it is applying but not sure why this GPO doesnt.

What happens if you run the vb script manually?
--->> As per my post, it works fine if run manually. It is reporting back to server