How to add user(s) to distribution list group in Office 365 using C#?

I tried below code to add user to distribution list . But command fails to me. Any suggestions?

<!–more–>

string connectionUri = "<a href="https://outlook.office365.com/powershell-liveid/" target="_blank">https://outlook.office365.com/powershell-liveid/</a>" target="_blank">https://outlook.office365.com/powershell-liveid/</a" target="_blank">https://outlook.office365.com/powershell-liveid/</a>";
string loginPassword = ConfigurationManager.AppSettings["PWD"].ToString();
string loginUser = ConfigurationManager.AppSettings["UID"].ToString();
SecureString secpassword = new SecureString();
foreach (char c in loginPassword)
{
secpassword.AppendChar(c);
}
PSCredential credential = new PSCredential(loginUser, secpassword);
Runspace runspace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace();
PowerShell powershell = PowerShell.Create();
PSCommand command = new PSCommand();
command.AddCommand("New-PSSession");
command.AddParameter("ConfigurationName", "Microsoft.Exchange");
command.AddParameter("ConnectionUri", new Uri(connectionUri));
command.AddParameter("Credential", credential);
command.AddParameter("Authentication", "Basic");
powershell.Commands = command;

runspace.Open();
powershell.Runspace = runspace;
Collection<System.Management.Automation.PSObject> result = powershell.Invoke();
if (powershell.Streams.Error.Count > 0 || result.Count != 1)
{
throw new Exception("Fail to establish the connection");
}

powershell = PowerShell.Create();
command = new PSCommand();
command.AddCommand("Invoke-Command");
string DLGroupName = "UnsubscribersList";
command.AddParameter("ScriptBlock", System.Management.Automation.ScriptBlock.Create("Add-DistributionGroupMember -Identity " + DLGroupName + " -Member " + txtEmail.Text));
command.AddParameter("Session", result[0]);
powershell.Commands = command;
powershell.Runspace = runspace;
result = powershell.Invoke();
if (powershell.Streams.Error.Count > 0 || result.Count != 1)
{
throw new Exception("Command failed");
}

I am getting this error while running Add-DistributionGroupMember command

<!–more–>

{Couldn't find object "test11@gmail.com". Please make sure that it was spelled correctly or specify a different object.}

<u>UPDATE:</u>

I tried add email address to contacts then adding to distribution List still get an error.

 using (powershell = PowerShell.Create())
            {
                command = new PSCommand();
                command.AddCommand("Invoke-Command");

                command.AddParameter("ScriptBlock",
                    System.Management.Automation.ScriptBlock.Create(
                        "New-MailContact -Name '" + txtEmail.Text + "' -ExternalEmailAddress '" + txtEmail.Text + "'"));
                command.AddParameter("Session", result[0]);
                powershell.Commands = command;
                powershell.Runspace = runspace;
                result = powershell.Invoke();
                if (powershell.Streams.Error.Count > 0 || result.Count != 1)
                {
                    throw new Exception("Fail to establish the connection");
                }
            }

            using (powershell = PowerShell.Create())
            {
                command = new PSCommand();
                command.AddCommand("Invoke-Command");
                string DLGroupName = "UnsubscribersList";
                command.AddParameter("ScriptBlock",
                    System.Management.Automation.ScriptBlock.Create(
                        "Add-DistributionGroupMember -Identity '" + DLGroupName + "' -Member " + txtEmail.Text + ""));
                command.AddParameter("Session", result[0]);
                powershell.Commands = command;
                powershell.Runspace = runspace;
                result = powershell.Invoke();
                if (powershell.Streams.Error.Count > 0 || result.Count != 1)
                {
                    throw new Exception("Fail to establish the connection");
                }
            }

Error

Cannot convert the "test11@gmail.com" value of type "Deserialized.Microsoft.Exchange.Data.Directory.Management.MailContact" to 
 type "System.Management.Automation.Runspaces.PSSession".

you are using result[0] as an argument for -Session, but the error says that its not a valid session object. Make sure it is a session object before consuming it.

System.Management.Automation.Runspaces.PSSession result = powershell.Invoke();