Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 4
0
		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;
		}
Exemplo n.º 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;
			}
		}