public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Update-EmailAddressPolicy", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Set-UserPhoto", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("New-AddressBookPolicy", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(PSCommandBase.ExecuteCmdlet("Get-MailboxStatistics", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Remove-TransportRule", parms)); }
protected static ICollection <PSObject> ExecuteCmdlet(string cmdlet, bool isNeedDC, PSParameters parms) { if (isNeedDC) { //parms.Add(new PSParameter("DomainController", PreferDC)); } if (cmdlet == null) { throw new ArgumentNullException("cmdlet"); } if (cmdlet.Length == 0) { throw new ArgumentException("cmdlet length is zero", "cmdlet"); } Command item = new Command(cmdlet); foreach (PSParameter parameter in parms) { if (parameter.Value == null) { item.Parameters.Add(parameter.Name); } else { item.Parameters.Add(parameter.Name, parameter.Value); } } ICollection <PSObject> is2 = null; Pipeline pipeline = null; List <object> errorList = new List <object>(); try { lock (sync) { if (_runspace.RunspaceStateInfo.State == RunspaceState.Broken) { _runspace.Close(); ReOpen(); } SubmitSecurity subSecurity = new SubmitSecurity(); if (subSecurity.impersonateValidUser(DomainAdmin, Domain, DomainAdminPass)) { pipeline = _runspace.CreatePipeline(); using (Pipeline pipeline2 = pipeline) { pipeline.Commands.Add(item); is2 = pipeline.Invoke(); if (pipeline.Error != null && pipeline.Error.Count > 0) { foreach (object item1 in pipeline.Error.ReadToEnd()) { errorList.Add(item1); string errorMessage = string.Format("Invoke error: {0}", item1); Log4netHelper.Error(errorMessage); } } } } } } finally { pipeline = null; } return(is2); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Get-ActiveSyncDeviceStatistics", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(PSCommandBase.ExecuteCmdlet("New-MoveRequest", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(PSCommandBase.ExecuteCmdlet("Set-CASMailBox", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(PSCommandBase.ExecuteCmdlet("Enable-MailContact", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(PSCommandBase.ExecuteCmdlet("Get-DistributionGroup", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Remove-AcceptedDomain", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Set-OfflineAddressBook", parms)); }
protected static ICollection <PSObject> ExecuteCmdlet(string cmdlet, PSParameters parms) { parms.Add(new PSParameter("DomainController", PreferDC)); if (cmdlet == null) { throw new ArgumentNullException("cmdlet"); } if (cmdlet.Length == 0) { throw new ArgumentException("cmdlet length is zero", "cmdlet"); } Command item = new Command(cmdlet); foreach (PSParameter parameter in parms) { item.Parameters.Add(parameter.Name, parameter.Value); } ICollection <PSObject> is2 = null; Pipeline pipeline = null; PipelineReader <object> error = null; PSObject obj2 = null; ErrorRecord baseObject = null; try { lock (sync) { SubmitSecurity subSecurity = new SubmitSecurity(); if (subSecurity.impersonateValidUser(DomainAdmin, Domain, DomainAdminPass)) { pipeline = _runspace.CreatePipeline(); using (Pipeline pipeline2 = pipeline) { pipeline.Commands.Add(item); is2 = pipeline.Invoke(); error = pipeline.Error; if (error.Count == 1) { obj2 = (PSObject)error.Read(); baseObject = (ErrorRecord)obj2.BaseObject; throw baseObject.Exception; } if (error.Count <= 1) { return(is2); } int count = error.Count; int num2 = 0; ErrorRecord record2 = null; while (error.Count > 0) { obj2 = (PSObject)error.Read(); baseObject = (ErrorRecord)obj2.BaseObject; if (record2 == null) { record2 = baseObject; } num2++; } throw record2.Exception; } } return(is2); } } finally { pipeline = null; } }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Get-ComplianceSearchAction", false, parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(PSCommandBase.ExecuteCmdlet("Set-MailboxRegionalConfiguration", parms)); }
public static ICollection <PSObject> ExecuteCmdlet(PSParameters parms) { return(WSCommandBase.ExecuteCmdlet("Remove-AddressList", parms)); }
public new static ICollection <PSObject> ExecuteCmdlet(string cmdlet, PSParameters parms) { return(WSCommandBase.ExecuteCmdlet(cmdlet, parms)); }