neonetman Posted November 2, 2017 Posted November 2, 2017 I'm wanting to silently call a PHP script on an internal webserver from each PC as it logs on, and then a different script at logoff. I'm wondering if there's a way to call these using GPO's? Can anyone advise?
ChrisMiles Posted November 2, 2017 Posted November 2, 2017 Well you can configure a PowerShell logon script and call the website in that: Invoke-WebRequest -Uri https://www.google.com -UseBasicParsing Or use a command line tool in a similar way.
Blue_Cookeh Posted November 2, 2017 Posted November 2, 2017 If the computers have php installed and the install location in the system PATH variable, you can simply run 'php c:\path\to\script.php' in a batch file or whatever. Should be pretty simple to do.
PyROm Posted November 6, 2017 Posted November 6, 2017 Another way to fetch a webpage, using vbs (in case you already use vbs login/logoff scripts) http.open "GET", "http://", FALSE http.send ""
ReadTheNetwork Posted November 7, 2017 Posted November 7, 2017 What is the script doing? Maybe there's another method which doesn't involve calling a php page?
neonetman Posted November 9, 2017 Author Posted November 9, 2017 Uses NTLM authentication to identify the pc name and username and then logs those to a MySQL database to give us a quick overview of PC usage and who's logged in where. Staff can then access a page on our intranet showing a list of free PCs
PyROm Posted November 9, 2017 Posted November 9, 2017 You will probably want to also run your script for user logout on computer startup, in case someone hits reset rather than logging out. Maybe even a scheduled ping to catch any that have just been turned off as well.
ReadTheNetwork Posted November 9, 2017 Posted November 9, 2017 Would it be easier to do it through Powershell for the login/logout script? It could input the required information and the teaching staff are still able to access this info through a PHP page? Might be more work to write the Powershell script though.
neonetman Posted November 9, 2017 Author Posted November 9, 2017 I've 3 scripts in total - login, logout, and "startup" which adds the PC to the database if it doesn't exist, and clears any remaining logins at startup
chris_uk Posted November 9, 2017 Posted November 9, 2017 Why not just have it wget in the background? if you did wget http://servername/computername=%computername%&username=%username%&action=login (or logout) You will obviously need to amend your php script.
ReadTheNetwork Posted November 9, 2017 Posted November 9, 2017 Windows PC`s dont have wget...... Not by default
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now