Page 1 of 1 1
Topic Options
#152573 - 2005-11-30 08:36 PM Logon Script - Install the latest SMS Adv Client if not already there...
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
apologies for all of those who recognize this same question from before, but here it is again. some high priorities game down my way, and i had to put this to the side... so here it is again.

in this enviroment, kixtart 95 (3.63) is only used. My task is to include a section that looks to see if the SMS Advanced Client is installed, and upon NOT finding it, initiate it's installation. Since %windir%\system32\ccm\ccmexec.exe is a required executable for the SMS client to run, i figured that it's existance would be a fair indication that the SMS client is installed, so I want to use the existance of that file as my basis. Furthermore a new version (accompanied with the SMS 2003 SP1) of the ccmexec.exe is available, so upon finding %windir%\system32\ccm\ccmexec.exe i want to check to see if the version is 2.50.3174.1152 or not, and upon a non-compliance of that version number, initiate the installation of the new client package.

heres is what i've come up with, unsuccessful as it might be...

---start---

Dim $CCMSetupProg, $CCMVersion

set $CCMSetupProg = @lserver+"\sysvol\ccmsetup.exe"

if EXIST("c:\windows\system32\ccm\ccmexec.exe")
set $CCMVersion = GETFILEVERSION("c:\windows\system32\ccm\ccmexec.exe")
if $CCMVersion = "2.50.3174.1152"
else
shell $CCMSetupProg + ' /SLP=SERVER /Advcli /AdvCliCmd SMSCACHESIZE=1024'
endif
ELSE
shell $CCMSetupProg + ' /SLP=SERVER /Advcli /AdvCliCmd SMSCACHESIZE=1024'
endif

---end---

now, obviously, it doesnt work, or i wouldnt be here asking for assistence. previously, this generous person posted a script that did what i wanted it todo, although it required commands of a current version of kix, and like i said before, 3.63 is the latest version utilized here for the logon scripts. I dont know why, and as far as I can tell, no one else knows here either, although thats the way it is, and they dont want to change it... for reason they cant conjour up, so im stuck with 3.63.

upon running it, it just runs through. no errors, no nothing really. all i know is that it has not started up the ccmsetup whatsoever.

any and all insight is greatly appricated. its quite apparent that i dont know the kix scripting language much!


Edited by kastr (2005-11-30 08:39 PM)

Top
#152574 - 2005-11-30 08:54 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
take out "set"

Code:

Dim $CCMSetupProg, $CCMVersion

$CCMSetupProg = @lserver+"\sysvol\ccmsetup.exe"

if EXIST("c:\windows\system32\ccm\ccmexec.exe")
$CCMVersion = GETFILEVERSION("c:\windows\system32\ccm\ccmexec.exe")
if $CCMVersion = "2.50.3174.1152"
; nothing here intentionally
else
shell $CCMSetupProg + ' /SLP=SERVER /Advcli /AdvCliCmd SMSCACHESIZE=1024'
endif
ELSE
shell $CCMSetupProg + ' /SLP=SERVER /Advcli /AdvCliCmd SMSCACHESIZE=1024'
endif

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#152575 - 2005-11-30 09:05 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
Have you tried using SMS 2003 to deploy the new ITMU supported SMS client? It's a fairly easy task. There's a great article about doing this on myitforum.com.
http://myitforum.techtarget.com/articles/18/view.asp?id=8812

Now, for some reason, I can't access this website... I'm hoping it's just me. Anyway, this step-by-step will take you through the process of creating an ITMU SMS 2003 patch management system, but specifically, there is a section on creating the Package and Advertisement for deploying the newest version of the SMS Advanced Client.

-SWK
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#152576 - 2005-11-30 09:42 PM Re: Logon Script - Install the latest SMS Adv Client if not already there... *DELETED*
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
Post deleted by kastr
Top
#152577 - 2005-11-30 10:03 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
radimus:

the following code:

---start---

Dim $CCMSetupProg, $CCMVersion

$CCMSetupProg = @lserver+"\sysvol\ccmsetup.exe"

if EXIST("c:\system32\ccm\ccmexec.exe")
"1" @SERROR
$CCMVersion = GETFILEVERSION("c:\system32\ccm\ccmexec.exe")
if $CCMVersion = "2.50.3174.1152"

