Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - WMI objects

Reply
 
Old 08-18-2009   #1 (permalink)


Vista
 
 

WMI objects

Hi everyone..

i m new to powershell and windows...

i need to create instances of wmi objects through powershell..

we can extract using getwmiobject...

dont we have any option to set a wmiobject???

Thanks in advance

My System SpecsSystem Spec
Old 08-18-2009   #2 (permalink)
Jan Egil Ring


 
 

Re: WMI objects

Hi!

An example of setting properties on a WMIObject:
Set a variable: $wmiobject = Get-WmiObject win32_service
Select the first object: $wmiobject[0]
Look at the methods and properties of the object: $wmiobject[0] | gm
Test a method, like StartService: $wmiobject[0].StartService()
Set a property: $wmiobject[1].StartMode="Automatic"
Save the property: $wmiobject[1].Put()

--
Jan Egil Ring
---------------------
http://janegilring.wordpress.com
http://powershellug.ning.com

"hegde" <guest@xxxxxx-email.com> wrote in message
news:71fae0b14672f231b1b7bc02f7e980de@xxxxxx-gateway.com...
Quote:

>
> Hi everyone..
>
> i m new to powershell and windows...
>
> i need to create instances of wmi objects through powershell..
>
> we can extract using getwmiobject...
>
> dont we have any option to set a wmiobject???
>
> Thanks in advance
>
>
> --
> hegde
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Functions and Objects PowerShell
NET objects to COM objects .NET General
Using SMO objects PowerShell
Retrieve COM-Objects PowerShell
types of the help objects. PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46