当前位置:网站首页>Command line add user set password never expires add remote group add administrator group

Command line add user set password never expires add remote group add administrator group

2022-06-23 20:31:00 shawyang

problem : New users cannot log in to the desktop remotely , Report errors User Profile Serives Service login failed , Unable to load user profile

Adding users can be done in one step ( Add user 、 Set password )

It can also be divided 2 Step ( Add users first 、 Post password ), If the step of setting the password is omitted or the step of setting the password is 360 The above problems will occur when the security software intercepts , The solution is simple , Is to set the password for the user , The order is

net user $username $passwd

Adding users is usually done through lusrmgr.msc Graphical interface operations for local users and groups

Add users 、 Set the password 、 Set password never expires 、 Add remote group 、 Add administrator group , These operations can be realized through commands , such as

# Add users and set passwords

NET USER "testuser" "[email protected]" /ADD /Y

# The first step is to join the remote group

NET LOCALGROUP "Remote Desktop Users" "testuser" /ADD

# Step 1: join the administrator group

NET LOCALGROUP "Administrators" "testuser" /ADD

# Set password never expires

Please use this command as an administrator in cmd Command line run

wmic.exe UserAccount Where Name="testuser" Set PasswordExpires="false"

Actually , Report errors 【User Profile Serives Service login failed , Unable to load user profile 】 There are many cases

1、 Added users , No password

2、C:\Users\ The directory has a hidden Default Catalog , Deleting this directory will affect

3、 because profsvc Services depend on the underlying rpcss service , And rely on rpcss There are a lot of other services , rely on rpcss The conflicting effects of different services may lead to such exceptions

sc.exe enumdepend rpcss 35000|findstr SERVICE_NAME > c:\servicelist.txt

This command exports dependencies rpcss Of other services , You can take a look at the service dependencies rpcss, Check one by one to narrow the scope

原网站

版权声明
本文为[shawyang]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/12/202112302340247305.html