Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error retrieving configuration from webservice #46

Open
Maxiz80 opened this issue Sep 19, 2019 · 15 comments
Open

Error retrieving configuration from webservice #46

Maxiz80 opened this issue Sep 19, 2019 · 15 comments

Comments

@Maxiz80
Copy link

Maxiz80 commented Sep 19, 2019

I keep having this message.
What did I've done wrong?

@codaamok
Copy link

The code currently in the master branch is considered development code. You should download the copy hosted here on TechNet to get the latest stable release.

@Maxiz80
Copy link
Author

Maxiz80 commented Oct 13, 2019

Ok but must be there a mismatch between PS1 and the webservice

@codaamok
Copy link

I'm not sure I understand what you mean, but whatever you do, use the binaries and scripts available at TechNet. Currently, everything that's in this repository is for development only.

@Maxiz80
Copy link
Author

Maxiz80 commented Oct 13, 2019

What I mean is that if I use the ps1 on github i get this error.
And by analyzing source code of webservic something is missing

@codaamok
Copy link

Don't use what's on GitHub for production. Download from technet.

@theaquamarine
Copy link
Contributor

0.8.2 was re-released due to a bug in the web service, are you using a version downloaded before that? The script itself didn't change https://twitter.com/andersrodland/status/1182451197288026112

@Maxiz80
Copy link
Author

Maxiz80 commented Oct 14, 2019

I've downloaded 0.8.2 but I keep having
Error Invoking RestMethod PUT on URI http://srv73pd.safilogroup.com/ConfigMgrClientHealth/Clients/NIEROLO. Failed to update database using webservice. Exception: Errore del server remoto: (400) Richiesta non valida.
powershell exited on nierolo with error code 0.

reverting back to 0.8.1

@codaamok
Copy link

After you updated the webservice, did you restart services?

Failing that, perhaps give recreating the IIS application again (deleting app pool + application under Default Site).

@Maxiz80
Copy link
Author

Maxiz80 commented Oct 14, 2019

Nevermind.
I've found the problem and I don't know if it's a bug..
If I start the ps1 with psexec -s, local system account like with a gpo, I've got this error.
By removing "tag" begin, process and end the ps1 work correctly even with psexec -s
Sorry

@codaamok
Copy link

I don't understand I'm sorry.

What error did you get? And what exactly did you remove to get it working?

@Maxiz80
Copy link
Author

Maxiz80 commented Oct 15, 2019

Error Invoking RestMethod PUT on URI
IIf you run PS1 from interactive powershell it works fine.
But if you start with "psexec -s" in order to simulate an execution with GPO you get this error
BUT by removing the Begin {} Process {} End {},NOT THE CONTENT, all works fine even with psexec -s and with GPO

@AndersRodland
Copy link
Owner

Hi Maxiz, based on the error you receive, it sounds like you downloaded the development version from Github before I put the production version up here.

I recommend you to download the version from technet galleries (https://gallery.technet.microsoft.com/ConfigMgr-Client-Health-ccd00bd7) and use that version of the script together with the webservice included in that package.

@Maxiz80
Copy link
Author

Maxiz80 commented Oct 15, 2019

I've downloaded from technet

@AndersRodland
Copy link
Owner

Then I will look into this, thank you for letting me know. This error message is originally based on a feature I planned to release in 0.8.2 but cut in order to release it. I will keep this issue open until I have identified and fixed it.

@Maxiz80
Copy link
Author

Maxiz80 commented Oct 21, 2019

I think this is a REALLY POWERFUL script.
But for how it's organized it will work only with and interactive run.
If you plan to run via GPO it will never work.
I suggest you to remove Begin { etc etc and leave only function and all the rest
In config file the ClientShare should be a local folder on the PC (I suggest the standard one c:\windows\ccmsetup) and add this after $ClientShare = Get-XMLConfigClientShare
[system.io.directory]::CreateDirectory("$ClientShare")
write-host "$ClientShare"
$url = "http://servername/CCM_Client/ccmsetup.exe"
$output = "$ClientShare\ccmsetup.exe"
(New-Object System.Net.WebClient).DownloadFile($url, $output)
Why this?
Because in this way you avoid to use a share and you use the web service to dowload the setup.
If you want we can continue by email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants