> For the complete documentation index, see [llms.txt](https://jeanpeyremesmots.gitbook.io/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jeanpeyremesmots.gitbook.io/home/jpmm-en/system-administration/active-directory/decouverte-et-mise-en-place/2-test-des-permissions-et-gpo.md).

# 2 - Permissions testing and GPO

As defined in the requirements, members of the "**GG\_GRP\_ADMIN**" group must have read and write access to the "**Administratif**" folder and its subfolders. To test this, we log in as a member of that group, "**claurent**", using a temporary password that must be changed at first logon:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-50677db7c49eb17609232aaba17517a17506e005%2Fimage%20(99).png?alt=media" alt=""><figcaption></figcaption></figure>

We mount the share on **X:** with the "**net use**" command. No credentials are needed, since Windows uses the current session:

```powershell
 net use X: \\mesmots.local\ADMINISTRATIF
```

The share then appears:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-bc9036dd82e1d5afc6c56c728b5f5797bf01d017%2Fimage%20(85).png?alt=media" alt=""><figcaption></figcaption></figure>

And we can write to it, as expected. For example, in the share's "**ADMINISTRATIF/RH**" folder:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-e404a818b3260e9e35e277aa79331997c01881c6%2Fimage%20(86).png?alt=media" alt=""><figcaption></figcaption></figure>

Conversely, access to a forbidden folder such as "**DIRECTION**" is denied:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-a45e75475de84b6cdbb717e7c37e93a6884ac9fa%2Fimage%20(87).png?alt=media" alt=""><figcaption></figcaption></figure>

The NTFS permissions are doing their job! However, users won't want to connect to the share manually every time, and asking them to type a command is out of the question.

So we'll create a GPO that maps the drive automatically at logon.

### Creating the GPO

We create a GPO named "**U - Connecter - Lecteur - Réseau**" where the network drive will be mapped as "**X:**", as requested in the lab. I didn't know how to do this yet, but luckily the excellent blog [IT-Connect](https://www.it-connect.fr/) (in French) had just published the procedure:

{% embed url="<https://www.it-connect.fr/windows-comment-ajouter-des-emplacements-reseau-par-gpo/>" %}

Following the tutorial, my GPO looks like this:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-aa4666ce27d762a87883af2c99cc6c04d126614f%2Fimage%20(107).png?alt=media" alt=""><figcaption></figcaption></figure>

The first drive, "**P:**", is the personal folder required by the specifications: one folder per user, whose path is built from the username variable (e.g. **X:\PROFIL\_PERSO\Jean.MARTIN**). It is configured as follows:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-853bc4ef2b0017afb08ac6f7cf9e878f6bc1f595%2Fimage%20(108).png?alt=media" alt=""><figcaption></figcaption></figure>

Same thing for the "**Partages**" folder, mapped to "**X:**":

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-799c2d86338d1776395e4f00a6c218c56760897e%2Fimage%20(109).png?alt=media" alt=""><figcaption></figcaption></figure>

We then target all group members, along with Authenticated Users:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-0d4484973869f4707cdc8d88b1654461f5f3a83c%2Fimage%20(110).png?alt=media" alt=""><figcaption></figcaption></figure>

To validate the GPO, we log in on a Windows workstation with an account it targets (a member of the right security group, if item-level targeting is configured). We can keep using "**claurent**".

We run `gpupdate /force` to force a policy refresh and fetch the configuration from the domain controller.

In File Explorer, under **This PC** > **Network locations**, both the "**Partage**" and "**PROFIL\_PERSO**" shortcuts appear, confirming that the GPO is applied:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-07f996245a767bef05a0c1b01006a9ab653219d0%2Fimage%20(111).png?alt=media" alt=""><figcaption></figcaption></figure>

### Setting a quota on the share:

To keep the share from filling up, it's good practice to set a quota per user. Windows Server can enforce a size limit on a folder.

We start by installing the FSRM role:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-3920668345f40b98a8ffd77549a41cbdb9dbf264%2Fimage%20(112).png?alt=media" alt=""><figcaption></figcaption></figure>

I set a 100 MB limit on the personal folders. It's tight (the share is only 10 GB for 24 users ^^), but it shows how quotas behave and mirrors what you'd find in a real company.

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-ae014295d270889bbab28fc48a569c5e654ca0d7%2Fimage%20(113).png?alt=media" alt=""><figcaption></figcaption></figure>

Result: once logged in, the user sees a 100 MB limit:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-07f996245a767bef05a0c1b01006a9ab653219d0%2Fimage%20(111).png?alt=media" alt=""><figcaption></figcaption></figure>

Copying a file larger than 100 MB to the personal folder fails:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-907ea8b6b01957a1674f1c16a92a5ce90a42e860%2Fimage%20(115).png?alt=media" alt=""><figcaption></figcaption></figure>

Finally, we enable Remote Desktop:

<figure><img src="https://1542616339-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq0kLRqEluZvLRXK1LDcp%2Fuploads%2Fgit-blob-2cbdbb2491e11997d6b0d92ac3aea7df8814a766%2Fimage%20(116).png?alt=media" alt=""><figcaption></figcaption></figure>

In a real environment, the default port 3389 should be changed.
