Impersonation through C# is not working - sending wrong CallingID

Hello,
I need to modify the UserQuery entity, but per securities I can't update this unless it's updated as each individual user.  So I've written a piece to update it using Impersonation by setting the CallerID.  Below is a snippet of the code:
using (OrganizationServiceProxy proxy = new OrganizationServiceProxy(SvcMgt, Creds))
Guid OwnerID = new Guid("0c5b54bb-f2ab-e411-94aa-005056843a89");
proxy.CallerId = OwnerID;
Guid UserQueryId = new Guid((row["UserQueryId"].ToString()));
ColumnSet attributes = new ColumnSet(new string[] { "fetchxml"});
Entity userquery = new Entity("userquery");
userquery = proxy.Retrieve(userquery.LogicalName, UserQueryId, attributes);
userquery["fetchxml"] = row["FixedFetchXML"].ToString();
proxy.Update(userquery);
When I run this I get the error below:
System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: 
SecLib::AccessCheckEx failed. Returned hr = -2147187962, 
ObjectID: 428e02bb-acb3-e411-94aa-005056843a89, 
OwnerId: 0c5b54bb-f2ab-e411-94aa-005056843a89,  
OwnerIdType: 8 and 
CallingUser: e0d62cbb-86d6-e411-94aa-005056843a89. 
ObjectTypeCode: 4230, 
objectBusinessUnitId: 45072abb-5187-e211-86aa-005056b07049, 
AccessRights: Read
Access  (Fault Detail is equal to Microsoft.Xrm.Sdk.OrganizationServiceFault).
The CallingUser is me, but I assumed this would be the user I'm trying to impersonate given I've set that GUID as the CallerID.  What am I missing?
Thanks in advance for any suggestions.

Thanks for the options.  What I'm seeing now is my Impersonation code is working when I set the CallerId, but it's not working congruently across all users.  For example I have two users, and I can run the following for one user and it creates
the Contact under that user, but if I change the CallerId to another User's GUID it creates the Contact under me and not that second user:
using (OrganizationServiceProxy proxy = new OrganizationServiceProxy(SvcMgt, Creds))
proxy.CallerId = new Guid("BBC683AA-3E8B-E211-98BB-005056B07049");
Guid NewContact;
Entity contact = new Entity("contact");
contact["firstname"] = "Test2";
contact["lastname"] = "Test2";
NewContact = proxy.Create(contact);
System.Console.WriteLine(NewContact.ToString());
At this point I believe my code is valid and working, because under the user that it works on the correct user is setup as the ModifyBy, CreateBy, etc  but I'm setup as the ModifiedOnBehalfBy and CreatedOnBehalfBy.  And I've even tested this with
updating the User Query entity, for some I can modify their Query successfully but for the same ones that won't allow me to setup a new Contact for them I can't update the User Query entity as them either.
So my question now is why does Impersonation work on some users but not on others.  I've compared the profiles of users that it does and doesn't work on, but I can't find any difference.
Thanks --

