paulwetter / DocumentConfigMgrCB

This script attempts to document your entire Configuration Manager (MEMCM/SCCM) environment
https://wetterssource.com/documentconfigmgrcb
174 stars 45 forks source link

Invalid argument error #60

Closed JaeBee64 closed 3 years ago

JaeBee64 commented 4 years ago

Getting the following error when the script hits the Applications section (error occurs mutliple time)

Get-PWCMPhasedDeployment : Cannot validate argument on parameter 'SiteName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At E:\Scripts\DocumentConfigMgrCB-master\DocumentCMCB.ps1:6690 char:113

And also getting the following errror when processing Task Sequences:

Get-WmiObject : Invalid namespace "Root\SMS\site_DC1" At E:\Scripts\DocumentConfigMgrCB-master\DocumentCMCB.ps1:7509 char:33

Script is still writing to the output file, just errors popping up in the console window. We're running CM1910, site version 5.0.8913.1000, single Primary Site. We're using v3.52 of your script

paulwetter commented 4 years ago

Are you running it remotely of the primary site server?

paulwetter commented 4 years ago

Update Line 6690: $PDs = Get-PWCMPhasedDeployment -DeploymentObjectID $($App.CI_ID) -SiteServer $SiteServer -SiteName $SiteCode

JaeBee64 commented 4 years ago

Yes I was, we have a separate script server for running all scripts.

From: Paul Wetter notifications@github.com Sent: Wednesday, 8 July 2020 11:42 AM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

Are you running it remotely of the primary site server?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-655263908, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M7OGAJBYVHMEOWNUZ3R2PTI5ANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

7509: Missing -ComputerName parameter for WMI Query.

JaeBee64 commented 4 years ago

Ok, thanks for those. I’ll make the specified changes & let you know.

From: Paul Wetter notifications@github.com Sent: Wednesday, 8 July 2020 11:57 AM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

7509: Missing -ComputerName parameter for WMI Query.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-655267775, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M6WTO6DUDTOU2UFJFTR2PVAZANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

Well.... I must have fallen asleep on the couch before I commented. Latest commit v3.53 (f6715806d3105a035fb0675a3a2df8562dc8d190) has those changes applied. See if that does the trick.

JaeBee64 commented 4 years ago

Grabbed your latest script and tried again. Still 1 error:

Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At E:\Scripts\DocumentConfigMgrCB-master\DocumentCMCB.ps1:1950 char:16

From: Paul Wetter notifications@github.com Sent: Wednesday, 8 July 2020 9:36 PM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

Well.... I must have fallen asleep on the couch before I commented. Latest commit v3.53 (f671580https://github.com/paulwetter/DocumentConfigMgrCB/commit/f6715806d3105a035fb0675a3a2df8562dc8d190) has those changes applied. See if that does the trick.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-655523941, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M2SNNXPFGQXFCUB4NLR2RY2RANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

I made a few additional minor bug fixes. Now version 3.54. But, not related to that line giving you the error. It actually looks like an issue with remote WMI from the server you are running it. Can you run wmi queries against your Site server from the server running the scripts?

Try the following query. Replace ABC with your CM site code and ServerName with the name of your server.

Get-WmiObject -Query "SELECT * FROM SMS_PhasedDeployment" -Namespace "ROOT\SMS\site_ABC" -ComputerName ServerName

JaeBee64 commented 4 years ago

I ran the command on the remote server that’s running the script and didn’t receive any errors. I’ll grab your latest script version anyway & try again.

From: Paul Wetter notifications@github.com Sent: Thursday, 9 July 2020 2:17 PM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

I made a few additional minor bug fixes. Now version 3.54. But, not related to that line giving you the error. It actually looks like an issue with remote WMI from the server you are running it. Can you run wmi queries against your Site server from the server running the scripts?

Try the following query. Replace ABC with your CM site code and ServerName with the name of your server.

Get-WmiObject -Query "SELECT * FROM SMS_PhasedDeployment" -Namespace "ROOT\SMS\site_ABC" -ComputerName ServerName

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-655924905, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M2CJAZLP2TC54RTBOLR2VOGBANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

How's this issue looking for you? The latest build resolve all the errors?

JaeBee64 commented 4 years ago

Sorry, I meant to reply to you earlier. Unfortunately it didn’t fix the problem.

From: Paul Wetter notifications@github.com Sent: Friday, 24 July 2020 11:04 AM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

How's this issue looking for you? The latest build resolve all the errors?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-663327030, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M6T5YJ74ULDBLIHLYDR5D22BANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

With the latest script, could you re-post the exact error again? Maybe try running the verbose switch to see what else is going on around at the time....

JaeBee64 commented 4 years ago

I’ve r-run the script, below is the error:

Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) At E:\Scripts\DocumentConfigMgrCB-master\DocumentCMCB.ps1:1950 char:16

From: Paul Wetter notifications@github.com Sent: Friday, 24 July 2020 2:04 PM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

