windows.rst
changeset 2131 a8885a695eab
parent 2099 582907ac30d1
child 2132 b7f0192f395f
equal deleted inserted replaced
2130:511c1dd5b010 2131:a8885a695eab
   460 ------------
   460 ------------
   461 ::
   461 ::
   462 
   462 
   463   schtasks /delete /tn %TASK_NAME% /f
   463   schtasks /delete /tn %TASK_NAME% /f
   464 
   464 
   465 Change NTFS permission.
   465 Change NTFS permissions
   466 =======================
   466 =======================
   467 
   467 
   468   http://support.microsoft.com/kb/919240
   468 ``icacls`` allow option:
   469                 The Icacls.exe utility is available for Windows Server 2003 with
   469 
   470                 Service Pack 2
   470 * ``/c`` - Continues the operation despite any file errors. Error messages will
   471 
   471   still be displayed.
   472 Change NTFS permission with 'icacls'.
   472 * ``/t`` - Performs the operation on all specified files in the current
   473 -------------------------------------
   473   directory and its subdirectories.
   474 
   474 * ``/l`` - Performs the operation on a symbolic link versus its destination.
   475 'icacls' allow option:
   475 * ``/q`` - Suppresses success messages.
   476 
       
   477  * /c - Continues the operation despite any file errors. Error messages will
       
   478    still be displayed.
       
   479  * /t - Performs the operation on all specified files in the current directory
       
   480    and its subdirectories.
       
   481  * /l - Performs the operation on a symbolic link versus its destination.
       
   482  * /q - Suppresses success messages.
       
   483 
   476 
   484 Recursively change the owner of all matching files to the specified user::
   477 Recursively change the owner of all matching files to the specified user::
   485 
   478 
   486   cmd> icacls %dir% /setowner %user% /t /c
   479   cmd> icacls %dir% /setowner %user% /t /c
   487 
   480 
   491 
   484 
   492 Recursively grand full access for everyone::
   485 Recursively grand full access for everyone::
   493 
   486 
   494   cmd> icacls %dir% /t /grant:r %user%:(f)
   487   cmd> icacls %dir% /t /grant:r %user%:(f)
   495   cmd> icacls %dir% /t /grant:r *S-1-1-0:(f)
   488   cmd> icacls %dir% /t /grant:r *S-1-1-0:(f)
       
   489 
       
   490 Remove all permissons from file (first reset to inherited, then remove inherited)::
       
   491 
       
   492   cmd> icacls %FILE% /reset
       
   493   cmd> icacls %FILE% /inheritance:r
       
   494 
       
   495 http://support.microsoft.com/kb/919240
       
   496   The ``Icacls.exe`` utility is available for Windows Server 2003 with Service Pack 2.
       
   497 
       
   498 User management
       
   499 ===============
       
   500 
       
   501 List available users::
       
   502 
       
   503   cmd> net user
       
   504   cmd> wmic useraccount list brief
       
   505 
       
   506 List available groups::
       
   507 
       
   508   cmd> net localgroup
       
   509 
       
   510 List available users in group::
       
   511 
       
   512   cmd> net localgroup %GROUP%
       
   513   cmd> net localgroup Administrators
       
   514   cmd> net localgroup Users
       
   515 
       
   516 Current logged user::
       
   517 
       
   518   cmd> whoami
       
   519 
       
   520 Create new user by supplying password argument::
       
   521 
       
   522   cmd> net user /ADD %USER% %PASS%
       
   523 
       
   524 Create new user by entering password in prompt::
       
   525 
       
   526   cmd> net user /ADD %USER% *
   496 
   527 
   497 Well-known security identifiers (SID).
   528 Well-known security identifiers (SID).
   498 ======================================
   529 ======================================
   499 
   530 
   500   S-1-0-0
   531   S-1-0-0