コード例 #1
0
ファイル: ADPasswordUtil.cs プロジェクト: nickchal/pash
		internal static void PerformSetPassword(string partitionDN, ADObject directoryObj, SecureString newPassword)
		{
			ADSessionInfo sessionInfo = directoryObj.SessionInfo;
			using (ADAccountManagement aDAccountManagement = new ADAccountManagement(sessionInfo))
			{
				IntPtr bSTR = Marshal.SecureStringToBSTR(newPassword);
				string stringUni = Marshal.PtrToStringUni(bSTR);
				aDAccountManagement.SetPassword(partitionDN, directoryObj.DistinguishedName, stringUni);
			}
		}
コード例 #2
0
ファイル: ADPathModule.cs プロジェクト: nickchal/pash
		public static string ConvertPath(ADSessionInfo sessionInfo, string path, ADPathFormat fromFormat, ADPathFormat toFormat)
		{
			string str;
			if (fromFormat != toFormat)
			{
				if (fromFormat == ADPathFormat.Canonical && !string.IsNullOrEmpty(path) && CanonicalPath.IndexOfFirstDelimiter(path) == -1)
				{
					path = string.Concat(path, "/");
				}
				using (ADAccountManagement aDAccountManagement = new ADAccountManagement(sessionInfo))
				{
					str = aDAccountManagement.TranslateName(path, fromFormat, toFormat);
				}
				return str;
			}
			else
			{
				return path;
			}
		}