Error when running

Feb 1, 2013 at 3:51 PM
Edited Feb 1, 2013 at 4:25 PM
Hi, I LOVE the potential use of your product for our network. Thank you so much for providing it to the community. I do have three questions:

First question, when I run the program and try and audit patches it only sometimes finishes (even for localhost) and I get this error:
Method invocation failed because [System.Windows.Controls.ItemCollection] doesn't contain a method named 'EditItem'.

At C:\Users\messer\Desktop\PS\Start-PoshPAIG.ps1:449 char:48
+                 $uiHash.Listview.Items.EditItem <<<< ($Computer)
    + CategoryInfo          : InvalidOperation: (EditItem:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
 
Method invocation failed because [System.Windows.Controls.ItemCollection] doesn't contain a method named 'CommitEdit'.
At C:\Users\messer\Desktop\PS\Start-PoshPAIG.ps1:451 char:50
+                 $uiHash.Listview.Items.CommitEdit <<<< ()
    + CategoryInfo          : InvalidOperation: (CommitEdit:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
 
Method invocation failed because [System.Windows.Controls.ItemCollection] doesn't contain a method named 'EditItem'.
At line:9 char:52
+                     $uiHash.Listview.Items.EditItem <<<< ($Computer)
    + CategoryInfo          : InvalidOperation: (EditItem:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
 
Method invocation failed because [System.Windows.Controls.ItemCollection] doesn't contain a method named 'CommitEdit'.
At line:11 char:54
+                     $uiHash.Listview.Items.CommitEdit <<<< ()
    + CategoryInfo          : InvalidOperation: (CommitEdit:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
 
Method invocation failed because [System.Windows.Controls.ItemCollection] doesn't contain a method named 'EditItem'.
At line:21 char:52
+                     $uiHash.Listview.Items.EditItem <<<< ($Computer)
    + CategoryInfo          : InvalidOperation: (EditItem:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
 
Method invocation failed because [System.Windows.Controls.ItemCollection] doesn't contain a method named 'CommitEdit'.
At line:35 char:54
+                     $uiHash.Listview.Items.CommitEdit <<<< ()
    + CategoryInfo          : InvalidOperation: (CommitEdit:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound
Next question, in order to run on remote machines, what environment do they need to have? Powershell v2? Do they need the same AD credentials that I am logged into to be valid for those machines as well? I manage many networks across many domains and was wondering how this would work across multiple domains.

Finally, when I install patches, even though it showed 14 Audited Patches, it only installed 1 and then said "completed" is this because there was only 1 patch already downloaded? How does this work?

Thanks so much for your product, the potential is enormous for me. One feature request that I also would love to see is the ability to stop/start a service on a remote computer using your utility. Maybe we can query for services on machine and then choose which service and then control it. Because in order to apply updates, there is one fickle service on our network that we need to manually disable before we patch otherwise stuff hangs. And also be able to easily see that we have space on Drive C:. Because the last thing I want to do is install windows updates remotely and have the system drive go belly up.

Thanks,
Matt
Coordinator
Feb 1, 2013 at 5:34 PM
Hi Matt,

I'll tackle these questions one at a time:
  1. This error is due to the utility being run on PowerShell V2 under .Net 2.0. Once you update PowerShell to V3 running under .Net 4.0, this error will go away. This is because the method required for the ListViewItem isn't available in .Net 2.0.
  2. This has not been tested in a network where multiple domains are present. The ideal infrastructure is one where the account you are using to run the tool has Administrator rights across all systems. It will probably fail if using an account that doesn't have the rights on another domain due to being unable to supply alternate credentials with this utility. I could make the connection by using psexec with the -u -p switches, but I made a decision not to based on the data being passed on the network as cleartext.
  3. What do you see when you run the Audit Patches report? It could be possible that only one update was downloaded with rest of the updates waiting for that downloaded update to be installed.
  4. This is a possibility to add the ability to Stop/Start other services using the utility.
  5. I do have plans to add a C: drive space column so people can see how much space is left on the drive before performing an update of the system.
Great questions and feature request! If you could, please note these over on the Issue Tracker page: http://poshpaig.codeplex.com/workitem/list/basic
Feb 4, 2013 at 3:04 AM
Thanks for your feedback.

When I install v3 of Powershell on my Windows 7 x64 machine and run PoshPAIG, the error messages that I mentioned in my first post do go away, however now in the GUI it says, "Error when running Audit" whenever I try and run an Audit and "Unable to determine reboot state" when I try and detect reboot state and the Error Report UI doesn't even come up. So, the tool basically becomes no longer useful for me.

Thanks for adding the C:\ space query and the services query that would be great! I completely understand the multiple domains piece. I will run this program on one server in each domain.

Finally, when running this on Windows 2003 servers, since PS 2.0 is all they support, is there any preferred settings that would ensure the best compatibility? Do we need to turn on remote execution or anything? Will .Net 2.0 suffice?
Coordinator
Feb 4, 2013 at 2:32 PM
What does the AuditPatch UI report show? The Error Report UI is more for looking at the internal errors of the utility while the Audit Patch report not only shows you what patches are waiting to be installed, but also an error code if an issue occurs during the audit process. You will see the same type of error with the reboot state detection becuase it uses the same type of COM object for the detection of reboot states and patches. If you are getting something like this: 800706ba, then it is a firewall issue with your server and you will need to open up dynamic RPC on the windows (or other software) firewall.

If you are running the tool on a different system, you will need to make sure that the execution policy is configure to allow the scripts to run. You do not have to worry about the policy on other systems that the utility will be scanning. .Net 2.0 will be fine as the errors with the listview do not affect the scanning.
Feb 7, 2013 at 7:06 AM
Boeprox,

Thanks for your help on all of this, you have been very responsive.

After installing PS 3.0, I cannot get any of the UI Reports to load and I get just an "error with audit" in the notes column for my local computer. I'm not worrying myself with connecting to other computers. Your program worked fine on this exact computer before installing PS v3. Any ideas?


Moving on to another issue...

Here is an error I get on about half of my Windows 2003 servers:
You cannot call a method on a null-valued expression.
At C:\Start-PoshPAIG.ps1:2194 char:31
+ $uiHash.ClearAllMenu.Add_Click <<<< ({
+ Category Info : InvalidOperation: (Add_Click:String) [], Runtime Exception
+ FullyQualifiedErrorID : InvokeMethodOnNull
This error repeats itself many times over on anywhere there seems to be an Add_Click. I have installed .NET 2.0 SP2 and it didn't clear the error. Mind you, it runs fine on about 90 Server 2003 R2's in our environment, so I assume there is some update I'm missing on the other servers that clears this error as it works fine on those and I'm able to use it to do what I need. I did find one other bug. Whenever there is an ignored patch on a machine, your program still thinks there is one outstanding patch to deploy. (In my case there is one ignored patch on a couple of machines, so that's why the number 1)