else
shell $CCMSetupProg + ' /SLP=SMSServer /Advcli /AdvCliCmd SMSCACHESIZE=1024'
"2" @SERROR
endif
else
run $CCMSetupProg + ' /SLP=SMSServer /Advcli /AdvCliCmd SMSCACHESIZE=1024'
"3" @SERROR
endif

---end---

runs through just find with no errors, although the ccmsetup.exe will not load up via the logon script. it will load manually for me and a test barebones user account, but not via the logon script?!

Top
#152578 - 2005-11-30 11:36 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
StarwarsKid Offline
Seasoned Scripter
*****

Registered: 2005-06-15
Posts: 506
Loc: Oregon, USA
Ugh.... I'm sorry to hear that. SMS does this soooooo nicely.... Status tracking, reporting..... It's just a good way to do this.

Have you verified that your GETFILEVERSION actually returns a file version at all? You can send the output to your monitor by using:
Code:
 ? GETFILEVERSION("c:\windows\system32\ccm\ccmexec.exe") 



Also, make sure your path is being produced correctly for the entire SHELL string. You can also echo this to the screen with a ? symbol before the string (I think)....

Otherwise, I don't know what would be keeping your script from running.
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5

Top
#152579 - 2005-12-01 12:54 AM Re: Logon Script - Install the latest SMS Adv Client if not already there...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
You really should read my Is '?' a PRINT or NEWLINE command? FAQ.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#152580 - 2005-12-01 05:22 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
Quote:

Ugh.... I'm sorry to hear that. SMS does this soooooo nicely.... Status tracking, reporting..... It's just a good way to do this.

Have you verified that your GETFILEVERSION actually returns a file version at all? You can send the output to your monitor by using:
Code:
 ? GETFILEVERSION("c:\windows\system32\ccm\ccmexec.exe") 



Also, make sure your path is being produced correctly for the entire SHELL string. You can also echo this to the screen with a ? symbol before the string (I think)....

Otherwise, I don't know what would be keeping your script from running.




right now my control is a computer that has no client on it whatsoever, so the script is skipping that all together for the time being, so as to keep it simple; i will be moving onto that once i can get the installation initiated upon ccmexec.exe getn 404ed.

Top
#152581 - 2005-12-01 05:46 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
right now, as the script is:

---start---

Dim $CCMSetupProg, $CCMVersion

set $CCMSetupProg = @lserver+"\sysvol\ccmsetup.exe"

if EXIST("c:\windows\system32\ccm\ccmexec.exe")
$CCMVersion = GETFILEVERSION("c:\windows\system32\ccm\ccmexec.exe")
if $CCMVersion = "2.50.3174.1152"

else
shell $CCMSetupProg + " /SLP=SERVER /Advcli /AdvCliCmd SMSCACHESIZE=1024"
? "Found, but out of date - Installing: " @SERROR ?
endif
else
run $CCMSetupProg + " /SLP=SERVER /Advcli /AdvCliCmd SMSCACHESIZE=1024"
? "Not Found - Installing: " @SERROR ?
endif

---end---

the script runs through just fine, but still ccmsetup.exe is not indicated as running at all! Uitilizing RUN I get the following:

Not Found - Installing: The operation completed successfully.

... although utilizing the SHELL command instead, i get:

Not Found - Installing: Incorrect function.

Now, Ive looked into the differences between RUN and SHELL, and what ive found is that I would rather use RUN, becuase it executes the application and moves on right away, which is what would be preferred, becuase ccmsetup.exe is not a quick process and it designed to finish up running in the background anyways; I dont want the script waiting for ccmsetup.exe to finish. SHELL, on the other hand, does wait for the application to finish before it moves onto the next line, and that would not be recommended, although at least getting an error, whether it pertain to syntax or anything, is nice becuase its something i can work with... i get no errors and no results the other way! How should the syntax of SHELL be used in this script?

The reason I want to test this out is becuase everything else thats involved in this script has been scrutinized and there are no hurdles. The ccmsetup.exe is located, you'll notice, on the sysvol share on the DC. There should not be any permissions issues. Checksum on the executable prooves to me that it is a good copy, and as well I have used parent copies of the same execuatable, so i know for sure that it works. As well i have copied the ccmsetup.exe to my own box and ran the script under my administrative credentials of the local box and network, still to no avail. Additionally I check the access stamp attributes of the ccmsetup.exe that I am attempting to use, and they dont change! Furthermore, using the same exact copy of ccmsetup.exe i can manually install the client on machines! Im figuring it is something with the script?! If it is, I dont care, I just want it done with! The rest of the logon script works, but this new section that I am working on. (contemplates a new field!)

