Local user account created with Powershell is NOT shown in settings "Family & Other people" - windows

I am working on Windows 10 Assigned Access for Desktop for version 1607.
Mission: I need to get Assigned Access to work with Powershell.
Steps done:
I create a new LocalUser account with New-LocalUser and I enable the account with Enable-LocalUser. To check if the account is added, I run Get-LocalUser and see that the account is created (see attachment).
Issue:
To double check I go to the PC settings for Accounts-Family & other people, but I cannot see the new local user account "KioskTest".
I have restarted the computer but the account is not added to "Family & Other people".
I have spent some time on this and I would really appreciate your help, How can I make sure that the added Local user "KioskTest" is shown in the PC Accounts settings-Family & other people, when using Powershell?
I can Set-AssignedAccess, when I do Get-AssignedAccess I can see that it is there. Trouble is, I cannot login to the local user account because I cannot find the account in the settings for the PC.
It's like powershell has "hidden" the local user account from my client computer!!!
ADDED information + updated images:
After some trial and error I found out the following:
Using NET USER username password/ADD --works perfectly! I can find the user account and login as a customer would. The account is part of the LocalGroupMember
The local user account created with New-LocalUser with Powershell does NOT appear in the PC account settings BUT if you click on set assigned access in the Family & other people the system finds the local user account (see attachment). However you cannot login to the account as it seemingly does not have a group membership! Not great for testing :(
Thanks for taking the time,
Karina
See attachment:
Powershell Get-AssignedAccess
PC Account settings Family & other people

In my case it was a group membership issue. I have created some users with powershell new-localuser, but they did not show up in any GUI and I was unable to log on. The users were only visible in powershell with get-localuser and lusmgr. In settings, control panel 'user accounts' and login screen they did not show up.
I just had to add the new users to the local 'users' group. Once this was done, the new users were visible in all settings and available for login.
I was unaware of that local security policy (local policy/user rights assignment/allow log on locally) restricting login to 'Guest,Administrators,Users,Backup Operators'.
Either add the users to one of these groups or add them to the local security policy.

This isn't really a PowerShell issue and might be better suited for SuperUser. But I would guess that this is an issue with group membership. Unfortunately get-localuser doesn't give membership. So something like this would be the PowerShell way to check which user objects belong to which local groups.
Get-Localgroup | % { "`n$($_.name)`n"; get-localgroupmember $_}
Then check through which groups other user objects are a member of and add the KioskTest account to that group using this:
Add-LocalGroupMember -Group "ExampleGroup" -Member "KioskTest"

To validate user is created or not, the below simple command helps. You may try it.
In case user is created you will get below output
Command- net user TestUser2
Output-
User name TestUser2
When user is not present
Command- net user TestUser
output-
The user name could not be found.

I had the same issue. The problem was that when specifying the group I didn´t take into account that before the name of the group needs to go domain or in my case, name of the virtual machine. Therefore the command will look like this:
... -Group "DomainName\ExampleGroup" ...
You can check the existing groups on your machine by typing lusrmgr in Window´s run window.

Related

UserNotLicensed :User does not have license to use <ModernProject> with <ReadOnly> access

I am using below code to create CRM Client
var conn = new CrmServiceClient($#"AuthType=ClientSecret;url={organizationUri};ClientId={clientId};ClientSecret={clientSecret}");
Above code is throwing me "UserNotLicensed :User does not have license to use with access" error
I have also followed this article for creating application user. which is not possible as user needs to be created using power platform.
https://www.ashishvishwakarma.com/Dynamics-365-Single-Tenant-Server-2-Server-Authentication-Azure-Active-Directory-Access-Token/
Mine looks like
Also, as shown in the article I am not able to navigate to "New User" form. It keeps redirecting to Office Admin page. where I am not sure if I have permission to create. Let's say I make Admin do that, will Admin have option to associate User with application ?
creating application user. which is not possible as user needs to be
created using power platform.
what do you mean by this? You first need application user which should be created via Azure AD as app registration as mentioned in article and then you need to go to admin.powerplatfrom.com, select your env and then you see s2s users. Onye you click here it will give you list of all your s2s users (including the one you created). Add this s2s user in your env and assign particular security role (in most cases systemadmin). This should solve your issue

Network .bat with AD User credentials

Morning all,
I am attempting to write a .bat to map a network drive when our users logon. I have the below which works:
#echo off
If Exist S:\ net use s: /delete
Net Use s: \\192.168.1.88\NASData /Persistent:Yes
This maps the drive without a problem. My question, is how do I incorporate the users AD logon credentials please?
I'm aware of /User:User password but I want this to populate the individual users details from AD. Using our Admin account, adding the above line does work, but I'm hoping to be able to pull the users details from AD, rather than putting them in myself. Can this be done please?!
Cheers,
It all depends on how you are running it. Don't run it with admin credentials. You need to run the bat file under the user's credentials - so it needs to be a user logon script.
A user logon script is stored on the domain controllers and then set on the user's AD account, or in a group policy.
Here is a page that describes how to do this with setting the logon script on individual AD accounts: https://www.petri.com/setting-up-logon-script-through-active-directory-users-computers-windows-server-2008
Or by group policy: https://www.petri.com/setting-up-logon-script-through-gpo-windows-server-2008

Blanked a Win10 password but cannot login

Okay, I think I did something stupid here. I had forgotten my Win10 user account (steph) Password. This is an admin account.
1) Using a Linux-type usb-boot utility, I've been able to blank the password. Upon reboot, I entered a blank password but I still cannot login, it seems that my account physically on the computer now doesn't match my Hotmail credentials -or something- and I'm still locked out.
2) Using the same Linux usb boot utility, I've unlocked the 'Administrator' account. Now I can login using the 'Administrator' account but from the Control Panel, I cannot change my own user account (steph) password, the option for it is just not there (perhaps it's because the password is believed to be blank?)
3) Later I've been able to find the piece of paper on which I wrote my original password for my own account.
Q: Is there's a way to set my original password back to what it was in order to unlock my account?
Thanks.
Many Linux usb boot utilities can work with local account only. I suggest you set up a new Microsoft account on your PC, and point it to your old profile directory. Then remove your original Microsoft account from Control Panel.

