public void SetInformation(NetUserInformation information, string serverName = null) { var userInfo1 = new UserInfo1(information); uint parameterErrorIndex; var result = NativeMethods.NetUserSetInfo(serverName, information.Username, 1, ref userInfo1, out parameterErrorIndex); if (result != SystemErrorCode.ErrorSuccess) { throw ErrorHelper.GetWin32Exception(result); } }
public UserInfo1(NetUserInformation userInformation) { Name = userInformation.Username; Password = userInformation.Password; PasswordAge = userInformation.PasswordAge; Privilege = userInformation.Privilege; HomeDirectory = userInformation.HomeDirectory; Comment = userInformation.Comment; Flags = userInformation.Flags; ScriptPath = userInformation.ScriptPath; }