Jump to content
Sign in to follow this  

Help translating powershell script to auto wmi Get-WmiObject

Recommended Posts

Hello, I'm beginner with Autoit, pls could you help me translating this powershell code to autoit.

        $DPGroupQuery = Get-WmiObject -Namespace "Root\SMS\Site_$SiteCode" -Class SMS_DistributionPointGroup -ComputerName $SiteServer `
        -ErrorAction STOP -Filter "Name='$DPGroup'"

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 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 by tfernandez

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...