Helps if I look at the right version of the script ...

Which account is being used to invoke the script on the remote host?

For whatever reason, that account does not have permissions to write to the 
system's event log.

J

From: [email protected] [mailto:[email protected]] On 
Behalf Of Casey Robertson
Sent: Friday, January 16, 2015 1:36 PM
To: [email protected]
Subject: [mssms] RE: Error writing to event log with ConfigMgr startup script

Thanks Jason - I guess I was looking at Line 497 and it's where it tries to 
write to the Event Log.

I'm using version 1.68 per the script file itself.
I'm running the script via remote Powershell Invoke Command:

#SCCM Client Install

Import-Module ActiveDirectory
$DenServers = Get-ADComputer -Filter 'Name -like "XXX-API-SOAP*"' -Properties 
Name

ForEach ($Server in $DenServers.Name) {
   try {
    Write-Host "Copying files to $Server...."
    Copy-Item -Path C:\Script\SCCM\ccmsetup.exe -Destination 
\\$Server\C$\Windows\Temp<file:///\\$Server\C$\Windows\Temp> -Force
    Copy-Item -Path C:\Script\SCCM\ConfigMgrStartup.vbs -Destination 
\\$Server\C$\Windows\Temp<file:///\\$Server\C$\Windows\Temp> -Force
    Copy-Item -Path C:\Script\SCCM\ConfigMgrStartup-LV7.xml -Destination 
\\$Server\C$\Windows\Temp<file:///\\$Server\C$\Windows\Temp> -Force
    Write-Host "Finished copying files to $Server..."
    Write-Host "Installing SCCM Client on $Server...."
    Invoke-Command -ComputerName $Server -ScriptBlock {cmd /c cscript.exe 
C:\Windows\Temp\ConfigMgrStartup.vbs 
/Config:C:\Windows\Temp\ConfigMgrStartup-LV7.xml}
    Write-Host "SCCM Client install on $Server is Complete...."
}
catch
{
    Write-Host "SCCM install failed on $Server"
}

}


Services being checked:

<ServiceCheck Name="BITS" State="Running" StartMode="Auto" Enforce="True" />
       <ServiceCheck Name="winmgmt" State="Running" StartMode="Auto" 
Enforce="True" />
       <ServiceCheck Name="wuauserv" State="Running" StartMode="Auto" 
Enforce="True" />
       <ServiceCheck Name="lanmanserver" State="Running" StartMode="Auto" 
Enforce="True" />
       <ServiceCheck Name="RpcSs" State="Running" StartMode="Auto" 
Enforce="True" />

Log file only contains this:

![LOG[----------------------------------------]LOG]!><time="15:13:20.000+0" 
date="1-13-2015" component="ConfigMgrStartup.vbs" context="" type="1" thread="" 
file="ConfigMgrStartup.vbs">
<![LOG[Beginning Execution at 1/13/2015 3:13:20 PM]LOG]!><time="15:13:20.000+0" 
date="1-13-2015" component="ConfigMgrStartup.vbs" context="" type="1" thread="" 
file="ConfigMgrStartup.vbs">
<![LOG[----------------------------------------]LOG]!><time="9:52:31.000+0" 
date="1-16-2015" component="ConfigMgrStartup.vbs" context="" type="1" thread="" 
file="ConfigMgrStartup.vbs">
<![LOG[Beginning Execution at 1/16/2015 9:52:31 AM]LOG]!><time="9:52:31.000+0" 
date="1-16-2015" component="ConfigMgrStartup.vbs" context="" type="1" thread="" 
file="ConfigMgrStartup.vbs">
<![LOG[----------------------------------------]LOG]!><time="9:54:30.000+0" 
date="1-16-2015" component="ConfigMgrStartup.vbs" context="" type="1" thread="" 
file="ConfigMgrStartup.vbs">
<![LOG[Beginning Execution at 1/16/2015 9:54:30 AM]LOG]!><time="9:54:30.000+0" 
date="1-16-2015" component="ConfigMgrStartup.vbs" context="" type="1" thread="" 
file="ConfigMgrStartup.vbs">

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Jason Sandys
Sent: January 16, 2015 11:18 AM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] RE: Error writing to event log with ConfigMgr startup script

That line is in the heart of the CheckService function (in the latest version). 
That would mean that whichever account you are using does not have permissions 
to check one of the services configured to be checked.

So...

- Which of the script are you using version?
- How are you running the script on these systems?
- Which services are configured to be checked?
- Can you post the log file please?

J


From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Casey Robertson
Sent: Friday, January 16, 2015 12:16 PM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] Error writing to event log with ConfigMgr startup script

Using Jason's wonderful vbscript to install the client on a number of systems.  
Having a weird error though - there are 16 web servers that in theory are 
identically configured.  However on half of them it works fine and on the other 
half I get this:

C:\Windows\Temp\ConfigMgrStartup.vbs(497, 3) Microsoft VBScript runtime error: 
Permission denied
    + CategoryInfo          : NotSpecified: (C:\Windows\Temp...rmission 
denied:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
    + PSComputerName        : XXX-API-SOAP-06

This would appear to be not having enough permissions to write to the event 
log.  After a quick look at basic registry permissions, machine permissions, 
local admins etc I can't see a delta between a working machine and a 
non-working machine.  Probably missing something obvious but any ideas??


Casey Robertson
Systems Engineer
W 619.878.9099
E [email protected]<mailto:[email protected]>

MINDBODY, Inc.
4051 Broad Street, Suite 220
San Luis Obispo, CA 93401

  [Logo-for-email-signature.jpg] <http://www.mindbodyonline.com/>







Reply via email to