I’m in the process of piloting the DudeWorks/1E/Shaun Cassells SMS SCCM Client Health script. I’ve set it up so it runs in the user’s logon script. But there’s a bug with that.
- User FRED is the CONTOSO domain
- User FRED logons onto a computer which is part of the TOLERDO domain.
- SMS Client Health script tries to repair the TOLERDO domain computer
(not a good thing).
Update the script to check to see if the user is logging onto a computer in their own domain. The scripts changes were:
- CONFIG Settings section
- In the START section, just after the Create Log file call
' Check Domain to ensure a CONTOSO user isn't logging onto a TOLERDO PC.
- And finally, added this subroutine:
If InStr(objSysInfo.ComputerName, LCase(sThisDomain)) = 0 Then
COLLECTMSG "Sub_Check_Domain","","A " + sThisDomain + " user has logged onto a non " + sThisDomain + " PC"
COLLECTMSG "Sub_Check_Domain","","objSysInfo.ComputerName is set to: " + objSysInfo.ComputerName
CLIENTSTATE = 99
StrERRType = StrERRType & "WRONG_Domain_"
COLLECTMSG "Sub_Check_Domain","","PC is in domain:" + sThisDomain