Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Monday, September 24, 2018 1:58 PM
Using wuapi.dll, i am trying to create a update session of the remote server from my local machine.
Code:
string theServer="TEST-WIN16-202";
string myString1 ="Microsoft.Update.Session";
Type myType1 =Type.GetTypeFromProgID(myString1,theServer,true);
UpdateSession updateSession = (UpdateSession)Activator.CreateInstance(myType1);
Anyone please help me understand why this error comes and why cannot i create update session.
All replies (2)
Monday, September 24, 2018 2:38 PM
The error is an access denied. You're trying to access the COM information on a remote machine and you don't have permissions. For this to work you'd have to be running in the context of a user with permissions on the remote machine. That would pretty much mandate a domain account that works on both machines and possibly elevated privileges.
I've never had to use remote COM objects in C# so I don't know what else you'll need to do. I did search a little and people are recommending using WUAPIInterop instead. Or using WSUS. In both cases they tend to use impersonation to get into the right context. Take a look at one example here.
Michael Taylor http://www.michaeltaylorp3.net
Monday, September 24, 2018 8:58 PM
•