Help for this page

Select Code to Download


  1. or download this
    # Connect to WMI on reporting server
    #
    ...
            FatalCOMError("Can't open WbemScripting object");
    my $SWbemServices = $SWbemLocator->ConnectServer($Server, "root/sms/si
    +te_$SiteCode") or 
            FatalCOMError("Can't connect to server: $Server");
    
  2. or download this
        # Get count of clients in collection
        my $WQL = q/select * from SMS_CM_RES_COLL_CEN01562/;
        $Colln = $SWbemServices->ExecQuery($WQL,"WQL",16) or FatalErr("Exe
    +cQuery for Clients failed",1);
        $count = $Colln->{Count};
    
  3. or download this
        # Get count of clients in collection
        my $WQL = q/select count(*) from SMS_CM_RES_COLL_CEN01562/;
        $Colln = $SWbemServices->ExecQuery($WQL,"WQL",16) or FatalErr("Exe
    +cQuery for Clients failed",1);