当前位置:网站首页>User identity used by startup script and login script in group policy
User identity used by startup script and login script in group policy
2022-07-03 18:40:00 【51CTO】
In Group Policy , We can use startup / To turn it off , Sign in / Log off these actions as events for executing scripts .

start-up / The shutdown script is under the computer configuration menu , Sign in / The logout script is under the user configuration menu . seeing the name of a thing one thinks of its function , Computer configuration is global , The authority must be relatively high . User configuration is specific to the user environment , Permission must be limited .
Let's see when running through an experiment Group Policy - Computer configuration - The startup script , as well as Group Policy - User configuration - Login script When , Specifically, what user identity is used to run .
First ,windows In the environment variable ,%username% Is the current user name ,%userprofile% Is the current user configuration path ,%homepath% Is the path of the current user's home directory ,%appdata% Is the current user data folder .whoami /user In addition to displaying the user name, the command can also display SID.
Write a script that contains the following :
whoami /user >>x:\test.txt
echo %username%,%userprofile%,%homepath%,%appdata%>>x:\test.txt
Pay attention to save the path. We give it everyone read-write permission .
Then make the startup script and login script respectively .
The computer operating system of the testing machine is win10, The name is test, Use users The account name of the permission is ceshi.
The final verification is as follows :
Boot script
whoami The display uses nt authority\system account number ,sid yes S-1-5-18
%username% yes TEST$ ,—— Add $ Symbol
%userprofile% yes C:\Windows\system32\config\systemprofile
%homepath% Display blank
%appdata% Is shown as C:\Windows\system32\config\systemprofile\AppData\Roaming
Login script
whoami The display uses domain name \ceshi,sid Namely S-1-5-21-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXX-XXXX
%username% yes ceshi
%userprofile% yes C:\Users\ceshi
%homepath% yes \Users\ceshi
%appdata% yes C:\Users\ceshi\AppData\Roaming
obviously , The identity used by the boot script is system user , Have more than administrators Authority
The login script uses the identity and permissions of the current login user . Therefore, some login scripts that must be run by the administrator cannot be used .
边栏推荐
- Have you learned the correct expression posture of programmers on Valentine's day?
- How to read the source code [debug and observe the source code]
- Theoretical description of linear equations and summary of methods for solving linear equations by eigen
- [combinatorics] generating function (positive integer splitting | unordered non repeated splitting example)
- Computer graduation design PHP makeup sales Beauty shopping mall
- After nohup NPM start &, close the shell window directly, and the process closes accordingly
- Okaleido, a multimedia NFT aggregation platform, is about to go online, and a new NFT era may come
- [combinatorics] exponential generating function (concept of exponential generating function | permutation number exponential generating function = combinatorial number ordinary generating function | e
- After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
- NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
猜你喜欢

Raft 日志复制

Nodejs (01) - introductory tutorial
知其然,而知其所以然,JS 对象创建与继承【汇总梳理】

Data analysis is popular on the Internet, and the full version of "Introduction to data science" is free to download

Analysis of the reasons why enterprises build their own software development teams to use software manpower outsourcing services at the same time

Web3 credential network project galaxy is better than nym?

Ping problem between virtual machine and development board

2022-2028 global physiotherapy clinic industry research and trend analysis report

Should I be laid off at the age of 40? IBM is suspected of age discrimination, calling its old employees "dinosaurs" and planning to dismiss, but the employees can't refute it

Raft log replication
随机推荐
English grammar_ Adjective / adverb Level 3 - multiple expression
Grammaire anglaise Nom - Classification
[combinatorics] generating function (positive integer splitting | unordered | ordered | allowed repetition | not allowed repetition | unordered not repeated splitting | unordered repeated splitting)
平淡的生活里除了有扎破皮肤的刺,还有那些原本让你魂牵梦绕的诗与远方
198. Looting - Dynamic Planning
4. Load balancing and dynamic static separation
Have you learned the correct expression posture of programmers on Valentine's day?
[combinatorics] generating function (positive integer splitting | unordered non repeated splitting example)
How about the Moco model?
042. (2.11) do it when it's time to do it
Zhengda futures news: soaring oil prices may continue to push up global inflation
How to draw non overlapping bubble chart in MATLAB
shell 脚本中关于用户输入参数的处理
知其然,而知其所以然,JS 对象创建与继承【汇总梳理】
How to expand the capacity of golang slice slice
论文阅读 GloDyNE Global Topology Preserving Dynamic Network Embedding
[enumeration] annoying frogs always step on my rice fields: (who is the most hateful? (POJ hundred practice 2812)
[combinatorics] exponential generating function (properties of exponential generating function | exponential generating function solving multiple set arrangement)
Unity2018 to wechat games without pictures
Computer graduation project PHP library book borrowing management system