myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Client Health Script

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Client Health Script Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
Client Health Script - 2/21/2007 5:57:49 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
If you haven't seen the daily myITforum email or watched the threads closely, you might have missed that Rob got our startup script posted here: http://myitforum.com/cs2/files/folders/99288/download.aspx

This baby takes care of all the big problems we've seen in production like getting msxml registered, forcing the client back to enabled from disabled status, getting WBEM back in the path statement, etc.  It has gained us thousands of clients that would have taken forever to clean up manually.  The idea is that you create a GPO with this as a startup script and link OU's to it where you want SMS.  It also has logging so you can find machines who run this every day without success.  Edit the script with your info (servers and such), link an OU to test, when you're happy, link the GPO as high as you can, or whatever works for you.  Don't use a logon script; make sure it's a startup script.

You can consider it a client install script and client health script in one.


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/
Post #: 1
RE: Client Health Script - 2/22/2007 8:20:24 AM   
Tom_Watson

 

Posts: 107
Score: 7
Joined: 9/13/2006
Status: offline
I had a quick look at this, and it looks impressive.

One little question I had.  Can it be run outside of a GPO startup script?  i.e. if I run it manually on a client with an account that has admin rights, will it produce similiar results?

Regards,
Tom Watson

(in reply to bmason505)
Post #: 2
RE: Client Health Script - 2/22/2007 10:18:02 AM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
That would work too since that's how we test it before putting it on a test OU.  But logging to a server share (sent only if there was a problem the script had to fix) would go up under your ID not the machine acct.

_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to Tom_Watson)
Post #: 3
RE: Client Health Script - 2/22/2007 3:36:05 PM   
cmonfet

 

Posts: 22
Score: 0
Joined: 12/1/2005
Status: offline
we have just started running this in our test environment and we ran into a problem Mcafee blocks the email portion.  it sees wscript.exe trying to send email.  how is everyone else getting around this?

(in reply to bmason505)
Post #: 4
RE: Client Health Script - 2/22/2007 4:36:41 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Symantec AV runs on ours and we don't have the problem.  If it gave us a problem, I'd set an exception to let it go ahead.  Is there a Mcafee equivalent?

_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to cmonfet)
Post #: 5
RE: Client Health Script - 2/22/2007 4:39:03 PM   
cmonfet

 

Posts: 22
Score: 0
Joined: 12/1/2005
Status: offline
our mcafee block the smtp connection to prevent mass mailers.  it is picking up wscript.exe as the process, so we cannot exclude that process. 
:(

(in reply to bmason505)
Post #: 6
RE: Client Health Script - 2/22/2007 4:56:08 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Wait a sec.  We don't try to mail anything.  We just run a script which copies files, but no email.

_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to cmonfet)
Post #: 7
RE: Client Health Script - 2/22/2007 4:57:21 PM   
cmonfet

 

Posts: 22
Score: 0
Joined: 12/1/2005
Status: offline
im using the 1e script.  it will email you when a service fails or the wmi repair fails etc..  we are going to send them to someone who will check on the clients and repair them if something cannot be fixed automatically.  if we cant get it to work, it it not a huge deal, but it would be nice 

(in reply to bmason505)
Post #: 8
RE: Client Health Script - 2/22/2007 4:58:26 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Oh.  Use our script.  It's better!  Use the link above.

_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to cmonfet)
Post #: 9
RE: Client Health Script - 2/22/2007 5:01:54 PM   
cmonfet

 

Posts: 22
Score: 0
Joined: 12/1/2005
Status: offline
ohhh  thats nice.   thanks!   definitely what we were looking for.

(in reply to bmason505)
Post #: 10
RE: Client Health Script - 2/26/2007 6:50:26 AM   
jmcleish

 

Posts: 491
Score: 13
Joined: 11/8/2002
Status: offline
Brian,
Been testing your script- looks great, but i wanted to ask a couple of questions.
I took those clients that the client health tools reported as being unhealthy and added them to my test GPO.
I enabled both good and bad logging to test it, however, i have no log files for the bad ones. The date and AD site name is created, but no log files. There are good log files though. Any ideas as to why this may be happening?

