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

The WebProxy property may not exist #5

Open
re3turn opened this issue Jul 24, 2022 · 2 comments
Open

The WebProxy property may not exist #5

re3turn opened this issue Jul 24, 2022 · 2 comments
Assignees

Comments

@re3turn
Copy link
Contributor

re3turn commented Jul 24, 2022

#4 has not fixed #3

That's the webProxy of the failed EC2 instance

PS C:\Users\Administrator\Documents> $objSession = New-Object -ComObject "Microsoft.Update.Session"
PS C:\Users\Administrator\Documents> $objSession | Format-List


ClientApplicationID :
ReadOnly            : False
WebProxy            :
UserLocale          : 1033



PS C:\Users\Administrator\Documents> $objSession.WebProxy
PS C:\Users\Administrator\Documents> 

That's the webProxy of the my local Windows OS

PS C:\Users\Administrator\Documents> $objSession = New-Object -ComObject "Microsoft.Update.Session"
PS C:\Users\Administrator\Documents> $objSession | Format-List


ClientApplicationID :
ReadOnly            : False
WebProxy            : System.__ComObject
UserLocale          : 1041

PS C:\Users\Administrator\Documents> $objSession.WebProxy

Address            :
BypassList         : System.__ComObject
BypassProxyOnLocal : False
ReadOnly           : False
UserName           :
AutoDetect         : True
@ceshihao
Copy link
Owner

ceshihao commented Jul 29, 2022

It looks like that error comes from oleutil.GetProperty(updateSessionDisp, "WebProxy")

webProxyDisp, err := toIDispatchErr(oleutil.GetProperty(updateSessionDisp, "WebProxy"))
if err != nil {
return nil, err
}

The function returns Exception occurred. (<nil>) but not nil IDispatch.
Could you please help to dig more, why it happens on EC2 instance? I do not have much experience on EC2 Windows.

@ceshihao ceshihao self-assigned this Jul 29, 2022
@re3turn
Copy link
Contributor Author

re3turn commented Jul 31, 2022

It was found that some ComObject could not be accessed when connecting remotely.

https://stackoverflow.com/questions/7078958/powershell-remote-microsoft-update-session-access-denied-0x80070005

PS C:\Users\Administrator> $objSession = New-Object -ComObject "Microsoft.Update.Session"
PS C:\Users\Administrator> $objSession | Format-List


ClientApplicationID :
ReadOnly            : False
WebProxy            : System.__ComObject
UserLocale          : 1033



PS C:\Users\Administrator> Set-ExecutionPolicy RemoteSigned -Force
PS C:\Users\Administrator> Set-WSManQuickConfig -Force
WinRM is already set up to receive requests on this computer.
WinRM has been updated for remote management.
Configured LocalAccountTokenFilterPolicy to grant administrative rights remotely to local users.

PS C:\Users\Administrator> Enter-PSSession -ComputerName localhost
[localhost]: PS C:\Users\Administrator\Documents> $objSession = New-Object -ComObject "Microsoft.Update.Session"
[localhost]: PS C:\Users\Administrator\Documents> $objSession | Format-List


ClientApplicationID :
ReadOnly            : False
WebProxy            :
UserLocale          : 1033



[localhost]: PS C:\Users\Administrator\Documents> $objSession.WebProxy
[localhost]: PS C:\Users\Administrator\Documents>

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

2 participants