Re: Scripting SMS 2003



I use code like the following to get the SCF settings. So change
filetype to the appropriate value (1, 2, whatever) to get proposed vs
actual. Check with the SDK to verify what the proper values are for
filetype.

set SCFs=WbemServices.ExecQuery("Select * FROM SMS_SiteControlFile WHERE
Sitecode='" & site.sitecode & "' AND FileType=1")
For Each SCF in SCFs
SCF.Refresh site.sitecode
Next
objpath="SMS_SCI_ClientConfig.ItemType='Client Configuration',Sitecode='" &
Site.Sitecode & "',FileType=1,ItemName='Client Properties'"
set comp=WbemServices.Get(objpath)
PropArray = Comp.props...

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Peter Lundin" <PeterLundin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C0B9141B-1787-4FA1-9A22-2BC93B0D4206@xxxxxxxxxxxxxxxx
> Thanks for a quick response!
>
> We are rolling out 20 sites a night with a total of several hundred
> secondary sites and servers. The installation and configuration of SMS2003
> on
> the servers is fully automated using VBscript for the most part.
>
> It is important that we get a reliable report when the nights batch is
> done.
> I was hoping to use the method I described before to get a report. But
> with
> that kind of delay it is nearly impossible to find a good starting point
> for
> the reporting script, especially since we don't know when the servers
> started
> the installation procedure.
>
> Is there a way to read the "proposed" settings to get an indication if
> things went wrong or successfull?
>
>
> "Paul Thomsen [MSFT]" wrote:
>
>> When you make a site change in the console, it takes some time to
>> become
>> effective as the various components kick in and do the work needed. If
>> the
>> change is down the hierarchy, that can take longer.
>>
>> To reflect this, there are various states for the site control file.
>> I
>> forget the formal terms, but they're things like "proposed", "applied",
>> etc.
>> This used to be really obvious in the SMS 1.2 console and you can see it
>> in
>> some of the logs, the site control inbox, or some of the data structures.
>>
>> The SMS 2.0 and 2003 consoles take an optimistic approach and show
>> you
>> the 'proposed' state of the component, so the console reflects your
>> change
>> right away, even though in reality the change hasn't happened yet and
>> could
>> conceivably fail. Your script is giving you the actual state. Since
>> you're
>> monitoring, presumably for success, that's actually a good thing. So I'd
>> suggest you should keep your script as is.
>>
>> SMS is a big distributed system, and thus plenty of things don't
>> happen
>> in real time. That should be acceptable, since managing large numbers of
>> computers rarely has to happen instantaneously (how important is it that
>> you
>> upgrade all your users to Office 2003 in the next 30 seconds, for
>> example?).
>> So I'd suggest it's reasonable to wait a bit before monitoring for
>> success
>> of site changes.
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Peter Lundin" <PeterLundin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:E4C2B4AD-F988-41BF-B4A3-F9AE8E877921@xxxxxxxxxxxxxxxx
>> > Hi,
>> > After installing a Secondary Site I want to verify that the role
>> > 'Management
>> > Point' is enabled.
>> > To do this I'm querying the 'SMS_SCI_SysResUse' class (se code below).
>> > The query does not return information that the role is enabled, even
>> > though
>> > I can see that it is in the SMS Admin Console, until after 1 to 20
>> > minutes.
>> >
>> > Is this due to intra-site replication or something like that?
>> > Is there any other way to verify that the role has been enabled without
>> > the
>> > delay of 1 to 20 minutes?
>> >
>> > ----------
>> > SiteCode = "mySecSite"
>> > CentralSiteCode = "myPriSite"
>> > CentralSiteServer = "myPriServer"
>> >
>> > On error resume next
>> >
>> > Set loc = CreateObject("WbemScripting.SWbemLocator")
>> > Set WbemServices = loc.ConnectServer( CentralSiteServer,
>> > "root\SMS\site_"
>> > &
>> > CentralSiteCode )
>> > Set objSiteRoles = WbemServices.ExecQuery("Select * From
>> > SMS_SCI_SysResUse
>> > WHERE SiteCode='" & SiteCode & "'")
>> >
>> >
>> > For Each Role In objSiteRoles
>> > <code>
>> > Next
>> > ----------
>> >
>> > Regards,
>> > Peter Lundin
>>
>>
>>


.