Also, currently i'm using someones nice client health stratup script that runs ccmsetup from the GPO (so as not to bombard the site server running ccmsetup continually).
I'm not a vb person and would like to know what part of the script to change to initiate ccmsetup from the same dir.
my current script includes this bit:
If ClientInstalledAndAuto("") = False Then
Dim oExec, strCmdLine
strCmdLine = ScriptDir & "\Ccmsetup.exe /service SMSSITECODE=AUTO SMSCACHESIZE=800 DISABLESITEOPT=TRUE DISABLECACHEOPT=TRUE"
lngExitCode = WshShell.Run(strCmdLine, 0, True)
WshShell.LogEvent 0, "Started SMS Advanced Client Install" & CHR(10) & "Exit code was " & CSTR(lngExitCode)
Else
'WshShell.LogEvent 0, "SMS Advanced Client service (ccmexec) is installed and set to Automatic.  No action required."
End If

I'd be most grateful if you could help me  with this.
Many thanks
 
Jane

(in reply to cmonfet)
Post #: 11
RE: Client Health Script - 2/26/2007 10:55:38 AM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Hi Jane.  The script should always leave a log in the windows temp folder, good or bad.  If a client were unable to copy that log to a server share I wouldn suspect that the share is not set to everyone full and NTFS allowing write for domain computers, or I'd suspect the machine acct to be bad (reset acct or rejoin the domain).

In your script - ScriptDir is where ccmsetup is being run from because that is where it is parked.  Note that if you get our script going, you could forgo the need for this script & GPO.


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to jmcleish)
Post #: 12
RE: Client Health Script - 2/26/2007 11:22:02 AM   
jmcleish

 

Posts: 491
Score: 13
Joined: 11/8/2002
Status: offline
Thanks- I'll have  a look on the bad comps for the log- although the permissions is set to domain computers to modify on that dir- which trickles down to both the good and the bad folder.

Currently i have the script i mentioned and ccmsetup and client.msi in a GPO folder. The gpo startup script initaites the ccmsetup from the gpo rather than the site server. Since we have more DC's it seems better load balancing to run it from there.
I have full intention of using your excellent script, but i want to modify it so that it initiates ccmsetup from the scriptdir (from the gp dir on dcs) and not the site server.

Thing is i don't know VB and was hoping you would tell me what bit to change so i could do this.

Thanks

Jane

(in reply to bmason505)
Post #: 13
RE: Client Health Script - 2/26/2007 12:07:10 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
If the perms are good to the share, it could be the client's machine acct is stale - you might have to have it rejoin the domain so it can set and sync a new password.  Then it can use that acct to park - but if that is the problem, SMS would probably start working too.

As far as the other script goes, see what is setting the ScriptDir value and copy that too.  Probably set near the top of the script.


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to jmcleish)
Post #: 14
RE: Client Health Script - 2/26/2007 12:43:22 PM   
scassells

 

Posts: 9
Score: 0
Joined: 4/1/2004
Status: offline
As a suggestion.  Add a method to your script that does a HTTP post to a website
Create a website that takes the parameters and posts them to a SQL database (website holds password to SQL so more secure)
that way you can search and track trends.  

If anyone would like an example I can post it to my blog

Shaun

(in reply to bmason505)
Post #: 15
RE: Client Health Script - 2/26/2007 1:02:18 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
You know we did something like that internally but figured it was a bit outside the scope of this (like learning\testing\implementing is already a big chunk of work) so we didn't publish anything about it.  Pretty cool to see that others see the same need.  By all means post your idea (we might be able to use it to make our version more robust).  Thx.

_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to scassells)
Post #: 16
RE: Client Health Script - 3/1/2007 2:30:57 PM   
mdewell


Posts: 154
Score: 2
Joined: 9/2/2004
From: Great Lakes, Great Times..
Status: offline
Brian-
Thanks for this.  I am sure it was a lot of work for you guys.  I am testing it now and it looks great.
I have one quick question.  It looks like when this script determines that it is running on a server it exits, and no logs are written.  Is that correct?  I am no vbscript guru- I am just trying to understand what it is happening.
Thanks again.  I appreciate your efforts.

-Matt

(in reply to bmason505)
Post #: 17
RE: Client Health Script - 3/1/2007 3:12:58 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Logs are written either way to the temp folder, but bad logs are sent on to your server of choice (bad meaning the script had to do some work).

Hope you find the script as useful as we have.


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to mdewell)
Post #: 18
Client Health Script Errors - 3/15/2007 10:09:48 AM   
mdewell


Posts: 154
Score: 2
Joined: 9/2/2004
From: Great Lakes, Great Times..
Status: offline
Hi Brian-

