public ActiveDirectoryNameTranslateResult[] TranslateName(string Server, ActiveDirectoryNameFormat FormatDesired, ActiveDirectoryNameFormat FormatOffered, string[] Names)
        {
            TranslateNameRequest translateNameRequest = new TranslateNameRequest();

            translateNameRequest.Server        = Server;
            translateNameRequest.FormatDesired = FormatDesired;
            translateNameRequest.FormatOffered = FormatOffered;
            translateNameRequest.Names         = Names;
            TranslateNameResponse translateNameResponse = this.Channel.TranslateName(translateNameRequest);

            return(translateNameResponse.NameTranslateResult);
        }
 TranslateNameResponse Microsoft.ActiveDirectory.CustomActions.AccountManagement.TranslateName(TranslateNameRequest request)
 {
     return(base.Channel.TranslateName(request));
 }
 public Microsoft.ActiveDirectory.CustomActions.TranslateNameResponse TranslateName(ADSessionHandle handle, Microsoft.ActiveDirectory.CustomActions.TranslateNameRequest request)
 {
     throw new NotImplementedException();
 }
		TranslateNameResponse Microsoft.ActiveDirectory.Management.IADAccountManagement.TranslateName(ADSessionHandle handle, TranslateNameRequest request)
		{
			TranslateNameResponse translateNameResponse = null;
			AdwsConnection internalHandle = this.GetInternalHandle(handle);
			if (internalHandle != null)
			{
				translateNameResponse = internalHandle.TranslateName(request);
			}
			return translateNameResponse;
		}
Exemple #5
0
		internal string TranslateName(string name, ADPathFormat formatOffered, ADPathFormat formatDesired)
		{
			this.Init();
			TranslateNameRequest translateNameRequest = new TranslateNameRequest();
			translateNameRequest.Names = new string[1];
			translateNameRequest.Names[0] = name;
			translateNameRequest.FormatOffered = this.GetNameFormat(formatOffered);
			translateNameRequest.FormatDesired = this.GetNameFormat(formatDesired);
			TranslateNameResponse translateNameResponse = this._acctMgmt.TranslateName(this._sessionHandle, translateNameRequest);
			ActiveDirectoryNameTranslateResult[] nameTranslateResult = translateNameResponse.NameTranslateResult;
			if (nameTranslateResult[0].Result != 0)
			{
				object[] objArray = new object[1];
				objArray[0] = name;
				throw ExceptionHelper.GetExceptionFromErrorCode(Convert.ToInt32 (nameTranslateResult[0].Result), string.Format(CultureInfo.CurrentCulture, StringResources.TranslateNameError, objArray), null);
			}
			else
			{
				string str = nameTranslateResult[0].Name;
				return str;
			}
		}