How do you access a user's Profile from a VB Project???



Hello,

In order to access a user's profile in a web code behind funciton,
you'd say

Profile.GetProfile(username)

But you cant do this in a VB project that's part of a web solution.

Here is my code to get and update user's profile in a VB project .

Dim newUserDetails As UserDetails

' create new user details object

newUserDetails = New UserDetails

newUserDetails.name = "john" etc..

' create a new profile with the new user name

Dim newProf As ProfileBase = ProfileBase.Create(userName)

' assign values to the new profile

newProf.SetPropertyValue(ProfilePropertyKey, newUserDetails)

newProf.Save()

The problem is I'm recreating the profile every time.

Instead of this, how can I get the user's profile by username and then
update it? I should be able to update only certain fields in the
profile and not all of them right?

I wrote this

Dim prof As ProfileInfo =
ProfileManager.FindProfilesByUserName(ProfileAuthenticationOption.All,
userName).Item(userName)

but I don't know if I am on the right track.

Your help is appreciated.

Thanks,

Burak

.



Relevant Pages

  • Re: vbscript to Excel
    ... >I have a login script that querys the local ... > user profile size in perperation for Roaming ... > Dim objExcel ...
    (microsoft.public.scripting.vbscript)
  • Re: Finger
    ... dim strbase,strFilter,strAttributes,strQuery ... 'Bind to the user and get the Home and Profile Path ... Set colSessions = objConnection.Sessions ... wscript.echo strComputer & " obtained through the profile server" ...
    (microsoft.public.scripting.vbscript)
  • VB Script Runs W/O Error, But Does Nothing!
    ... I've used this script in the past to change users Terminal Profile in Active ... Dim objWorkbook 'Opens designated Excel Workbook ...
    (microsoft.public.scripting.vbscript)
  • vbscript to Excel
    ... I have a login script that querys the local ... user profile size in perperation for Roaming ... Dim objExcel ...
    (microsoft.public.scripting.vbscript)
  • Re: Redemption Inbox problem + instability
    ... This way both Outlook and Redemption will be using the same physical MAPI ... I bet the existing profile uses cached mode, ... Dim FolderItemsRED As Redemption.RDOFolder ... Dim Folder As Outlook.MAPIFolder = oNS.GetDefaultFolder ...
    (microsoft.public.outlook.program_vba)

Loading