-
Feb 23rd, 2021, 11:29 AM
#1
Thread Starter
Junior Member
How to Revert Identity Impersonation to original user
I'm using the following code to set the identity impersonation at runtime, but when it calls undoImpersonation() it sets the identity to IIS APPPOOL\DefaultAppPool. Instead of DefaultAppPool, how can I revert back to the original user identity?
Last edited by Rhodo; Feb 26th, 2021 at 08:17 PM.
-
Feb 23rd, 2021, 12:20 PM
#2
Re: How to Revert Identity Impersonation to original user
I haven't tested but theoretically if you put USING in the impersonate then when the code steps out of using it will revert back.
You can do a test, here is a sample of using (look post no #7)
https://www.vbforums.com/showthread....(User-folders)
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Feb 23rd, 2021, 12:43 PM
#3
Thread Starter
Junior Member
Re: How to Revert Identity Impersonation to original user
sorry I'm new to vb.net, do you mean like this:
Last edited by Rhodo; Feb 26th, 2021 at 08:17 PM.
-
Feb 23rd, 2021, 01:09 PM
#4
Re: How to Revert Identity Impersonation to original user
I haven't ever tried to revert, so Just look at the example I linked to , just do not try to revert anything, put your code inside the using and when the using ends, see if it reverted to he previous context.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Feb 23rd, 2021, 02:13 PM
#5
Thread Starter
Junior Member
Re: How to Revert Identity Impersonation to original user
I figured it out. Thank you Sapator!
Last edited by Rhodo; Feb 26th, 2021 at 08:10 PM.
-
Feb 23rd, 2021, 02:48 PM
#6
Re: How to Revert Identity Impersonation to original user
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|