DocumentConfigMgrCB icon indicating copy to clipboard operation
DocumentConfigMgrCB copied to clipboard

Many of the Get-WMIObjects don't work

Open russrimm opened this issue 5 years ago • 11 comments

Invalid Namespace happens on the Get-WMIObjects because it tries to connect to the WMI class for the children sites (primary and secondaries) but uses the -Computername of the CAS. Those namespaces of course don't exist on the CAS so it should connect to each SMSProvider of each site server instead.

russrimm avatar Aug 02 '19 16:08 russrimm

Unfortunately I have no experience in a CAS environment and don't have one in lab to make or test the script with. So, I really don't know what the changes would look like.

paulwetter avatar Sep 05 '19 03:09 paulwetter

If anyone has a CAS that want to assist with tackling this, let me know. But not a high priority for me right now.

paulwetter avatar Sep 25 '19 16:09 paulwetter

I have access to a CAS with 2 Primary sites for awhile. I'll work on the issues Russ mentioned. If there is anything else that should be checked let know.

ChadSimmons avatar Aug 19 '20 03:08 ChadSimmons

@russrimm I'm getting pretty close to having the script ready for a 2nd set of eyes. The environment I'm using has a CAS running v1810 (for a few more weeks) with 2 Primaries, but no Secondaries. Do you still have access to an environment to test it against?

ChadSimmons avatar Aug 28 '20 11:08 ChadSimmons

@ChadSimmons Hello, I've a test environment with a CAS and 2 Primaries. I would like to test your version.

CCWT avatar Nov 03 '20 15:11 CCWT

@ChadSimmons Hello, I've a test environment with a CAS and 2 Primaries. I would like to test your version.

Great! I'll touch base with you later this week @CCWT.

ChadSimmons avatar Nov 03 '20 15:11 ChadSimmons

@CCWT, get the test code from this GIST and try it out. I don't think I've gotten though every line of code yet, but the first 1000+ lines of code should be good. https://gist.github.com/ChadSimmons/a802b63b940a83a9674d618812f7124c

ChadSimmons avatar Nov 06 '20 03:11 ChadSimmons

@ChadSimmons I've tested your new version. It detects now the childsites correct and the namespace errors are disappeared. But now the script throws errors because it try to add a key that is already there. (Function Get-PWCMDiscoveryMethod) error.log

CCWT avatar Nov 06 '20 18:11 CCWT

@CCWT ... yes, I was seeing that too. I'll need some time to work though it. @paulwetter ... are you opposed to me moving some of the code to functions? That may be the best way to solve this issue.

I'm also getting a bit concerned about the number of changes required to make this work. Merging the changes back in may be problematic.

ChadSimmons avatar Nov 06 '20 21:11 ChadSimmons

I haven’t looked to see what the changes look like but, I’d be fine with it as long as it doesn’t turn into double code. For instance get-pwcmdisoverymethodsPS for a primary site and then a slightly different get-pwcmdiscoverymethodsCAS to handle CAS differences. If that makes sense. And maybe it needs to be double code. I’m really blind to a CAS structure. Wish I had a lab with one to know it better.

Some of the newer stuff, that’s sort of what I have been trying to do is the data collection in a function and then the display as part of the main body. So, that sort of functioning, all for it.

paulwetter avatar Nov 07 '20 01:11 paulwetter

@CCWT and @paulwetter ... I put in a bunch of time in Nov and Dec working though the challenges, but I don't have much tangible to show for it yet. I started with moving the DP details to a function but got bogged down. I'm not giving up, but it may be 2 months before my workload at work and home lighten up enough that I can make some meaningful progress.

ChadSimmons avatar Jan 08 '21 18:01 ChadSimmons