I am using this enterprise wide now and am seeing some folks calling the helpdesk with the following error popup (and the corresponding system log entry:

Event Type:    Information
Event Source:    Application Popup
Event Category:    None
Event ID:    26

Description:
Application popup: WScript.exe - Entry Point Not Found : The procedure entry point DoOpenPipeStream could not be located in the dynamic link library ScrRun.dll.

These clients are also throwing logs in the "Bad" folder on my server.  The interesting thing is it looks like they cannot determine their computer name as the log is just called ".log".  Here is an excerpt:

3/15/2007 9:59:07 AM | ERROR |
3/15/2007 9:59:07 AM | REPAIR_WMI | Started
3/15/2007 9:59:07 AM | REPAIR_WMI | Finished

Any ideas?  Could we prevent the popup from appearing?  Thanks.



(in reply to bmason505)
Post #: 19
RE: Client Health Script Errors - 3/15/2007 12:52:55 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Get the machine name from the helpdesk and run WMI Diag v2 on them.  From a command prompt on any one of them, if you type 'set' do you see the client name show?  That's where the script gets the name.  And you are setting this up as a startup script, not a logon script, right?

Since the release of WMI Diag v2, we've rem'd the repair line and have started to look at these one by one.  Whoever wrote v2 of WMI Diag better have gotten a huge bonus!


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to mdewell)
Post #: 20
RE: Client Health Script Errors - 3/16/2007 9:46:18 AM   
mdewell


Posts: 154
Score: 2
Joined: 9/2/2004
From: Great Lakes, Great Times..
Status: offline
Thanks for the suggestions Brian.

Here is an update:

I tried to run the WMIDiag v.2 on one of the affected PCs and got the same wscript error!  So, on a whim I decided to re-register the ScrRun.dll referenced in the error and then try the WMIDiag script again, and- it worked.  WmiDiag finished running and said that the PC had some issues.
Then, I ran your script manually (as local admin) and it ran successfully without errors!  I repeated the procedure on a different problem PC and got the same positive results.  So- it looks like we may have this one licked.
Thanks again.

BTW- Yes, I am running it as a startup script.  And the Set command did return the hostname.  Thanks.


< Message edited by mdewell -- 3/16/2007 9:47:47 AM >

(in reply to bmason505)
Post #: 21
RE: Client Health Script Errors - 3/16/2007 11:34:44 AM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Good find!

You could add that ScrRun.dll re-register as a line in the startup script and leave it for a day or two to catch all machines, then yank it.  Wierd how things like that get unregistered.

_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to mdewell)
Post #: 22
RE: Client Health Script Errors - 9/12/2007 3:23:09 PM   
pmealia

 

Posts: 24
Score: 0
Joined: 7/1/2003
Status: offline
The link above http://myitforum.com/cs2/files/folders/99288/download.aspx is giving me a error message that it is not a valid zip file.

Can anyone help me out.

(in reply to bmason505)
Post #: 23
RE: Client Health Script Errors - 9/13/2007 2:35:34 PM   
jchan754

 

Posts: 14
Score: 0
Joined: 10/28/2006
Status: offline
I just threw this into a test OU with a few assorted machines before I roll it out large scale, are there any script errors I should be looking for?

(in reply to pmealia)
Post #: 24
RE: Client Health Script Errors - 9/14/2007 9:47:51 AM   
mdewell


Posts: 154
Score: 2
Joined: 9/2/2004
From: Great Lakes, Great Times..
Status: offline
The only real error that I have seen in my organization is the one that I mentioned several posts above.  I believe it is caused by a particular healthcare app. messing with scrrun.dll.

(in reply to jchan754)
Post #: 25
RE: Client Health Script Errors - 9/14/2007 12:55:34 PM   
jchan754

 

Posts: 14
Score: 0
Joined: 10/28/2006
Status: offline
What application out of curiousity?  I'm in healthcare as well.

(in reply to mdewell)
Post #: 26
RE: Client Health Script Errors - 9/14/2007 4:07:19 PM   
mdewell


Posts: 154
Score: 2
Joined: 9/2/2004
From: Great Lakes, Great Times..
Status: offline
I think it may be McKesson's PHS app. this is messing with scrrun.dll.

(in reply to jchan754)
Post #: 27
RE: Client Health Script - 9/17/2007 1:13:23 PM   
eschloss


Posts: 613
Score: 25
Joined: 9/7/2004
From: Cincinnati
Status: offline
the link in the first post is not working.  does anyone have an alternate link?

(in reply to bmason505)
Post #: 28
RE: Client Health Script - 9/18/2007 10:25:30 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
I just uploaded a new version and posted an article.  I'll shoot the link here once it's up.

