Jump to content

Search the Community

Showing results for tags 'sccm'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 3 results

  1. 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!!!!!!!!
  2. *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")
  3. 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
×