RousselTMLEARNING

Article · Windows administration: from discovery to expertise

Users, groups, NTFS and SMB shares

1. Local accounts and groups #

Before the domain, the SAM database.

Local accounts #

Each machine has its local account database (SAM). On a domain, Active Directory accounts are mostly used, but local accounts remain useful for emergency administration and standalone servers. Each account and group is identified by a unique SID: it, not the name, appears in permissions.

$mdp = Read-Host -AsSecureString 'Mot de passe'
New-LocalUser -Name 'adm.secours' -Password $mdp -FullName 'Admin de secours' -PasswordNeverExpires:$false
Add-LocalGroupMember -Group 'Administrateurs' -Member 'adm.secours'   # « Administrators » sur un système anglais
Get-LocalGroupMember -Group 'Administrateurs'
Disable-LocalUser -Name 'Invité' ; Get-LocalUser | Select-Object Name, Enabled, LastLogon
whoami /all                                                           # SID, groupes et privilèges de la session
Built-in groupRole
Administratorsfull control of the machine
Userseveryday use, no admin rights
Remote Desktop UsersRDP logon without being admin
Backup Operatorsback up and restore bypassing permissions
Event Log Readersread logs without being admin

User Account Control (UAC) #

Even as a member of Administrators, a user works with a filtered token; elevation (“Run as administrator”) is requested for sensitive actions. On a server, open an elevated PowerShell console for administration, but do not disable UAC.

Common mistake: Using the same local admin account, with the same password, on every server: one stolen password opens the whole estate. Use Windows LAPS (see updates and security).

2. NTFS permissions #

Who can do what on a file.

ACLs, inheritance and effective permissions #

Each NTFS file and folder carries an ACL: a list of entries (ACEs) that allow or deny rights to SIDs. Standard permissions are Full control, Modify, Read & execute, List folder contents, Read, Write. By default, a folder inherits its parent’s permissions.

  • Permissions are cumulative: a user gets the union of their groups’ rights.
  • An explicit deny beats an allow; an inherited deny is beaten by an explicit allow.
  • The owner can always change permissions.
icacls D:\Data\Compta                                    # lire l'ACL
icacls D:\Data\Compta /inheritance:r                      # couper l'héritage (supprime les ACE héritées)
icacls D:\Data\Compta /grant 'CORP\GG_Compta:(OI)(CI)M'  # Modification, héritée par sous-dossiers (CI) et fichiers (OI)
icacls D:\Data\Compta /grant 'Administrateurs:(OI)(CI)F'
icacls D:\Data /save C:\sauvegarde\acl-data.txt /T       # sauvegarder les ACL ; /restore pour les remettre
(Get-Acl D:\Data\Compta).Access | Format-Table IdentityReference, FileSystemRights, AccessControlType, IsInherited
Good practice: Never grant rights to named users: grant them to groups. On a domain, apply AGDLP: accounts in global groups (business), placed in domain local groups (resource), which receive the permissions.

3. SMB shares #

Making a folder available on the network.

Create and secure a share #

Share and NTFS permissions

Network access (\\server\share) goes first through share permissions, then through NTFS permissions: effective access is the most restrictive of the two. Common practice: share at “Full control” or “Change” for authenticated users, with fine-grained control in NTFS.

New-SmbShare -Name Compta -Path D:\Data\Compta -ChangeAccess 'CORP\GG_Compta' -FullAccess 'Administrateurs' -FolderEnumerationMode AccessBased
Get-SmbShare ; Get-SmbShareAccess -Name Compta
Get-SmbSession ; Get-SmbOpenFile | Select-Object ClientUserName, Path    # qui est connecté, quels fichiers sont ouverts
Set-SmbServerConfiguration -EncryptData $true -Force                      # chiffrer tout le trafic SMB
New-PSDrive -Name S -PSProvider FileSystem -Root \\SRV-FS01\Compta -Persist   # côté client
Good to know: Access-based enumeration (AccessBased) hides folders the user cannot open. Windows Server 2025 and Windows 11 24H2 require SMB signing by default; SMBv1, obsolete and dangerous, is no longer installed.

Commands to know #

ActionCommand
Create a local userNew-LocalUser -Name jdupont -Password (Read-Host -AsSecureString)
Add to a groupAdd-LocalGroupMember -Group 'Utilisateurs du Bureau à distance' -Member jdupont
Read an ACLicacls D:\Data
Grant Modifyicacls D:\Data\Projet /grant 'CORP\GG_Projet:(OI)(CI)M'
Take ownershiptakeown /F D:\Data\Ancien /R /D O
Create a shareNew-SmbShare -Name Projet -Path D:\Data\Projet -ChangeAccess 'CORP\GG_Projet'
Open sessionsGet-SmbSession
Session and privilegeswhoami /groups

📄 Users, groups, NTFS permissions and SMB shares →

My progress

  • ⏱ Estimated time : ≈ 6 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Windows storage: disks, volumes, Storage Spaces and RAID

Manage storage on Windows: GPT and MBR, partitions and volumes with PowerShell, NTFS and ReFS, St...

Users, groups, sudo and permissions on Linux

Manage Linux accounts (useradd, usermod, passwd, chage), groups, sudo and visudo, rwx and octal p...

Windows updates and security: WSUS, Defender, BitLocker, LAPS and hardening

Maintain and secure a Windows estate: update strategy (Windows Update, WSUS, Azure Update Manager...

PowerShell for Windows administrators

Master PowerShell to administer Windows: cmdlets and help, object pipeline, filters and formats, ...

Windows administration best practices

The production checklist for Windows and Windows Server: installation, identity and Active Direct...

Windows and Windows Server: versions, editions and architecture

Discover the Windows ecosystem for administrators: Windows 11 and Windows Server 2025, editions a...

Group Policy (GPO): configuring the estate from Active Directory

Design and troubleshoot Group Policy: computer and user configuration, OU linking, LSDOU order, i...

Windows networking: IP, DNS, DHCP, firewall and remote access

Configure and troubleshoot Windows networking with PowerShell, deploy a DHCP server, master Windo...

Backup, Hyper-V and Windows troubleshooting

Back up and restore with Windows Server Backup (including system state and Active Directory), vir...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!