tfernandez Posted October 23, 2014 Share Posted October 23, 2014 (edited) Hello, I'm beginner with Autoit, pls could you help me translating this powershell code to autoit. $SiteCode='A01' $SiteServer='SCCMServer' $DPGroup="Dps" $PackageID="A0100001" $DPGroupQuery = Get-WmiObject -Namespace "Root\SMS\Site_$SiteCode" -Class SMS_DistributionPointGroup -ComputerName $SiteServer ` -ErrorAction STOP -Filter "Name='$DPGroup'" $DPGroupQuery.RemovePackages($PackageID) I've tried with $objWMI = ObjGet("winmgmts:\\"&$sccm_server_cm12&"\root\SMS\"&$sccmsiteid_cm12&"") $objItems = $objWMI.ExecQuery("Select * From SMS_DistributionPointGroup WHERE name='" & $dpgroup & "'") If IsObj($objItems) Then For $dpgroup In $objItems ConsoleWrite($PackageID&@CRLF) ConsoleWrite($dpgroup.name&@CRLF) $dpgroup.RemovePackages($dpgroup) next Consolewrite works properly showing the name of the group, but the action to remove package from dp end with an COM error. Thanks a lot. Edited October 23, 2014 by tfernandez Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now