Similar Messages

  • The two finger cycle through apps does not work?

    Hello,
    I don'nt know what is wrong, but it seems that the two finger gesture allowing to cycle through apps does not work for me. I  am using a standard mac Bluetooth mouse. 
    Can anyone help me with this?
    Thank you
    Sebastien  Dion
    from Quebec city, Canada

    Download a free app. It reauthorizes your device for use of your apple id.

  • Since I installed the new OS X Lion, the iCal syncing through iTunes is not working properly.

    Since I installed the new OS X Lion, the iCal syncing through iTunes is not working properly.
    When I sync my MacBook Pro with my iPhone and iPad, the events set in both devices (iPhone & iPad) are not transfered to the iCal on my labtop. Events created in both devices are transfered and copied betwen them when I sync them with the iTunes app (through the MacBook Pro) but they are not trasfered/copied into the labtop (iCal). The events created in the iCal (on my MacBook) are tranfered to the devices as two events on same hour. One, with the description created on the iCal, and the other as a New Event (no description). This is happening since I installed the new OS X Lion last week.
    I file a report and talked with an Apple Support Representative, but they could not help me. They have not receive any other reports on this matter. Do someone has confronted this issue. I need to find out how to solve this problem.
    Regards,
    JAD

    Hi Sydness,
    Thank you very much for your help. It just worked fine. I have 4 macs in my company for 25 years (one is updated each year), and it is the first time I could not solve a problem for weeks. It gave me the opportunity to join this great community.
    Charles
    Sydness wrote:
    I reset my SyncServices and the calendar sync worked perfectly after that.
    I followed the instructions found here:
    http://support.apple.com/kb/TS1627?viewlocale=en_US
    Mac OS 10.7.1 - MacBook

  • WakeOnLan (WOL ) through Cisco 870 not working

    Hi,
    I need to allow WOL packets through a Cisco 870W router. Its running IOS version 12.4(9)T
    The WOL magic packet will be coming from VLAN1 (192.168.2.0/24)  and going to FastEthernet4 (192.168.6.0/24).
    The WOL application sends UDP packets on port 9
    Here are the relevant running-config sections
    interface Vlan1
    ip address 192.168.2.30 255.255.255.0
    no ip redirects
    no ip unreachables
    ip directed-broadcast
    no ip proxy-arp
    ip route-cache flow
    ip tcp adjust-mss 1452
    interface FastEthernet4
    ip address 192.168.6.1 255.255.255.0
    ip helper-address 192.168.2.1
    ip helper-address 192.168.2.10
    no ip redirects
    no ip unreachables
    ip directed-broadcast
    no ip proxy-arp
    ip route-cache flow
    duplex auto
    speed auto
    no cdp enable
    I've also found documents recommending I add
    ip forward-protocol udp 9
    which I've added and still nothing. Can anyone tell me why this is not working?
    Thank you.
    Vic.

    Hi Vic,
    The Small Business Support Community is limited to Cisco Small Business Products.
    Your question below relates to a Cisco Classic Product for small offices which our community would not be able to help you with.
    The best area for you to post your question would be at the Cisco NetPro forums: http://forums.cisco.com/eforum/servlet/NetProf?page=main
    Best regards,
    Cindy
    Cindy Toy
    Small Business Community Manager
    Customer Advocacy
    Cisco Systems, Inc.

  • Setting the custom master page through powershell is NOT working

    Hi,
     I am writing the below code to set the  custom master page through powershell.
    But its not working .when i went to site settings-->master page --> in the drodown , the  maste page set is seattle.master ONLY, though my current master page is available in the dropdown.
     Can anyone pls help, whether i am missing in the below :
          Add-PSSnapin Microsoft.SharePoint.Powershell
           $SiteURL = "http://srvr1:22307/sites/SPW5"
        $weburl= $SiteURL
        $Site= Get-SPSite $SiteURL
        $web =  $Site.OpenWeb()
    $web.CustomMasterUrl = "/_catalogs/masterpage/myMasterpage.master"
    $web.MasterUrl = "/_catalogs/masterpage/myMasterpage.master"
    $web.Update()
    Das

    Hi,
    Is it a publishing page? If yes can you try the PowerShell scripts corresponding to the following code snippet?
    var publishingWeb = PublishingWeb.GetPublishingWeb(web);
    publishingWeb.CustomMasterUrl.SetInherit(inheritFromParent, false);
    publishingWeb.CustomMasterUrl.SetValue(masterPageUrl, false);
    publishingWeb.MasterUrl.SetInherit(inheritFromParent, false);
    publishingWeb.MasterUrl.SetValue(masterPageUrl, false);
    I've noticed sometime (not sure though) that Master page doesn't get updated if the inherit property is not updated first.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Loading flash through ajax does not work in IE 6.

    Hi all,
    I am having some problems on a site I'm developing. When I
    load a video from youtube, etc, and do so dynamically through ajax,
    it does not work on IE 6. Mind you it does work on all other
    browsers. This problem happens with multiple copies of IE 6 so it
    is reproducible. Not sure if there are any web devs here but any
    help would be greatly appreciated.

    Well, this probably belongs over in the Flash forum. That's
    where the developer questions go.. It's surely a matter of the way
    the code is written (or possibly the paths to the different
    components. There are security restrictions on certain types of
    loading that may also come into play. Hard to tell without more
    detail.

  • Sound Output through external speakers not working

    For some reason, the sound output to my JBL speaker system that is connected through the headphones jack of my iMac has cut out. When I go to the Sound Preferance panel, under Output, my choices are :
    Internal Speakers
    Soundflower (2CH)
    Soundflower (16CH)
    I have NO idea what these Soundflower things are, and don't see a standard "Headphones" option, which is the jack they are plugged into. I also don't see a way to delete these Soundflower "devices".
    The sound output not working seemed to happen after a power outage in my building, so I'm going to try a powerreset of the iMac, but still not sure what is going on with this Soundflower stuff.

    /System/Library/Extensions/Soundflower.kext and restarting your computer uninstalls Soundflower.
    To remove preference panes, context-click on the preference pane's icon and select the Remove option.
    https://getsatisfaction.com/cycling74/topics/how_to_uninstall
    Long shot, but...
    Open Audio Midi Setup in Applications>Utilities, see the input & output options & KHz setting there, some things will change it for their own use, then not set it back.

  • Smartview v11.1.1.3 drill through reports does not work in grids?

    Hi,
    I'm using v11.1.1.3 and know there is a drill through function to FDM from Smartview grids. I've tried but it does not work in the grids, only works in the forms. However, I'm able to drill through to FDM from workspace grids. Does anyone encounters the same?? Appreciate any kinds advices. Thanks!

    Are you certian that the report is showing an input level cell? Often reports are designed to run at Total dimension members, i.e. <Entity Curr Total> which you can not drill into.

  • DTS (5.1) Audio Through Airport Express: Not Working

    I imported some DTS-encoded WAV files into iTunes, to stream to my audio system via an Airport Express. The AE is connected to the preamp via optical, the WAV files were not converted or modified in any way, and the volume is @ 100% in iTunes.
    The preamp receives the files and the DTS icon lights up, so all seems to be good... except the audio output is 2.0 only. As a test I converted the files to Apple Lossless (since I know the AE has to make that conversion), same result.
    As another test I turned down the volume in iTunes and the audio became white noise, another indication that the files are DTS.
    If I burn an audio CD using iTunes and the same WAV files, and play them on my OPPO player I get 5.1, the final and conclusive proof that the files are properly encoded.
    I know I've read that streaming DTS-encoded audio via the Airport Express is possible, so I'm not sure what I might be doing wrong.
    Any ideas?

    Hi,
    I experienced some DTS files in iTunes, with my AirPort Express some months ago, it was working fine on my Marantz receiver. A few days ago I wanted to listen to them again, only white noise... I wanted to rip by myself a DTS-CD, therefore I found this out. Apparently since AirTunes has been turned to AirPlay, it's not working anymore (?) / the same way.

  • Videoconference through wireless card not working 100% but ethernet is fine

    my system is:
    Macbook Pro, running 10.5.1 and I have an Airport Extreme 802.11g running on bridge mode.
    When I use iChat 4.0 and video chat with a fellow with a similar setup, I have no issues if I connect through the ethernet port of the Airport Extreme base station with the laptop's airport card off, but I cannot start it up through the wireless. The even more curious thing is that if I happen to turn the airport card back on, and then wait for it to set up, then disconnect the ethernet cable, I can then start a video chat through the wireless.
    I have tried changing the port on my iChat configs in Server settings to 443, and that did not work. My only guess is that there is a port issue of some kind. I have made sure that under System Preferences that I have allowed all connections (while testing this) and STILL it will not work.
    Any ideas?
    Message was edited by: ulcain

    Having read many of the posts since Leopard came out regarding the Airport Base Station - I would have to concede that there is something odd about the combination of iChat, the Mac Firewall and a Base Station.
    Now there was a problem with the Mac Firewall at the base 10.5 release and the 10.5.1 basically turned it On.
    Now, for the Base station there does seem that there is almost some interaction between the firewall and the Base Station.
    It appears that if Allow Specifics was set before the 10.5.1 update was done that the firewall my not be fully recognising this.
    The suggestion is to remove all apps from the Allow Specifics list and set the Firewall back to the default Allow All.
    Then it can be reset to Allow Specifics and iChat Re-added to the list.
    8:00 PM Sunday; January 27, 2008

  • Imessage not working sends as a text

    my imessage is not working anymore, i text my friend is aussie all the time (im from new zealand)
    and it tries to send as a txt but i dont have enough credit for it.. my imessage is on, hers is on too
    im outta data but i use my wifi. anyone know whats up?

    This link http://www.apple.com/support/systemstatus/ will give you information if any of the Apple server/services are down. It seems to be alright now, and I don't see where anything was down before.
    @deetillman, I have not had an issue with my iMessage on AT&T today.

  • Internet Service Not Working, sending 404 error

    Hi,
    I just created an Internet Service pointing to a transaction and I published it but it is not working when I click on Start Service and the browser is opened, I know the servername and the url should be well created cause I delete the service name and change it for webgui and then it works so the hostname and port shoud be ok.
    I can not see it either in the SICF transaction under the ITS path I followed the instructions in the Help Manual but is not working and can´t find why, has somebody done this that can help me out?
    Thanx in Advanced!
    Kind Regards,
    Gerardo J

    Hi Tobias,
    Thank you for the Link, I have followed the steps and published the service in the SE80 Transaction, I checked the settings and are correctly pointing to internal ITS, but after I published the Service I start the SICF transaction and can not find my new Service to activate it, I´m looking in /sap/bc/gui/sap/its  Path wich is the Path I have configured into Internet Transaction Server > Test Tab.
    I really apreciate your help!
    Kind Regards,
    Gerardo J

  • Hello, all of a sudden I fell down my system and completely erased all bookmarks. Your progress with restoration does not work, send me ansver,please

    Hello, all of a sudden I fell down my system and completely erased all bookmarks. Your progress with restoration does not work, write me of bookmarks could not be loaded. Please advice on everything because I came and they seriously need it.

    Did your computer crash or did Firefox crash causing the loss of the bookmarks?
    You can check for problems with the places.sqlite database file in the Firefox Profile Folder.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_fix-the-bookmarks-file
    See also:
    *http://kb.mozillazine.org/Lost_bookmarks
    *http://kb.mozillazine.org/Firefox_crashes
    *https://support.mozilla.org/kb/Firefox+crashes

  • LELA icon has red cirle with line through it. Not working.

    On one of my home computers, my Linksys icon in the sytem tray has a red circle with a line thorugh it. It doesn't seem to be working. Tried rebooting, repairing the install, rebooting, uninstalling, rebooting, reinstalling, rebooting, OK I'm all out of reboots. It still doesn't work.
    LELA works OK on two other computers. (All 3 are Vista computers.)

    Gerco, LELA does not work no matter what version.  If it does, consider yourself lucky.  If not, don't waste your time.  It gives incorrect information and makes any troubleshooting of the network difficult from normal procedures due to its interference.  Please remove it from your system as it is not needed for ANYTHING for the router or your network, sorry.  The program that might work better is Network Magic, try that. 

  • ITune is not working, Send Error Report

    before i updated to the newer 7.0.2 iTunes it used to work perfectly fine. Now after i installed it, quick time and iTunes seem to be having a problem. I click on Quick time and it says, Buffer Overrun detected.(then it says my file directory in program files). A buffer overrun has been detetced which has corrupted the programs internal state.The program cannot safely continue execution and must now be terminated.
    Itunes starts up, this agree to liscense agreement pops(sometimes this does not even pop up) up. I check yes and then the iTunes library pops up for about 3-5 seconds. iTunes has encountered a problem and needs to close. We are sorry for the incovenience. (Send error report, Dont send). How do i fix this?

    replying to Duvack
    I click on Quick time and it says, Buffer Overrun detected.(then it says my file directory in program files). A buffer overrun has been detetced which has corrupted the programs internal state.The program cannot safely continue execution and must now be terminated.
    the QuickTime problem will probably be causing your itunes problem. (itunes needs a properly functioning QuickTime in order to work correctly.)
    let's try swapping out your QuickTime.
    head into your Add/Remove programs. uninstall QuickTime.
    Next, we’ll manually remove any leftover program files and folders.
    1. On the Start menu, click My Computer (or double-click My Computer on the Desktop).
    2. In My Computer, open Local Disk.
    3. Open Program Files.
    4. Right-click on the QuickTime folder and click Delete from the shortcut menu.
    5. Navigate to C:\Windows\system32\.
    6. Remove the files QuickTime.qts and QuicktimeVR.qtx.
    7. Restart your computer.
    next, we'll get a fresh copy of QuickTime into your PC by doing a repair install of itunes.
    switch off antivirus and antispyware applications prior to the repair install.
    go into Add/Remove and select itunes. click "Change" and then click "Repair".
    if the repair install goes through okay, restart the PC and try launching itunes again. does it launch properly now?

Maybe you are looking for

  • How can I add a custom property to an object, like a paragraph?

    Hi, We have a merge process that combine multiple document into one and I need to store the filename of the imported file at the beginning of each merge point.   Each document that we merge contains a Title paragraph and I was wrongly assuming that I

  • Trackpad left click not working

    Hi The left click on my trackpad, bluetooth or usb mouse is not working anymore. Macbook 2006 core2duo OSX 10.6.8 (snow leopard) I tried: - reset PRAM(apple+option+p+r) - without battery - boot in safe mode (shift) Without succes. Also tried to disab

  • Print Dialog in Reader 10.0.1

    It seems that in "upgrading" to 10.0.1, Adobe has created its own print dialog which supersedes the driver print dialog. The driver print dialog appeared when choosing Print from Adobe Reader in previous versions, and appears when choosing Print in o

  • Unable to view sent photos

    suddenly, when people send me attached photos, I am unable to download or view them. all I get is something like this: ------=NextPart_001_014001C6F62D.01D8BB60 Content-Transfer-Encoding: 7bit X-Apple-Content-Length: 1136 Content-Type: text/plain; ch

  • Steps to configure adobe form

    Hi, Could anybody please let me know the procedure to configure adobe forms. Im unable to test any application because of system error FPRNUX. Kindly help me out.. Regards