1
Hello!
I am trying to perform a remote access via WMI on a server with domain other than my machine, but when I try to access the following code is returned: Access denied. (0x80070005 (E_ACCCESSDENIED)).
Someone can help me?
Remembering that there are other servers in the same domain as me and in them I can perform remote access normally.
Follows the code:
public class Serviços
{
    Coleções.Serviços _serviçosCol;
    Objetos.Serviço _serviçoObj;
    private System.ServiceProcess.ServiceController[] _serviçosSC;
    public Coleções.Serviços Carregar(string ip, string login, string senha)
    {
        try
        {
            ConnectionOptions options = new ConnectionOptions();
            options.Password = senha;
            options.Username = login;
            options.Authentication = AuthenticationLevel.Connect;
            options.EnablePrivileges = true;
            options.Impersonation = ImpersonationLevel.Identify;
            ManagementScope scope = new ManagementScope("\\\\" + ip + "\\root\\cimv2", options);
            scope.Connect();
            _serviçosCol = new Coleções.Serviços();
            _serviçosSC = System.ServiceProcess.ServiceController.GetServices(ip);
            for (int i = 0; i < _serviçosSC.Length; i++)
            {
                _serviçoObj = new Objetos.Serviço();
                _serviçoObj.Nome = _serviçosSC[i].ServiceName;
                _serviçoObj.Status = _serviçosSC[i].Status.ToString();
                _serviçosCol.Adicionar(_serviçoObj);
            }
            return _serviçosCol;
        }
        catch (Exception _erro)
        {
            throw _erro;
        }
    }
}