Search the Community
Showing results for tags 'sccm'.
-
Hello Everyone, I'm hoping someone as tried this before or can otherwise assist me with this task. I've got an AutoIt script that I've developed to perform some pre-launch tasks and also provides a GUI for prompting the user (when appropriate for our needs). The final task that I need this AutoIt script to do is to start/lauch/kickoff an OSD Task Sequence that is advertised to the user via SCCM's Software Center. Does anyone know how or have any ideas how I could go about doing this? All assistance is appreciated! Regards, TX Techie
-
Greetings, I am trying to make a small program that, when launched on a client computer, initiates an SCCM software install. I have done alot of searching and code testing and found the _SCCM UDF does not do what I need, that is more of a server admin tool. The tool I'm looking to make will launch installs for pre specified software packages that do not require approval in SCCM. I tried using Fiddler to grab the button push string, but it uses session cookies and all types of extra auth strings. Has anyone found a way to do this? This is my test for connecting to the SCCM Server which does work.. #include <Array.au3> #include <_SCCM.au3> $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $oConfigMgr = ObjCreate("Microsoft.SMS.Client") If Not @error Then $sServer = $oConfigMgr.GetCurrentManagementPoint $SCode = "MySite" $sPC = @ComputerName Local $oLocator = ObjCreate("WbemScripting.SWbemLocator") If IsObj($oLocator) Then $__goSMS = $oLocator.ConnectServer($sServer, "root\sms\site_CFG") If @error Then MsgBox(0, "Debug", "Error") Else MsgBox(0, "Debug", "It worked.") EndIf EndIf Func MyErrFunc() MsgBox(0, "AutoItCOM", "We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Local $err = $oMyError.number If $err = 0 Then $err = -1 $g_eventerror = $err ; to check for after this function returns EndFunc ;==>MyErrFunc Thanks!!!!!!!!
-
*Requires that you are a client of SCCM in order for SMS_ to exist/populate This is an exercise in formatting data returned from CIM via powershell via Autoit. Should get you the meat: name, version, location, installdate, and uninstall string. Short Version: Grouped by Program #RequireAdmin #include<Array.au3> $iPid = run("powershell (Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | fl ProductName,InstallDate,InstalledLocation,ProductVersion,UninstallString | out-string).trim()", "" , @SW_HIDE , 0x2) $sOutput = "" While ProcessExists($iPid) $sOutput &= StdoutRead($iPID) WEnd $aOutput = stringsplit($sOutput, @LF , 2) _ArrayDisplay($aOutput) Long Version: Each Category in its own column, modular pieces. ;CIMClasses #include<Array.au3> #RequireAdmin $iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select ProductName" , "" , @SW_HIDE , 0x2) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aProductName = stringsplit($sOutput , @CR , 2) ;;;;;------------------------------------------- $iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select InstallDate" , "" , @SW_HIDE , 0x2) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aInstallDate = stringsplit($sOutput , @CR , 2) ;;;;;------------------------------------------- $iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select InstalledLocation" , "" , @SW_HIDE , 0x2) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aInstalledLocation = stringsplit($sOutput , @CR , 2) ;;;;;------------------------------------------- $iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select ProductVersion" , "" , @SW_HIDE , 0x2) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aProductVersion = stringsplit($sOutput , @CR , 2) ;;;;;------------------------------------------- $iPid = run("powershell Get-CimInstance -Namespace root\cimv2\sms -ClassName SMS_InstalledSoftware | select UninstallString" , "" , @SW_HIDE , 0x2) $sOutput = "" While 1 $sOutput &= StdoutRead($iPID) If @error Then ExitLoop EndIf WEnd $aUninstallString = stringsplit($sOutput , @CR , 2) ;;;;;------------------------------------------- Local $aOut[ubound($aProductName)][5] For $i = 0 to ubound($aProductName) - 1 $aOut[$i][0] = $aProductName[$i] $aOut[$i][1] = $aInstallDate[$i] $aOut[$i][2] = $aInstalledLocation[$i] $aOut[$i][3] = $aProductVersion[$i] $aOut[$i][4] = $aUninstallString[$i] Next _ArrayDisplay($aOut , "SMS Installed Software")
-
I hope this isn't too off topic, as there may be other SCCM users out there. When running a script as the logged on user (not as System) Regread and Regwrite don't work. I think this is because even though the script is running with only the user's rights it is still running to some extent in the System account - although a message box popped up from a script running in this way does show the correct username for @username. What I don't understand is why running in the same way Reg.exe does work in reading and writing to the registry as the logged on user - although I find the syntax harder :-). Does anyone understand why this is or have a workaround to get Regread etc working is this situation? Many thanks as always, Stephen