Sign in to follow this  
Followers 0
mattw112

WMI and puts

3 posts in this topic

So I posted a similar question a while back (year or so), but after working with you guys found out that what I was working on wasn't possible, but the question I had still is making me wonder.

So the question is this, how do I edit a value in WMI? I've looked through the forum posts and see hundreds of posts on reading from WMI etc but not really too much on simply changing a value.

I have this code:

If $colMember.SiteCode <> "MOB" Then
    $colMember.SiteCode = "MOB"
    $colMember.Put_
Endif

Now unlike my last post I have verified this Field is Read\Write ;)

The script always errors at the .put_ though?

Is this not the correct syntax for this?

Thanks,

Terry

Share this post


Link to post
Share on other sites



It depends. The .put (or .put_) method is not valid for all objects. Exactly what type of object is $colMember?

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

So of course as soon as I hit post, the next test I did worked... arrgg

Turned out all I changed was doing a ObjGet instead of a ObjCreate.

Anyway seems to be working now.

Thanks,

Terry

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  
Followers 0