Top
#152582 - 2005-12-01 05:57 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Brian (from Microsoft) provided information about the command options that will hopefully allow us to use the CCMSetup executable from the logon script to upgrade our SMS clients. Below is an excerpt that describes the command and how it is used.



SMSCONFIGSOURCE Specifies where and in what order the Advanced Client Installer checks for configuration settings. The property is a string containing one or more characters, each defining a specific configuration source. Use the character values R, P, M, and U, alone or in combination, as shown in the examples below. By default, the client installation uses PU to check first the installation properties and then the existing settings.

Use R to instruct the client installation program to check for configuration settings in the registry:

Ccmsetup.exe SMSCONFIGSOURCE=R
Use P to instruct the client installation program to check for configuration settings in the installation properties provided on the command line:

Ccmsetup.exe SMSCONFIGSOURCE=P
Use M to instruct the client installation program to check for configuration settings when you are replacing an existing SMS 2.0 client or Legacy Client with the Advanced Client (uses the existing site code):

Ccmsetup.exe SMSCONFIGSOURCE=M
Important
Do not use the M value on SMSCONFIGSOURCE if you are upgrading any SMS 2.0 or SMS 2003 Legacy Clients that are currently assigned to an SMS 2.0 secondary site. These clients will become orphaned because Advanced Clients cannot be assigned to secondary sites.

Use U to upgrade the Advanced Client to a newer version of the Advanced Client (uses the assigned site code):

Ccmsetup.exe SMSCONFIGSOURCE=U
To use multiple configuration sources, specify multiple characters. For example, use RP to force the client installation program to first check for configuration options in the registry and then check the installation properties on the command line:

Ccmsetup.exe SMSCONFIGSOURCE=RP
When you are installing Advanced Clients, specify the SMSCONFIGSOURCE property with the options in the order that is most appropriate for your deployment plan so clients have the maximum opportunity to find a suitable site code and client type. For example, you might use PUM so that if the installation is an upgrade from the Legacy Client or an older version of the Advanced Client, the existing site code is used. However, the administrator can still override the existing site code on the command line by using the SMSSITECODE property. See the Important note about the M value, earlier in this section, before you use this property during a client upgrade.


Code:
;FUNCTION         SMS2003()
;
;AUTHOR Howard A. Bullock (hbullock@tycoelectronics.com)
;
;ACTION Performs required actions for installing SMS client
;
Function SMS2003()
Writelog("SMS2003: Start")

;define local variables
Dim $DialupStatus,
$VPNStatus,
$ClientType,
$SiteCode,
$SiteStatus,
$ClientVer,
$SMSkey,
$CapInstProg,
$RC

