Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
UserID Element

UserID Element (View)

Windows SharePoint Services 3

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Contains the unique ID number of the currently authenticated user of a site, as defined in the UserInfo table of the content database.


<UserID
  AllowAnonymous = "TRUE | FALSE">
</UserID>

Attribute

Description

AllowAnonymous

Optional String.

Minimum: 0

Maximum: Unbounded

The UserID element can be used to compare the value of a field to the current user ID. If the request is anonymous, this element, by default, causes the server to force authentication, which means it must display a dialog box in the browser that asks for a password or else it must initiate Windows NT challenge/response (NTLM). If a user has accounts on multiple subsites or Web applications, the user ID may be different in each case.

The following query returns cases where either the Author or Editor field is equal to the current value of the UserID element, and it returns the results in ascending order with the Title field first, and then the FirstName field.

<Query>
  <Where>
    <Or>
      <Eq>
        <FieldRef Name="Author" />
        <Value Type="Integer">
          <UserID />
        </Value>
      </Eq>
      <Eq>
        <FieldRef Name="Editor" />
        <Value Type="Integer">
          <UserID />
        </Value>
      </Eq>
    </Or>
  </Where>
  <OrderBy>
    <FieldRef Name="Title">
    </FieldRef>
    <FieldRef Name="FirstName">
    </FieldRef>
  </OrderBy>
</Query>
Show:
© 2015 Microsoft