Open re3turn opened 2 years ago
It looks like that error comes from oleutil.GetProperty(updateSessionDisp, "WebProxy")
https://github.com/ceshihao/windowsupdate/blob/94efa1c2d8dba7e7d81522507728ec8053d33c12/iupdatesession.go#L45-L48
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.
It was found that some ComObject could not be accessed when connecting remotely.
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>
4 has not fixed #3
That's the webProxy of the failed EC2 instance
That's the webProxy of the my local Windows OS