![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | [SUGGESTION] New switch parameter for Get-WmiObject Get-WmiObject is one of the most used cmdlets in PowerShell, sometimes WMI is the only way to get/make system configuration changes on remote computers. It is considered a best practice to verify remote computers availability before trying to connect them. Given that, it is up to the user/scripter to write that functionality, ping remote computer(s), filter the ones that are not available, etc. Wouldn't it be nice to have a -ping switch parameter? --- Shay Levi $cript Fanatic http://scriptolog.blogspot.com |
| | #2 (permalink) | ||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject That really _is_ one of the frustrating problems with remote access problems. I think it may make more sense to provide a distinct tool for confirming remote node availability, though, given that a wide range of tools can encounter the same problem under certain circumstances. It may not happen, though, simply because a tunable script that filters nodes by availability is possible. As an example, here's a Test-IPNode.ps1 script I use. The script reads system IDs (IP/DNS/WINS style names) from the input stream and drops any that don't have perfect responses. A more full-featured version can be made that allows you to control timeouts, number and size of packets, and so on. #Test-IPNode.ps1 process { $_ | Where {(Get-WmiObject Win32_PingStatus ` -Filter "address='$_'" ` ).StatusCode -eq 0} } I haven't checked the available community extensions lately, but it's possible someone has already wrapped up the PingStatus functionality in a cmdlet. "Shay Levi" <no@xxxxxx> wrote in message news:89228ed2291668ca7e5d6b545244@xxxxxx
| ||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject Hi Alex, I've blogged a solution before (using filters), but wondered if such built-in functionality can help. You're the only one who reponded to this thread so I guess no one is realy interested (or finds it useable)--- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||||||||||||||
| | #4 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject Dealing with the second point first, it's part of the lifecycle process. There are all sorts of posts about technically exciting things that those of us who want to dig into odd bits just love. What you're talking about is more humdrum, but it's actually a very significant part of long-term real-world usability. Virtually every network administration script needs to do this kind of thing. So the "interesting" doesn't matter so much; it's valuable, which is much more important. ![]() "Shay Levi" <no@xxxxxx> wrote in message news:89228ed22b1338ca8229fde7e08c@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| | #5 (permalink) | ||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject Shay Levi wrote:
You should post on connect and provide a link here. That's one way to get the ball rolling on this. Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
| | #6 (permalink) | ||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject "Shay Levi" <no@xxxxxx> wrote in message news:89228ed22b1338ca8229fde7e08c@xxxxxx
stuff that sidetracked me - but here's the longer, more complete ping script I wrote a while back that tries to be a complete wrapper for this kind of functionality. Can you post the specific link if you have it handy? Although I instinctively think of pinging as something that should be available separately, I can see a good point to what you're saying after reflecting on it. I think some kind of FailFast parameter would make sense for remote calls from Get-WmiObject; it's so common a problem that having the cmdlet quit trying after a specified period of time would be useful. By the way, here's a longer script that I wrote as a more full-fledged wrapper for Win32_PingStatus. It's a bit ugly - only takes values as arguments, and parameters use the names for Win32_PingStatus properties with no thought given to making them more PS-like. However, it gives you complete control over all aspects of the ping, and via the SourceNode you can even perform a remote ping, running the ping _from_ SourceNode instead of the local computer. That functionality has been there in Win32_PingStatus forever, but most people don't notice it, and the first admins I showed it to were so excited that I could almost see their tails wagging. ; ) | ||||||||||||
| | #7 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject This issue is already on connect (I believe) and has been discussed with Devs as well. We will just have to wait and see what comes of the conversation. "Shay Levi" <no@xxxxxx> wrote in message news:89228ed22b1948ca82641d16c325@xxxxxx
| ||||||||||||||||||||||||||||||||||||
| | #8 (permalink) | ||||||||||||||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject Yup... I wanted to read what other people think before opening a new suggestion on connect. 10x --- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||||||||||||||
| | #9 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject Nice. I've been away from the community (and .NET) for over a year and hadn't even seen anyone using the System.Net.NetworkInformation.Ping class before. I didn't even know it was there! "Shay Levi" <no@xxxxxx> wrote in message news:89228ed22b1c38ca8265b339fd7e@xxxxxx
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | #10 (permalink) | ||||||||||||||||||||||||||||||||||||
| Guest | Re: [SUGGESTION] New switch parameter for Get-WmiObject
--- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||||||||||||||||||||||||||
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Suggestion: Help as alternate name for '?' universal parameter | Alex K. Angelopoulos [MVP] | PowerShell | 7 | 06-23-2006 01:15 PM |
| Suggestion: Universal Usage/Syntax/Definition parameter | Alex K. Angelopoulos [MVP] | PowerShell | 2 | 06-22-2006 11:42 PM |
| Suggestion: Get-WmiObject reading computer names from input stream | Alex K. Angelopoulos [MVP] | PowerShell | 2 | 06-22-2006 11:31 PM |
| Suggestion: Format-Table's HideTableHeaders parameter should be NoLabel | Alex K. Angelopoulos [MVP] | PowerShell | 0 | 06-20-2006 06:35 AM |
| get-WmiObject -Query parameter | /\\/\\o\\/\\/ | PowerShell | 0 | 05-25-2006 01:03 PM |