$DialupStatus = @RAS
$VPNStatus = val(ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Cisco Systems\VPN Client", "TunnelEstablished"))

;exclude RAS clients, VPN clients, and Servers
if $DialupStatus or $VPNStatus or IsServer()
Writelog("SMS2003: Exiting because one or more are true - DialupStatus=" + $DialupStatus + " VPNStatus=" + $VPNStatus + " IsServer()=" + IsServer())
exit 1
endif

$SMSkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS"
$CapInstProg = @Lserver + "\netlogon\corp\sms\i386\capinst.exe"

;determine client type
$ClientVer = ReadValue($SMSkey + "\Client\Client Components\SMS Client Base Components\Installation Properties", "Installed Version")
Select
Case Left($ClientVer,5) = "2.00." $ClientType = "OLDLegacy"
Case Left($ClientVer,5) = "2.50." $ClientType = "NEWLegacy"
Case Left($ClientVer,2) = "9." $ClientType = "Advanced"
Case 1 $ClientType = "NoClient"
Endselect
Writelog("SMS2003: ClientType=" + $ClientType)

$SiteCode = ""
Select
Case $ClientType = "Advanced" $SiteCode = ReadValue($SMSkey + "\Mobile Client", "AssignedSiteCode")
Case 1 $SiteCode = "" + ENUMKEY($SMSKey + "\Client\Sites\System", 0)
Endselect
Writelog("SMS2003: SiteCode=" + $SiteCode)

if $SiteCode = ""
$ClientType <> "NoClient"
Writelog("SMS2003: Setting to NoClient because there was no SiteCode assigned.")
endif


if $ClientType <> "Advanced"
;process clients that DO NOT have an SMS client installed or have no sitecode
Writelog("SMS2003: processing computer as '" + $ClientType + "'")

Select
Case Val(@DOS ) >= 5 ;W2K and above
;install advanced client
ShellProg($CapInstProg, "/SLP=ServerName /Advcli /AdvCliCmd SMSCACHESIZE=1024")

Case (Left(@ProductType, 10) = "Windows NT" or @ProductType = "Windows 98") and $ClientType <> "NEWLegacy"
;install NewLegacy client
ShellProg($CapInstProg, "/SLP=ServerName")

Case 1 ;Unknown case
Writelog("Unhandled case 1: @@DOS = " + @DOS + " No action taken to install SMS client")
Endselect
endif

if $ClientType = "Advanced"
; $CCMEXEver is a global defined from LogClientDetails()
if $CCMEXEver <> "2.50.3174.1152"
;do staggered 20 percent per day for initial installation
Dim $Date, $TargetDate
$TargetDate = 20051014
$Date = 0 + (substr(@Date,1,4)+substr(@Date,6,2)+substr(@Date,9,2))

if $Date < $TargetDate or $Date > ($TargetDate + Val(Right(Enumipinfo(0,0),1))/2)
ShellProg($CapInstProg, "/SLP=ServerName /Advcli /AdvCliCmd SMSCONFIGSOURCE=U")
endif
endif
endif

Writelog("SMS2003: Complete")

Endfunction


This code is from LogClientDetails() that pertains to the above code.
Code:
	;SMS Installation
Dim $CEN, $SMS, $ClientVer, $SMSkey
Global $CCMEXECver

;determine client type

$SMSkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS"
$ClientVer = ReadValue($SMSkey + "\Client\Client Components\SMS Client Base Components\Installation Properties", "Installed Version")

;CHANGE THIS TO CCMEXEC.EXE file version
$file = "%windir%\system32\CCM\CCMEXEC.exe"
if exist ($file)
$CCMEXECver = GETFILEVERSION ($file,"FileVersion")
$CCMEXECver = left($CCMEXECver,instr($CCMEXECver," ")-1)
endif

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#152583 - 2005-12-01 06:19 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
thanks for taking the time out! i wasnt aware of those 'switches' up there, ccmsetup.exe got more options than CEOs do with stock, huh. that script, although, i have tried. kix 3.63 doesnt like it. i like it! elder kix doesnt. i have as well watered down the script and came pretty close to what you have, to no avail. im starting to think that im just flat out retarded.
Top
#152584 - 2005-12-01 06:29 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I would really recommend that you push for upgrading the KiXtart version. Version 3.63 lacks a great deal of functionality found in 4.51.

I can not emphasize enough how important it is to get current. I would be more than happy to provide input into such a discussion if you desire.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#152585 - 2005-12-01 06:43 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
i am all ears! if i can convince the captin of the ship to... maybe patch up some [security] holes in the freeboard of the ship, that would probably be the best bet!

aight kixscript hackers n' crackers alike, whats it gunna take to light a fire under these goons?

Top
#152586 - 2005-12-01 09:38 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
kastr Offline
Fresh Scripter

Registered: 2005-10-20
Posts: 16
so does anyone know off the top of their head if these older versions of kix have any security vunlerabilities that i could reference in my quest to get kix updated here?!
Top
#152587 - 2005-12-01 09:48 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
No security vunerabilies per se, however with the latest version of KiXtart one has the ability to pre-tokenize the script preventing prying eyes from examining your code and get clues as to what you are doing in your logon script. Also, you might add that the additional features provided in the latest KiXtart will allow you to provide a higher level of support to your end-user base.
Top
#152588 - 2005-12-05 03:25 PM Re: Logon Script - Install the latest SMS Adv Client if not already there...
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA

From my SMS co-workers:
Quote:


The command that Microsoft provided to me for upgrading the SMS client via the logon script doesn’t work. I did some research and found that the SMSCONFIGSOURCE command is used by CCMSETUP (not CAPINST) and when CAPINST is called, it automatically checks to see whether the client is already installed (which it is) and ends – it never calls CCMSETUP and therefore the SMSCONFIGSOURCE command is never used.




Still investigating...


Edited by Howard Bullock (2005-12-05 03:26 PM)
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 811 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.066 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org