Exemple #1
0
 protected override void ProcessRecord()
 {
     base.ProcessRecord();
     if (Globals.authToken != null)
     {
         _serverProxy = new ServerCommandProxy(Globals.ComputerName, Globals.Port, Globals.authToken);
         try
         {
             _serverProxy.AddUserToGroup(UserName, GroupName);
             WriteObject(UserName + " added to " + GroupName);
         }
         catch (XmlRpcFaultException fex)
         {
             ErrorRecord errRecord = new ErrorRecord(new Exception(fex.Message, fex.InnerException), fex.FaultString, ErrorCategory.NotSpecified, fex);
             WriteError(errRecord);
         }
     }
     else
     {
         WriteObject("Please run Connect-PcutServer in order to establish connection.");
     }
 }
Exemple #2
0
 protected override void ProcessRecord()
 {
     base.ProcessRecord();
     if (Globals.authToken != null)
     {
         _serverProxy = new ServerCommandProxy(Globals.ComputerName, Globals.Port, Globals.authToken);
         try
         {
             _serverProxy.AddUserToGroup(UserName, GroupName);
             WriteObject(UserName + " added to " + GroupName);
         }
         catch (XmlRpcFaultException fex)
         {
             ErrorRecord errRecord = new ErrorRecord(new Exception(fex.Message, fex.InnerException), fex.FaultString, ErrorCategory.NotSpecified, fex);
             WriteError(errRecord);
         }
     }
     else
     {
         WriteObject("Please run Connect-PcutServer in order to establish connection.");
     }
 }