Query users by login name
Hello,
is it posssible, with the EDK 5.1, to search a user just with his login name ?
Thanks
hi Daniel,
and some sample codes
Where-used list of an attribute (either display or navigational)
Query-InfoObject - Tables
Table name/FM that give query definition details
Link technical name and query name
hope this helps.
Similar Messages
-
# How to get the system AD Domain user login name in portal?
when a system user use AD Domain method login the system.
and then the user open the portal web application page, but not use AD Domain name login in portal page, that time ,I want to catch the user system login name show in portal page?
I hava try the sereval method with Java or Jsp, or User Cookies ActiveX pulg,I get only the name of the portal hostname.
so Anyone will provider me a well method to get the user login name?Elobrate more on ur problem
-
How to search a user just with his login name ?
I want to read some properties of a user n i have only the 'Login name' of that user(the Login name available with me is of the different user and not of the logged in user)
Help me out :_|It sound like you want to do a basic user search?
Here is how we do it in .NET for our custom user search portlet:
private IPortletContext portletContext;
protected DataGrid dgResults;
private DataTable resultsTable = null;
protected System.Web.UI.WebControls.Label lblMessage;
protected System.Web.UI.HtmlControls.HtmlTableCell resultsCell;
private void Page_Load(object sender, System.EventArgs e)
portletContext = PortletContextFactory.CreatePortletContext(Request,Response);
string searchString;
searchString = Request.QueryString["TextName"];
// build up a search request for the matching users
IRemoteSession prcSession = portletContext.GetRemotePortalSession();
ISearchFactory searchFactory = prcSession.GetSearchFactory();
IPortalSearchRequest searchRequest = searchFactory.CreatePortalSearchRequest();
IUserManager userManager = prcSession.GetUserManager();
ObjectClass[] objectTypes = {ObjectClass.User};
searchRequest.SetObjectTypesToSearch(objectTypes);
if( !searchString.Equals("")){
IFilterClause generalClause = searchFactory.CreateAndFilterClause();
generalClause.AddStatement(PlumtreeField.NAME, Operator.Contains, searchString);
Field[] fieldsToReturn = {
(Field) PortalField.ForID(156), // 156 = Company
(Field) PortalField.ForID(157), // 157 = Address
(Field) PortalField.ForID(163), // 163 = Address2
(Field) PortalField.ForID(162), // 162 = City
(Field) PortalField.ForID(159), // 159 = State
(Field) PortalField.ForID(158), // 158 = Zip Code
(Field) PortalField.ForID(222), // 222 = Location
searchRequest.SetFieldsToReturn(fieldsToReturn);
searchRequest.SetQuery("*", generalClause);
ISearchResponse searchResponse = searchRequest.Execute();
ISearchResultSet resultSet = searchResponse.GetResultSet();
System.Collections.IEnumerator results = resultSet.GetResults();
// build up our data table, we will bind this to the data grid once populated
resultsTable = new DataTable("ResultsTable");
System.Data.DataColumn key = new DataColumn("name", System.Type.GetType("System.String"));
resultsTable.Columns.Add(key);
resultsTable.Columns.Add("title", System.Type.GetType("System.String"));
resultsTable.Columns.Add("phonenumber", System.Type.GetType("System.String"));
resultsTable.Columns.Add("address", System.Type.GetType("System.String"));
System.Data.DataColumn[] keycolumn = { key };
resultsTable.PrimaryKey = keycolumn;
while (results.MoveNext())
IPortalSearchResult result = (IPortalSearchResult) results.Current;
//string viewProfileLink = "<pt:standard.openerlink pt:objectid='" + result.GetObjectID() + "' " +
// "pt:classid='1' pt:mode='2' target='userProfileResult'>" + result.GetName() + "</pt:standard.openerlink>";
string address = result.GetFieldAsString((Field) PortalField.ForID(157));
string address2 = result.GetFieldAsString((Field) PortalField.ForID(163));
string city = result.GetFieldAsString((Field) PortalField.ForID(162));
string state = result.GetFieldAsString((Field) PortalField.ForID(159));
string zip = result.GetFieldAsString((Field) PortalField.ForID(158));
string location =result.GetFieldAsString((Field) PortalField.ForID(222));
string fullAddress = "";
//added in location
if(location !="" &&location!=null) fullAddress+= location+"<br/>";
if(address != "" && address != null) fullAddress += address + "<br/>";
if(address2 != "" && address2 != null) fullAddress += address2 + "<br/>";
fullAddress += city + " " + state + " " + zip;
string name = "<a href='mailto:" result.GetFieldAsString((Field) PortalField.ForID(258))"'>"+result.GetName()+"</a>";
// add all of the users to our results table
object[] newUserRow = { //result.GetName(),
name,
result.GetFieldAsString((Field) PortalField.ForID(153)), // Title
result.GetFieldAsString((Field) PortalField.ForID(152)), // Phone
fullAddress,
resultsTable.Rows.Add(newUserRow);
// bind the table to the grid
resultsTable.DefaultView.Sort = "name";
dgResults.DataSource = resultsTable.DefaultView;
dgResults.DataBind();
if(resultsTable.Rows.Count < 1)
dgResults.Visible = false;
Label lblNoResults = new Label();
lblNoResults.Text = "The current search '" + Request.QueryString["TextName"] + "' returned 0 results.";
resultsCell.Controls.Add(lblNoResults);
resultsCell.Width = "100%";
resultsCell.Align = "center";
resultsCell.Style.Add("padding-top","5px");
Edited by geoffgarcia at 08/02/2007 12:59 PM -
Need to remove Authentication Source Category from login name
We are synchronizing with an LDAP and need the loginname to NOT include the auth source category, but cannot find an option to do this. The LDAP is called passport. After synch the user's login name is passport\jtokeeffe. We have a script to remove the passport prefix but every time we run the LDAP job to only bring in NEW users, it resets all the existing user's loginnames. The problem is, the username that is available in the Request object from the JSR168 container has "passport\jtokeeffe" as the username. Our portlets interact with many different databases and other applications that we are passing user login info to, so we would have to change tons of code to strip of the prepended "passport\". Do we have any other option???
One option would be to write a simple PWS that is run after the AWS that sets a user property called, say, "shortlogin". Then you can pass that property to your remote tier and use it in your portlets. Unless you are sending credentials to your portlets via Basic Auth. Are you?
-
Making user account logins case sensitive?
Hi, just a quick question. Is it possible to make a user account login name case sensitive? Currently I can log on using upper or lower case for the login name however I would rather only the exact login name could be used.
ThanksI had already answered with example.
Re: Making user account logins/passwords case sensitive? -
Capture a user's Windows 2000 login name
How can I capture a Windows 2000 login name from within a JSP or an applet or, better still, from some other code running on the application server from which they're downloaded?
mgulesian, you might want to query the system properties.
System.getProperty("user.name")Please note that this property is subject of security constraints (and there're good reasons for this, read the Java Tutorial, Trail: Essential Java Classes, Lesson: Accessing System Resources for details). For example, web applications running inside Tomcat are not allowed to query this property by default. Think twice before doing this, you have been warned!
HTH, Markus -
I had renamed my user login name and assumed that there will be no change in the settings and files. When I login with the new profile name everything is gone. How can I get back all my files and settings? Please help. Thanks.
You should have asked this before you tried: Changing username or short name- User Account and Short Name- OS X- How to change user account name or home directory name.
-
Match user name (login name) and token
Hi,
I have setup the VDI 3.1 POC evaluation using VMware. It is all working great.
I had 2 other requirements put forth by management:
1) The Windows desktops had to lock the screen when a user removed his/her smart card
2) The card and the user had to be the same. IE. Joe shouldn't be able to use Tom's card to login as Joe.
I fixed issue 1 by using the SRWC Lockscreen addon for SRSS found here: http://wiki.sun-rays.org/index.php/How_To_Section#Sun_Ray_Connector_Lockscreen
However, I cannot seem to fix item 2.
It would seem that this functionality is/should be already builtin. I specified only registered tokens can attach and I registered the appropriate tokens. Then in the VDI Web interface, I specified that Token 1 belongs to Tom and Token 2 belongs to Joe.
However, if I stick in Token 2 card, the login name comes up as Joe (good), but I can change the name to Tom and then login as Tom.
Management doesn't want users who have lost their card to borrow someone else's to get in - they need to report the card lost/stolen and get a new one. This makes sense. However, the system doesn't seem to have any restrictions on this.
What is the point of registering a specific token against a specific user without any enforcement? Seems like the system is broken. It really only functions as a suggestion of what user they should login as.
Is there some way to correct this or implement this functionality?
Thanks,
Jim Nickel
JimIf you really want to change the behavior of the login dialog, then I am afraid that can not be done without some code changes.
What you could do as an alternative is to assign the desktops directly to the token(s), instead of assigning them to the user. Thus demonstrating that Joe/Tom can not access their desktops without having the right smart card. I know that this is not exactly what you want, but maybe that is sufficient for your demo.
So to be precise here:
1. The smart card of Joe (token A) should be assigned to desktop A (or alternatively to desktop pool A) using the Sun VDI admin UI.
2. The smart card of Tom (token B) should be assigned to desktop B (or alternatively to desktop pool B).
3. In addition you should configure these desktops that desktop A has only an account for Joe, and desktop B has only an account for Tom.
If Tom uses the smart card of Joe (token A), he can still login into VDI but then he will not be able to access desktop B - instead he will be offered desktop A. However, the automatic login into the desktop's Windows OS will then not work, because the desktop does not have an account for Tom.
As stated, not exactly what you want, but just to present an alternative here.
- Klaus -
hi friends
i am trying to set peoples or groups field in sharepoint list form with current user login name
here my code
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
<script type="text/javascript">
$(document).ready(function NewItemView () {
var currentUser;
if (SP.ClientContext != null) {
SP.SOD.executeOrDelayUntilScriptLoaded(getCurrentUser, 'SP.js');
else {
SP.SOD.executeFunc('sp.js', null, getCurrentUser);
function getCurrentUser() {
var context = new SP.ClientContext.get_current();
var web = context.get_web();
currentUser = web.get_currentUser();
context.load(currentUser);
context.executeQueryAsync(onSuccessMethod, onRequestFail);
function onSuccessMethod(sender, args) {
var account = currentUser.get_loginName();
var accountEmail = currentUser.get_email();
var currentUserAccount = account.substring(account.indexOf("|") + 1);
SetAndResolvePeoplePicker("requester",account);
// This function runs if the executeQueryAsync call fails.
function onRequestFail(sender, args) {
alert('request failed' + args.get_message() + '\n' + args.get_stackTrace());
function SetAndResolvePeoplePicker(fieldName, userAccountName) {
var controlName = fieldName;
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + controlName + "']");
var peoplePickerEditor = peoplePickerDiv.find("[title='" + controlName + "']");
var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv[0].id];
peoplePickerEditor.val(userAccountName);
spPeoplePicker.AddUnresolvedUserFromEditor(true);
</script>
but it is not working
please help meHi,
According to your post, my understanding is that you wanted to set "peoples or groups" field with current user "login name" in SharePoint list form using JavaScript.
To set "peoples or groups" field with current user "login name”, you can use the below code:
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.js"></script>
<script type="text/javascript">
function SetPickerValue(pickerid, key, dispval) {
var xml = '<Entities Append="False" Error="" Separator=";" MaxHeight="3">';
xml = xml + PreparePickerEntityXml(key, dispval);
xml = xml + '</Entities>';
EntityEditorCallback(xml, pickerid, true);
function PreparePickerEntityXml(key, dispval) {
return '<Entity Key="' + key + '" DisplayText="' + dispval + '" IsResolved="True" Description="' + key + '"><MultipleMatches /></Entity>';
function GetCurrentUserAndInsertIntoUserField() {
var context = new SP.ClientContext.get_current();
var web = context.get_web();
this._currentUser = web.get_currentUser();
context.load(this._currentUser);
context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
Function.createDelegate(this, this.onFailure));
function onSuccess(sender, args) {
SetPickerValue('ctl00_m_g_99f3303a_dffa_4436_8bfa_3511d9ffddc0_ctl00_ctl05_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_UserField', this._currentUser.get_loginName(),
this._currentUser.get_title());
function onFaiure(sender, args) {
alert(args.get_message() + ' ' + args.get_stackTrace());
ExecuteOrDelayUntilScriptLoaded(GetCurrentUserAndInsertIntoUserField, "sp.js");
</script>
More information:
http://alexeybbb.blogspot.com/2012/10/sharepoint-set-peoplepicker-via-js.html
Best Regards,
Linda Li
Linda Li
TechNet Community Support -
Store last user on "Login Window: Name and Password"
I have set my login window to display as "Name and password"
Is there any way to make a certain user always appear in the Username box - much like you can do on Windows? Basically, I want to only have to enter in a password and not the username everytime.
Thanks in advance.I think the only way to do that is to set your login window to show "list of users" instead of "name and password". Why don't you do that?
-
I have a script which displays locked out accounts. It works great.
I'd like to display the fully qualified Active Directory Login Name instead of the LastName, First Name:
Example: Davis, Susan
Want instead: Domain\Susan.Davis
I'd also like to include an additional filter to look for only Domain\Susan.Davis OR Domain\Robin.Givens
Here is my script:
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1000
$objSearcher.Filter = "(&(objectClass=User)(lockoutTime>=1))"
$colProplist = "name","samaccountname"
foreach ($i in $colPropList){$objSearcher.PropertiesToLoad.Add($i) | out-null}
$colResults = $objSearcher.FindAll()
foreach ($objResult in $colResults) {
$domainname = $objDomain.name
$samaccountname = $objResult.Properties.samaccountname
$user = [ADSI]"WinNT://$domainname/$samaccountname"
$ADS_UF_LOCKOUT = 0x00000010
if(($user.UserFlags.Value -band $ADS_UF_LOCKOUT) -eq $ADS_UF_LOCKOUT) {
$objResult.Properties.name
John
JohnSorry, I should have mentioned that the cmdlets I'm using are part of the Active Directory module. You'll need to install the RSAT (Win7+) to use them.
If you'd rather stick with your DirectorySearcher methods instead of moving to the AD module, you can adjust your output by using something like this instead:
if(($user.UserFlags.Value -band $ADS_UF_LOCKOUT) -eq $ADS_UF_LOCKOUT) {
"$domainname\$($objResult.Properties.samaccountname)"
$domainname might not be what you're expecting, just FYI.
As for filtering, you can add to the if statement and check for your known usernames only.
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing) -
Postfix/sendmail fatal: no login name found for user ID
We have a xserve setup to host our rails application, but we can't get it to send any emails. Prior to the leopard upgrade it was sending them fine. The mail service is started and running, the settings are basically the default with the hostname and domain name changed, but in the logs we keep getting:
postfix/sendmail[48887]: fatal: no login name found for user ID 501
Ideas?
Thanks,
SteveA reboot of the system fixes the problem for a few hours but does not solve the issue. I guess I could reboot the machine every couple hours but that sounds more like a m$ solution...
Does anyone think a rebuild of the OD data might help? -
Fatal: no login name found for user ID
I have this problem from time to time, when it happens every app running on the box is screwed and I have to reboot. There is a user ID 502, and it start working again immediately after reboot. Any suggestions?
Nov 18 09:44:31 hostname postfix/sendmail[75305]: fatal: no login name found for user ID 502
Nov 18 09:44:31 hostname postfix/sendmail[75310]: fatal: no login name found for user ID 502
Nov 18 09:44:31 hostname postfix/sendmail[75315]: fatal: no login name found for user ID 502
Nov 18 09:44:31 hostname postfix/sendmail[75320]: fatal: no login name found for user ID 502A reboot of the system fixes the problem for a few hours but does not solve the issue. I guess I could reboot the machine every couple hours but that sounds more like a m$ solution...
Does anyone think a rebuild of the OD data might help? -
Getting login names of the users.
Hi,
Does anybody have an idea of getting login names of the user present in the plumtree.IPortletContext edk = PortletContextFactory.CreatePortletContext(Request, Response);
IPortletUser IUser = edk.GetUser();
userName = IUser.GetUserName(); -
on start up I get the message "C:\users\login
name\Appdata\local\temp\225704Log.in iiss Lost"
I've gorn though so many discussions on this trying to fix it I've
do everything and it is still poping up every time i turn my desktop on what do i do?Hi,
The suggestion provided by Maffiow is worthy to try. Msconfig can tell you some on things loaded on startup. Do any of the items listed refer to that file?
In addition, it states that your windows 7 is missing some system files. And definitely it would be some important to file to your windows. You better check it with performing a Clean Boot.
How to perform a clean boot to troubleshoot a problem in Windows 8, Windows 7, or Windows Vista
http://support.microsoft.com/kb/929135
The path which you have shown here is a path for temporary file. I think there will be something wrong with your system temp folder. For this Clear the redundant files in temporary folder. You can do this by performing the following steps.
a. Restart the computer to Safe Mode.
b. Click Start and click Control Panel.
c. Click Classic View and choose Folder Options.
d. Click View tab, choose Show hidden files and folders box, click Apply and click OK.
e. Click Start -> Computer.
f. Go to C:\Users\your user name\AppData\Local\Temp folder.
g. Select all files in the Temp folder and delete them. Click Yes when prompted.
h. Restart the computer to Normal Mode for a test.
Hope it helps.
Regards,
Blair Deng
Blair Deng
TechNet Community Support
Maybe you are looking for
-
Hi, Anybody help me regarding following issue where to assign rounding off for excise duty (BED,Ecess,HEcess) Regards, vivek
-
In some Personal Information iViews, Edit Button is missing
Hi, Here I'm working on ERP2005 (EP7.0), I found that there is no Edit Button in the (WebDynpro)iViews like Address, Bank Info, Personal Data. But the Edit button is coming for Family Member/Dependents, Emergency Contact. Could Any body help me in tr
-
i would like to recover my purchases from I tunes. how do I go about doing that?
-
SB Live 5.1 DE and SB Live
hi. i bought an SB Li've 5. sound card recently. but when i tried playing an AC3 file with the creative play centre i couldnt. later i discovered that there is no AC3 codec on the SB Li've Card. but it wuz available on th old card, DE 5.. Also when i
-
What do you do when the computer won't recognize the ipod attached by the USB cord?
when I attach the USB cord to the computer it says that the device is not recognized. How do you fix that?