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 cmdlets in CTP

Reply
 
Old 01-20-2008   #1 (permalink)
RichS


 
 

WMI cmdlets in CTP

I've been looking at the new WMI cmdlets in the CTP - Invoke-WMIMethod and
Set-WMIInstance

Invoke-WmiMethod -Class Win32_process -Name Create -ArgumentList calc.exe

works exactly as you would expect it to

I then moved on to trying the DNS namespace and get errors about the methods
don't exist - when I've used them via V1 syntax.

Couple of questions:

1) If a method is only accessible using a psbase construction eg

$rec = Get-WmiObject -ComputerName DC02 -Namespace 'root\MicrosoftDNS'
-Class MicrosoftDNS_AType -Filter "IPAddress = '192.168.172.20'"
$rec.psbase.Delete()

can I access it via Invoke-WMIMethod

2) Are Invoke-WMIMethod and Set-WMIInstance limied in the namespaces they
can access? Don't see why they should be bu tthey don't seem to like the
MicrosoftDNS namespace

3) if I have multipe arguments for the -ArgumentList parameter in
Invoke-WMIMethod do I need to create a hash table as in Set-WMIInstance.

4) Does the -Flag parameter in Set-WMIInstance actually exist - its in the
documemtation but I get an error saying it doesn't exist when I try to use it

--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk

My System SpecsSystem Spec
Old 01-20-2008   #2 (permalink)
Marco Shaw [MVP]


 
 

Re: WMI cmdlets in CTP

RichS wrote:
Quote:

> I've been looking at the new WMI cmdlets in the CTP - Invoke-WMIMethod and
> Set-WMIInstance
>
> Invoke-WmiMethod -Class Win32_process -Name Create -ArgumentList calc.exe
>
> works exactly as you would expect it to
>
> I then moved on to trying the DNS namespace and get errors about the methods
> don't exist - when I've used them via V1 syntax.
>
> Couple of questions:
>
> 1) If a method is only accessible using a psbase construction eg
>
> $rec = Get-WmiObject -ComputerName DC02 -Namespace 'root\MicrosoftDNS'
> -Class MicrosoftDNS_AType -Filter "IPAddress = '192.168.172.20'"
> $rec.psbase.Delete()
>
> can I access it via Invoke-WMIMethod
>
> 2) Are Invoke-WMIMethod and Set-WMIInstance limied in the namespaces they
> can access? Don't see why they should be bu tthey don't seem to like the
> MicrosoftDNS namespace
>
> 3) if I have multipe arguments for the -ArgumentList parameter in
> Invoke-WMIMethod do I need to create a hash table as in Set-WMIInstance.
>
> 4) Does the -Flag parameter in Set-WMIInstance actually exist - its in the
> documemtation but I get an error saying it doesn't exist when I try to use it
>
I've tried asking a private list I am on with a lot of Microsoft folks
on it.

#4 may be just an example of a upcoming feature that was slipped into
the documentation ahead of it actually being programmed in.

Marco

--
Microsoft MVP - Windows PowerShell
http://www.microsoft.com/mvp

PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 01-22-2008   #3 (permalink)
Marco Shaw [MVP]


 
 

Re: WMI cmdlets in CTP

Quote:

> I've tried asking a private list I am on with a lot of Microsoft folks
> on it.
I was told shortly after that the questions had been forwarded off to
the Microsoft WMI team.

No news otherwise...

Marco
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
sql cmdlets ? PowerShell
Quest AD cmdlets RC1 PowerShell
Can't add Quest AD cmdlets PowerShell
ADO and XmlDocument cmdlets? PowerShell
ParameterSetName in cmdlets 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