Get-Username return correctely user on elevated mode

Use this forum to ask questions 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.
User avatar
Lacerda Carlos
Posts: 1
Joined: Wed Nov 01, 2017 10:29 am
Location: Brazil
Contact:

Get-Username return correctely user on elevated mode

Post by Lacerda Carlos » Fri Nov 03, 2017 8:52 am

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 14564 times
_Image2.jpg
_Image2.jpg (93.54 KiB) Viewed 14564 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: 5440
Joined: Thu Aug 18, 2011 4:56 am

Re: Get-Username return correctely user on elevated mode

Post by davidc » Fri Nov 03, 2017 9:42 am

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.