How to use an unrestricted service token to restrict a service's access to a file

Sue has a standard user account domain account on Windows 10 Pro. She has an application that can run from the command line or as a service. The service runs with her credentials. Using the SC command the service has been assigned an unrestricted sid (SERVICE_SID_TYPE: UNRESTRICTED). The service name is NT SERVICE\MyService. I want to allow Sue full control of a file when running the program from the command line. I want the service to have Read Attributes and Read Extended Attributes access only.
Using the service account I adjusted the security settings on the file by denying the service all access except for Read Attributes and Read Extended Attributes. I added a second entry that gave it Read Attributes and Read Extended Attributes permission. I've confirmed these are the settings by viewing the Effective Access settings in the Advanced Security Settings dialog box: all of the rows in the Effective Access column contain Xs except for Read Attributes and Read Extended Attributes. They have checkboxes. The rows with Xs have "File Permissions" as their "Access limited by" column.
Still the service is able to change the files permissions. I'm not sure what I'm doing wrong and would appreciate any pointers. I'm open to other approaches to achieving the results I'm after.
The per-service SID was working properly. After reviewing Harry's comments and checking the containing folder permissions I got things working. Thanks a lot Harry.

Strange folder creation in windows

I need some help in understanding a problem. Here is the scenario. We have a windows domain controller machine and several machines in that domain. (Everything in windows 2008). In one of the machines in that domain (machine name AlphaSiter) our own custom java based product is installed. To log on into our product, you have to provide a user/password combo which is validated against the active directory. Now here is the scenario.
Log into the domain controller and create a user (say David) in the active directory and set the “User must change password in next login option”.
Go to the machine called AlphaSiter where our custom product is installed and try to login to our product with the newly created user credentials and then change password successfully.
The side affect is that in the AlphaSiter machine in C:\Users the user folder is created..that is c:\Users\David. Also this folder is only created if at the time of user creation the “User must change password in next login option” is set. This user folder is not created if the option is unchecked. We are not creating the folder programmatically from our code. So I am wondering how this folder is getting created.Is it something that windows does internally?
Any help on this would be appreciated as I have to give explanation to our customer ---:)
The user's profile folder is always created when there is some profile information that needs to be stored. It may be some registry settings in HKCU hive.
You can use RegMon to track regitry activity.

Resources