Here it is: http://www.myitforum.com/articles/8/view.asp?id=10774


< Message edited by bmason505 -- 9/19/2007 10:10:28 AM >


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to eschloss)
Post #: 29
RE: Client Health Script - 10/2/2007 3:25:19 PM   
jgibby

 

Posts: 4
Score: 0
Joined: 10/2/2007
Status: offline
Will doing the brute force rebuild wipe out something like Dell OpenManage Client Instrumentation? Would I need to reinstall this after rebuilding? Anyone else come across something like this? I have not tested this script yet but am hopeful.

(in reply to bmason505)
Post #: 30
RE: Client Health Script - 10/2/2007 4:25:11 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
You mean a WMI rebuild?  That could if this Dell add on uses WMI.  Rem out the WMI rebuild if you don't want to use it.  We don't even use it.  We're playing with WMIDiagv2 to look at bad WMI machines.

But the rest of the script only makes sure SMS is installed and running.


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to jgibby)
Post #: 31
RE: Client Health Script - 10/3/2007 2:52:01 PM   
hcortez463


Posts: 675
Score: 48
Joined: 4/8/2005
Status: offline
bmason
script is great.. but i have been looking at it and i have a couple of recomendations.. Just one test that i have ran, If the client is isntalled but disabled, it reinstalled the client.. Do you think it would be possible to add this check in and change to auto and start including with the other health checkes that it does. 

_____________________________

If it Helps, Please rate....

(in reply to bmason505)
Post #: 32
RE: Client Health Script - 10/4/2007 12:01:44 PM   
scassells

 

Posts: 9
Score: 0
Joined: 4/1/2004
Status: offline
I think I may have found a bug.
In my testing I have been breaking combinations of things on client PCs. 

Combination: Bad Path and WMI service disabled.

When execution occurs it give framedyn.dll not found (meaning path is not present).  http://support.microsoft.com/kb/319114 It also pops up wbemtest and leaves it open.  Very odd.  I will give more detail when I finish the testing.

< Message edited by scassells -- 10/4/2007 12:02:35 PM >

(in reply to hcortez463)
Post #: 33
RE: Client Health Script - 10/10/2007 1:44:59 PM   
jgibby

 

Posts: 4
Score: 0
Joined: 10/2/2007
Status: offline
Just want to say thanks for this script - I've got more clients than I know what to do with. I actually turned off AD system discovery since it just brings in so many invalid systems that SMS is wasting it's time trying to connect to. That speaks to our deprovisioning process, but that's another thread.

Thanks Thanks Thanks!

FYI: I have WMI repair turned off (haven't had any bad clients needing WMI repaired yet), and have it linked to just about every computer OU we have (no servers yet).

Joel

(in reply to bmason505)
Post #: 34
RE: Client Health Script - 10/10/2007 2:25:32 PM   
bmason505

 

Posts: 1981
Score: 104
Joined: 1/23/2003
From: Minneapolis, MN
Status: offline
Good feedback everyone.  We're going to change it so a disabled client will be set to back to auto & start.  I've never seen both a bad path AND disabled WMI.  Hopefully scassells doesn't have too many of those!  What a real mess.  Anyway, the Dude is looking into that one.

I also have yet to hear from anyone on why a GPO startup script should not be the default\definitive way to install and maintain SMS clients over any other method.


_____________________________

Brian Mason
MCSA\MCSE\MS MVP - SCCM
Wells Fargo
http://www.miscusergroup.org/

(in reply to jgibby)
Post #: 35
RE: Client Health Script - 10/10/2007 2:32:54 PM   
hcortez463


Posts: 675
Score: 48
Joined: 4/8/2005
Status: offline
Brian
Thanks for you Hard work.. when will it be available?

_____________________________

If it Helps, Please rate....

(in reply to bmason505)
Post #: 36
RE: Client Health Script - 10/11/2007 8:29:47 AM   
bwilms


Posts: 159
Score: 3
Joined: 3/8/2006
Status: offline
Agreed - thanks for your work on this. 

I am currently testing this in our environment. I configured the script, turning most everything off except for logging.  When it runs on my test clients they show up as BAD (even though they are all functioning SMS clients with healthy WMI).  When I read the log there is no indication as to why it logged as BAD.

Am I trying to do something for which this script was not designed?  My goal with logging only was to get an idea of what kind of situation we were dealing with before we let it loose.  I can provide a log example if that'll help.  Thanks.

(in reply to hcortez463)