Get-Username return correctely user on elevated mode

Use this forum to ask questions after your subscription maintenance expires or before you buy. Need information on licensing or pricing? Questions about a trial version? This is the right place for you. No scripting questions, please.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
Lacerda Carlos
Posts: 1
Last visit: Mon Nov 13, 2017 2:06 am

Get-Username return correctely user on elevated mode

Post by Lacerda Carlos »

To help you better we need some information from you.

*** Please fill in the fields below if you are currently using a Trial Version of the Product. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: 7.2.94.0
32 or 64 bit version of product: 64 Bits
Operating system: Windows 7 Pro
32 or 64 bit OS: 64 Bits

How tho return correctely username from function Get-Username, this retrieves a elevated user name "ADMINISTRATOR" and should return the current logged in.
_Image1.jpg
_Image1.jpg (112.71 KiB) Viewed 15875 times
_Image2.jpg
_Image2.jpg (93.54 KiB) Viewed 15875 times
https://www.sapien.com/blog/2017/01/19/ ... nistrator/
viewtopic.php?f=11&t=10992&p=59504&hili ... ted#p59504
viewtopic.php?f=11&t=10970&p=59399&hili ... ame#p59399
https://info.sapien.com/index.php/packa ... inistrator

Thank you.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Get-Username return correctely user on elevated mode

Post by davidc »

When you use the RunAs user option, it runs the script under the specified user instead of the current user. To run as the current user but still use the other account’s privileges, use the Impersonate user option.
David
SAPIEN Technologies, Inc.
This topic is 6 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.