![]() |
#41 |
Major Dude
Join Date: Feb 2007
Posts: 672
|
Well, as far I can see I'm doing exactly the same.
And there is nothing wrong with the parameters I'm passing to LsaEnumerateAccountRights, since it returns no error if the user does have privileges. |
![]() |
![]() |
![]() |
#42 | |
Major Dude
Join Date: Feb 2007
Posts: 672
|
I uploaded a new version of this plugin:
- Added GetUserNameFromSID function - Added GetSIDFromUserName function - Fixed a problem in the RegLoadUserHive function when a user was deleted and then recreated Quote:
code: |
|
![]() |
![]() |
![]() |
#43 |
Junior Member
Join Date: May 2006
Posts: 17
|
Having some trouble with this plugin on my work machine (which is joined to a domain, and I'm logged with a domain account). I keep getting ERROR 2221 (NERR_UserNotFound) from the following:
PHP Code:
2nd MessageBox: "ERROR GetAccountSid" There's a slight delay when calling GetSIDFromUserName (like 1-2 seconds). I've double and triple checked that I have the correct domain and username. I even went as far as pulling the SID from the registry and calling it sequence: PHP Code:
Any ideas? |
![]() |
![]() |
![]() |
#44 |
Major Dude
Join Date: Feb 2007
Posts: 672
|
Hi,
what do you get when using the GetCurrentUserName and GetCurrentDomain functions? And what do you get when using the following command in the DOS cmd: net user {username} /domain (replace {username} with your username)? JP |
![]() |
![]() |
![]() |
#45 | |
Junior Member
Join Date: May 2006
Posts: 17
|
Re: GetCurrentUserName/Domain, these are identical:
PHP Code:
Going back and changing the code above to domain.com\username, still gets me the error, BUT calling GetSIDFromUsername with domain.com and my username, yields the correct SID. What do you make of this? Quote:
|
|
![]() |
![]() |
![]() |
#46 |
Major Dude
Join Date: Feb 2007
Posts: 672
|
Sorry, I was too quick to answer.
The reason is GetUserInfo only works for local accounts... The plugin should be updated to support domain users for GetUserInfo. You can try to use the system plugin to get the information you need: http://forums.winamp.com/showpost.ph...1&postcount=14 Search for NetUserGetInfo in that post. |
![]() |
![]() |
![]() |
#47 |
Junior Member
Join Date: May 2006
Posts: 17
|
Ahh, thanks, I'll give that a whirl.
I posted a response to your questions, but it's pending moderator approval? |
![]() |
![]() |
![]() |
#48 |
Junior Member
Join Date: Jul 2014
Posts: 3
|
Hi folks.
Currently I'm working on creating unicode nsis installer. In ansi version of installer I use UserMgr.dll to receive username and user SID. For unicode installer I need UserMgr.dll to be compiled as unicode too. So I'm just curious if I can download somewhere unicode UserMgr.dll or should I download sources and construct it by myself? Thanks, Roman |
![]() |
![]() |
![]() |
#49 |
Major Dude
Join Date: Feb 2007
Posts: 672
|
Unfortunately there is no Unicode version available yet.
And I don't have time to do the port any time soon... |
![]() |
![]() |
![]() |
#50 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
I've had a quick look at the code and it doesn't seem too hard. It's just the sheer quantity that's the time consuming part. I'll play around with it and see what I can do.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#51 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
So I've added unicode support to this plugin, but I haven't done any testing yet.
I used VS2008 for the development, and I've included the project file along with all the source files and compiled release versions. I used C runtime calls as much as I could, so the source should compile on older compilers with little or no modifications. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#52 |
Major Dude
Join Date: Feb 2007
Posts: 672
|
Hi Jason,
thanks for your update. Did you change the plugin name on purpose from UserMgr to UsrMgr? Now existing scripts are broken. After changing the plugin file name, the UserMgr plugin is working fine in Unicode and Ansi. Thanks again! JP |
![]() |
![]() |
![]() |
#53 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
Whoops, that's a typo on my behalf. But yeah, I haven't tested it, so that's why I didn't notice the name was wrong. Consider this a patch that will hopefully get merged at some point (I was only going to upload the usermgr.c file).
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#54 |
Junior Member
Join Date: Jul 2014
Posts: 3
|
Thanks a lot, Jason!
|
![]() |
![]() |
![]() |
#55 |
Junior Member
Join Date: Mar 2021
Posts: 2
|
very usefull plugin but i missed a password validation function and the possibility to use SID Groups directly as GetLocalizedStdAccountName did not do the trick for me.
AddToGroup, IsMemberOfGroup and RemoveFromGroup now checks if GroupID is in square Brackets "[]", if so it is treated as SID. This will Add, check and remove user Test to builtin\administrators For this test a User "Test" is needed ![]() PHP Code:
(the idea/methode is copied from AccessControl. Thanks ![]() New Function ValidatePassword checks if the given password will be accepted on a given system. PHP Code:
PHP Code:
Error codes can be found here Network Management Error Codes NOTE: NERR_PasswordTooShort (2245) will sometimes be thrown if the password matches or contains the username. This can not be checked beforehand with this function as there is no username given. Some code review would be appreciated. If i don't hear anything wrong, i or hopefully one more experienced user will update the wiki page. NOTE²: I used VS2019 to compile this, so if you use the included unicode/ansi dll file you need to install "Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019" before the use on a machine! Bonus Fixed: RemoveFromGroup, didn't work with NetGroupDelUser (at least on Windows 10) Famous last words: Works for me |
![]() |
![]() |
![]() |
#56 | |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 923
|
Quote:
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
![]() |
![]() |
![]() |
#57 |
Junior Member
Join Date: Mar 2021
Posts: 2
|
didn't know that, thank you
![]() |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|