We have a major upgrade to a software application that we need to push some software out using a Group Policy. The problem is that we have several users that do not shut their computers down and we'd like to be able to do it remotely.
I have started a script that uses the UDF's NetView2, Ping, and ComputerInGroup. I've used NetView2 & Ping in the past to successfully stop and start the Trend Micro listening service on any computer that was on the domain and was powered on. I can modify that script to shutdown all computers but I need to be able to shutdown everything but the servers.
Which is where the ComputerInGroup comes into play. The problem I'm having is that I don't fully understand how I would add this into the script to only shutdown computers that ping and are not in the group.
So my thought was this:
Code:
FOR EACH $Computer In NetView2(@ldomain)
IF $Computer
IF PING($Computer,0) AND ComputerInGROUP('SERVERS') = 0
SHUTDOWN ($Computer,"Your Computer is being shutdown to install an application", 45, FORCE)
ENDIF
ENDIF
NEXT
Exit
Unfortunately this did not work as I thought it would so any quidence would be appreciated. I've used different parts of the code seperatly successfully but when I try to get them together in one script it's not so great, I ended up shutting down everything in my test domain.
Thanks in advance - JTT