With the latest script, could you re-post the exact error again? Maybe try running the verbose switch to see what else is going on around at the time....

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-663361547, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M3HUM7FWLIXM4QGAZ3R5EP3JANCNFSM4OM6US2Q.

ChadSimmons commented 4 years ago

Doing some validation... Running from a remote Win10 computer and a v2002 stand-alone Primary site , I'm able to run the direct WMI query with error

Get-WmiObject -Query "SELECT * FROM SMS_PhasedDeployment" -Namespace "ROOT\SMS\site_$SiteName" -ComputerName $SiteServer

I ran DocumentConfigMgrCB.ps1 version 3.54 and did not experience the issue, but the site does not have any phased deployments configured.

paulwetter commented 4 years ago

What i don't get is how this is the only one that fails. There are other WMI queries that seemingly are running remotely fine. and if he runs it directly, in powershell, no error... So, I'm missing something to this puzzle. it doesn't add up.

JaeBee64, What account is the script running as? What permission does it have to CM?

JaeBee64 commented 4 years ago

The account has full Administrator access to CM. Also to add to the mystery, we don’t actually have any phased deployments. Could this likely be arising from some error in the SCCM setup? It was setup before I started working here.

From: Paul Wetter notifications@github.com Sent: Thursday, 6 August 2020 2:49 AM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

What i don't get is how this is the only one that fails. There are other WMI queries that seemingly are running remotely fine. and if he runs it directly, in powershell, no error... So, I'm missing something to this puzzle. it doesn't add up.

JaeBee64, What account is the script running as? What permission does it have to CM?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-669397100, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M4SB65ZLLJCHA5KFNDR7GSS5ANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

Wild thought here... Are phased deployments actually enabled in you site under Updates and Servicing, Features?

JaeBee64 commented 4 years ago

We don’t have that option to enable, we’ve recently upgraded to 2002. Phased deployments are available for us to use when deploying apps & Task Sequences however. I’ve attached screenshots, hope they come through.

[cid:image001.png@01D66BDC.227B2040]

[cid:image002.png@01D66BDC.645138B0]

From: Paul Wetter notifications@github.com Sent: Thursday, 6 August 2020 10:07 AM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

Wild thought here... Are phased deployments actually enabled in you site under Updates and Servicing, Features?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-669639930, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M53HQHVY5VPBX64SYTR7IF53ANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

Ok..... Stupid mistake on my part. Not sure why i wasn't seeing it as well in testing.

Anyway. Try version 3.56.

JaeBee64 commented 4 years ago

Hi,

Apologies for the lag in my reply. I ‘ve run the 3.56 version of the script but still getting the following errors:

Object reference not set to an instance of an object. At E:\Scripts\DocumentConfigMgrCB-master\DocumentCMCB.ps1:5575 char:13

From: Paul Wetter notifications@github.com Sent: Thursday, 6 August 2020 1:55 PM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Author author@noreply.github.com Subject: Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

Ok..... Stupid mistake on my part. Not sure why i wasn't seeing it as well in testing.

Anyway. Try version 3.56.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-669718116, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M7VXFF64IDZOQM4VH3R7JAUNANCNFSM4OM6US2Q.

paulwetter commented 4 years ago

These look like new errors in totally different area of script.

The error on line 5590 makes no sense as it is just writing a line of text to the file.

Same for 7356. I am validating that $DriverPackages is not null or empty before writing..

The other 2 locations I tweaked a little but didn't/don't run into errors with them before or now.

  • Exclude Membership rules on collections.
  • Description on Driver Packages.

Try the new version and see if it makes a difference for these new errors.

paulwetter commented 3 years ago

@JaeBee64 you have any follow up on previous issues? These still exist, or have they been resolved?

JaeBee64 commented 3 years ago

Hi Paul,

Apologies, been flat out with stuff. I’ve downloaded & run v3.60 of your script and it completed without any errors at all. Thanks for following up with this.

Cheers

Joe

From: Paul Wetter notifications@github.com Sent: Saturday, 28 November 2020 4:28 PM To: paulwetter/DocumentConfigMgrCB DocumentConfigMgrCB@noreply.github.com Cc: Joe Bertolini [Kinetic IT] Joe.Bertolini@kineticit.com.au; Mention mention@noreply.github.com Subject: [EXTERNAL] Re: [paulwetter/DocumentConfigMgrCB] Invalid argument error (#60)

CAUTION: This email originated from outside Kinetic IT. Do not click links or open attachments unless you recognise the sender and know the content is safe.

@JaeBee64https://github.com/JaeBee64 you have any follow up on previous issues? These still exist, or have they been resolved?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/paulwetter/DocumentConfigMgrCB/issues/60#issuecomment-735105744, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQEI4M6B6GIUXEXG4XDEZDDSSCYCDANCNFSM4OM6US2Q.

paulwetter commented 3 years ago

Excellent. Glad the latest is working for you now. Always appreciate the feedback.